Zabbix is our favorite monitoring tool and the new 2.0 release contains a range of great new features.
One of the most useful features of the Zabbix architecture is support for Zabbix proxies. A Zabbix proxy gathers monitoring data and forwards it to the central monitoring server. This is really useful if you have a group of servers inside a firewall that need to be monitored. Just setup a Zabbix proxy inside the firewall and all the monitoring data can be securely forwarded to the central external monitoring server.
The documentation of proxy setup is here:
http://www.zabbix.com/documentation/2.0/manual/distributed_monitoring/proxies
For a CentOS 6 server here are the steps that I used to install and configure a Zabbix proxy.
- Download latest source distribution from http://www.zabbix.com/download.php.
- Unpack, compile and install according to docs at:
http://www.zabbix.com/documentation/2.0/manual/installation/install
Since we’re installing from source we need a selection of build tools which I added with:
1yum install gcc makeThe Zabbix proxy needs a local database. We used SQLite because it’s lightweight and setup is automatic with the new 2.0 version of Zabbix.
1yum install sqlite sqlite-develWe want SNMP enabled so we’ll need to add the net-snmp devel and libs packages. Also we need the ssh2 packages:
1yum install net-snmp-libs net-snmp-devel libssh2-devel libssh2Now we’re ready to do the build:
12345678910[root@host]# tar -xvzf zabbix-2.0.3.tar.gz...[root@host]# cd zabbix-2.0.3[root@host zabbix-2.0.3]# groupadd zabbix[root@host zabbix-2.0.3]# useradd -g zabbix zabbix[root@host zabbix-2.0.3]# ./configure --prefix=/usr --sysconfdir=/etc/zabbix --enable-proxy \--with-net-snmp --with-sqlite3 --with-ssh2...[root@host zabbix-2.0.3]# make install...Notice for the configure command we (a) set the install prefix to /usr which is consistent with CentOS; (b) enable the proxy features; (c) select SQLite as the database and (d) enable support for snmp and ssh2.
Now create a directory for the database and load the initial schema:
12345[root@host]# mkdir /var/zabbix[root@host]# chown zabbix.zabbix /var/zabbix[root@host]# cd database/sqlite3/[root@host]# sqlite3 /var/zabbix/zabbix.db < schema.sql[root@host]# chown zabbix.zabbix /var/zabbix/zabbix.dbNext, edit /etc/zabbix/zabbix_proxy.conf and set the “Server=” parameter to the address of the zabbix server. Also set the “DBName=” as the path to the database:
12Server=123.123.123.123DBName=/var/zabbix/zabbixAdd startup command to /etc/rc.local:
1/usr/sbin/zabbix_proxy -c /etc/zabbix/zabbix_proxy.confAlso run the startup command manually to start the proxy for the first time.
- Next we’ll configure the central monitoring server to recognize the proxy.
- Login to the web interface and go to Administration -> DM.
- Click the Create Proxy button.
- On the new proxy form, enter the hostname of the proxy into the “Proxy name” field.
- Click the Save button
- Finally, on install Zabbix Agents as you would normally on the servers to be monitored from the proxy. In the Zabbix web interface, when defining a host monitored via the proxy, set the “Monitored by proxy” field on the host configuration form.