Since a few  months I use a Synology DS211 NAS device at home, to store my music, movies and back-ups. I also use Zabbix to monitor my servers, switches, etc. Since there is a Zabbix agent package for most Linux distributions, there was none for the Synology. But… Synology is Linux so let’s rock and compile them from source.

I assume that my readers are hard-core System Administrators who know how to enable SSH access and become root. The next thing to do is slipstream your Synology and install the ipkg package-manager. Now, install some build tools with the command:

1DS> ipkg install gcc make bison flex gconv-modules

Let’s get the Zabbix source, in my case 1.9.3-beta, untar them and start compiling

1DS> cd /root
3DS> tar xzf zabbix-*
4DS> cd zabbix-*
5DS> ./configure --enable-agent --prefix=/opt/zabbix

The compiler starts running for a few minutes and shows this error:

1(...)
2checking for ICONV support... no
3configure: error: Unable to find iconv.h "no"

Let’s see if the named file is on your system

1DS> find / -name iconv.h
2/volume1/@optware/include/iconv.h
3/opt/include/iconv.h

The Zabbix configure script will look for the iconv.h file in /usr/include, not in /opt/include. Setting a symlink will fix this

1DS> cd /usr/
2DS> ln -s /opt/include/ include

Now start recompiling, you’ll see no more errors.

1DS> cd /root/zabbix-*
2DS> ./configure --enable-agent --prefix=/opt/zabbix
3DS> make
4DS> make install

Only thing left is creating configuration files and a init-script and a sample configuration file. Start Zabbix with from an SSH shell with “/opt/zabbix/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf &”

An sample /etc/zabbix/zabbix_agentd.conf:

1PidFile=/tmp/zabbix_agentd.pid
2LogFile=/opt/zabbix/agentd.log
3Server=192.168.2.2 # Your Zabbix Server IP
4Hostname=synology.domain.tld