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
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
I ran into some stuff on my synology DS1010+
I had to update the binutils package (ie. ipkg install binutils)
and also my libc-dev package (ie ipkg install libc-dev)
After that I didnt even run into the iconv.h error
Oh I did run into the iconv.h error ;P please scratch that part =)
I’m completely stuck on syno 4.1.
Any uppdated help?
Hi,
Everything seems to go ok for DS210 J but I don’t see any site appearing.
Used this as config
PidFile=/tmp/zabbix_agentd.pid
LogFile=/opt/zabbix/agentd.log
Server=192.168.1.6 # Your Zabbix Server IP
Hostname=ds210.homelab.local
And this as startup
/opt/zabbix/sbin/zabbix_agentd -c /opt/zabbix/etc/zabbix_agentd.conf &
When I run top I don’t see any zabbix, when I go the url http://myip/zabbix there is no site neither on port which zabbix runs on normally.
Would be great to have it running.
? I left a post yesterday but it is gone today?
Everything seems to go well on DS 210J but have no clue where to start it. CPU/MEM is loaded more then normal so it is running but how to access?
Note: I used the latest version of Zabbix (2.0.3) and the path /etc/zabbix/zabbix_agentd.conf does not exist so I used the /opt-path.
Reinstalled my Synology now, I’d need some more input for configuring, if there is none, no problem but I won’t install it again then (to bad).
New comments are moderated due to the amount of spam. That’s why it doesn’t appear immediately. Your problem is that there are some changes in Zabbix 2.0. By default, Zabbix will not look in /etc/zabbix but in /opt/zabbix/etc/. Personally a dislike since I’ll automatically look in /etc for config files. A good old symlink will fix this:
root@zabbix:~# ls -lha /etc/zabbix
lrwxrwxrwx 1 root root 16 Nov 2 12:22 /etc/zabbix -> /opt/zabbix/etc/
If this doesn’t help check your logfiles in /var/log/zabbix
followed the instruction and installed the latest zabix v.2.0.6 sucessfully
but how to get access to the gui screens?
changed to config to point to my internal ip of the synology nas
These instructions are for the Zabbix Agent. A complete installation of Zabbix exists of these components:
– Zabbix Server
– Zabbix Agent
– Zabbix GUI
– Zabbix Proxy (not mandatory)
So, only installing the Agent does not give you a GUI. Even with the Server process installed (Postgres SQL or MySQL mandatory, both are available on the Syno) does not give you a GUI.
Zabbix GUI gives you – what’s in the name – the Graphical User Interface. This package exists of a bunch of PHP scripts (also runnable on the Syno or even a 3th party webhost if firewalling allows) displaying your data.
I’d suggest to read the Zabbix book to gain some more knowledge about Zabbix installations and configurations. It’s available with PACT, easy readable als will help you on your way, even tough it’s written for v1.8. See: http://www.packtpub.com/zabbix-1-8-network-monitoring/book
[…] make sure that I was able to run the zabbix agent on the device. I ran into a post entitled “Install Zabbix Agent on Synology” and it seems that it was possible. Following the instructions laid out in that post, here is […]
10x a lot!
btw in my case i’d to use ./configure –enable-agent –prefix=/opt/zabbix –with-iconv-include=/volume1/@optware/include/ b/4 make and make install
Hi, missing iconv is no more problem. But you need to install overk ipkg pcre-dev for libpcre.
8
Randy
Download site
Randy
how to write eassy
Randy
Does it is still working?? i want install zabbix agent 4.2 on my Synology DS3615xs with DSM 6.2.2. Thanks