I wanted to share the result of a couple hours of work trying to get zabbix-agent to compile on SUSE (which doesn't provide packages on its installation media).
I tried to be as thorough as possible in naming all the lib packages it needs, but I may have missed some as I haven't tried this on a clean machine yet. Worst named lib: No idea why SUSE decided to name it prce-devel and not libpcre-devel.
Then, to install the binary to the system:
The online instructions about compiling zabbix are out of date as zabbix now uses autotools. I had to experiment to find out that "autoreconf" and "automake --add-missing" are needed. It's really hard to find out how to use automake if you're not familiar. Please update the instructions so those compiling will not either waste hours of time figuring this out or, for less patient/experienced sysadmins: give up entirely.
This may be due to autotools only being v2.69 on SUSE, and not the newer 2.70/2.71; but by default the makefile it makes will not compile with a bunch of cryptic errors about unresolved symbols, due to the fact that it's missing "-lresolve" so the linker won't see DNS functions in glibc.
I tried to fix this by appending this to "LIBS".
This also would not work for two reasons:
1. The makefile, if modified, won't actually re-compile. Something with automake/autotools/make is causing make to think the file was not modified. So in that case I did the nuclear option:
(do everything again from the beginning).
2. After a few tries I found out that "LIBS" actually isn't appended to the command line.
So I hacked it and added "-lresolve" to LIBPCRE_LIBS (which is required by default), before trying to run make.
.
I tried to be as thorough as possible in naming all the lib packages it needs, but I may have missed some as I haven't tried this on a clean machine yet. Worst named lib: No idea why SUSE decided to name it prce-devel and not libpcre-devel.
Code:
zypper install -y gcc git make makeinfo autoconf automake glibc-devel-static gettext-tools gcc-c++ libevent libevent-devel libresolv libresolv-devel pcre-devel cd /usr/src/ wget https://cdn.zabbix.com/zabbix/sources/stable/6.4/zabbix-6.4.4.tar.gz tar -xvf zabbix-6.4.4.tar.gz rm zabbix-6.4.4.tar.gz cd zabbix-6.4.4/ aclocal && autoreconf -f && automake --add-missing ./configure --enable-agent --disable-server --enable-ipv6 sed -i "s/^\(LIBPCRE_LIBS.*\)/\1 -lresolve/g" Makefile CORES=$(nproc) env LDFLAGS=-lresolve make -j$CORES 2>&1 | tee log
Then, to install the binary to the system:
Code:
make install
This may be due to autotools only being v2.69 on SUSE, and not the newer 2.70/2.71; but by default the makefile it makes will not compile with a bunch of cryptic errors about unresolved symbols, due to the fact that it's missing "-lresolve" so the linker won't see DNS functions in glibc.
I tried to fix this by appending this to "LIBS".
This also would not work for two reasons:
1. The makefile, if modified, won't actually re-compile. Something with automake/autotools/make is causing make to think the file was not modified. So in that case I did the nuclear option:
Code:
rm -rf /usr/src/zabbix-6.4.4/*
2. After a few tries I found out that "LIBS" actually isn't appended to the command line.
So I hacked it and added "-lresolve" to LIBPCRE_LIBS (which is required by default), before trying to run make.
.
Comment