Install Zabbix Agent on Synology
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:
DS> 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
DS> cd /root DS> wget http://downloads.sourceforge.net/.../zabbix-1.9.3.tar.gz DS> tar xzf zabbix-* DS> cd zabbix-* DS> ./configure --enable-agent --prefix=/opt/zabbix
The compiler starts running for a few minutes and shows this error:
(...) checking for ICONV support... no configure: error: Unable to find iconv.h "no"
Let’s see if the named file is on your system
DS> find / -name iconv.h /volume1/@optware/include/iconv.h /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
DS> cd /usr/ DS> ln -s /opt/include/ include
Now start recompiling, you’ll see no more errors.
DS> cd /root/zabbix-* DS> ./configure --enable-agent --prefix=/opt/zabbix DS> make DS> 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:
PidFile=/tmp/zabbix_agentd.pid LogFile=/opt/zabbix/agentd.log Server=192.168.2.2 # Your Zabbix Server IP Hostname=synology.domain.tld

(1)
(4)
(0)
I have trouble creating the init-script. Could you please post your version?
Tahnks
Hi,
I’ve updated the article with a sample configuration and how to start the deamon.
Thanks for your quick response.
I tried your suggestion, but it will always require the user zabbix even when AllowRoot is set to 1 in the conf-file.
One need to create a user “zabbix” as part of the admin group in the DM interface (control panel->user)
Doing so, it works like a charm.
Thanks again!
Use the command below (from a bash shell, not sh) to execute it under the user:
su – zabbix -c “/opt/zabbix/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf”
I have also trouble creating the init-script. Could you please advice howto make automatic start of Zabbix? Now if you restart Synology server Zabbix will not start automatically
Thanks!
This is brilliant. I’d been using Pandora FMS to monitor a Diskstation via SNMP, and after switching to Zabbix I was dreading configuring all those SNMP fields. Running a Zabbix agent is so much simpler and your instructions made it super easy. Thanks!
My dream a little Zabbix server on synoly to monitor few website and servers