In this recipe, we will show you how to install a proxy in your network. The installation of a proxy is very straightforward as you will see. However, monitoring and configuring the proxy can be more complicated. For this reason, we have split up installation and the different types of configuring a proxy in this chapter.
What we need for this recipe is of course, our Zabbix server with super administrator rights. We need an extra machine to install our proxy.
As the proxy is a lightweight version of the Zabbix server, the installation procedure is almost exactly the same.
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix- release-2.4-1.el6.noarch.rpm
proxy
. We will make use of a SQLite database:yum install zabbix-proxy-sqlite3
proxy
will start at our next reboot:chkconfig zabbix-proxy on
10051
, the same port that we use for the Zabbix trapper. Edit the /etc/sysconfig/iptables
file and add the following line under the line with the –dport 22
option:-A INPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPT
service iptables restart
proxy
configuration by editing the zabbix_proxy.conf
file.vi /etc/zabbix/zabbix_proxy.conf Change the following parameters Server=<ip of your zabbix server> Hostname=<name of your proxy> DBName=/home/zabbix/zabbix.db
home
directory for our database:mkdir /home/zabbix chmod 750 /home/zabbix chown zabbix:zabbix /home/zabbix
service zabbix-proxy start
tail /var/log/zabbix/zabbix_proxy.log
The Zabbix proxy is basically a Zabbix server without a graphical interface with the difference that the proxy will only collect the data and send it to the Zabbix server for processing. So when we install a proxy, we need a database just like we have on the server. In this setup, we made use of a SQLite database and as you have noticed we did not have to install anything. When you make use of a SQLite database, the proxy will create the database and do all configuration work for you.
It is possible to use any database that can be used for the Zabbix server. However, we then need to change the zabbix_proxy.conf
file and fill in the correct username and password and tell the proxy to use a MySQLdb, PostgreSQL, or Oracle database.
Another thing that is important when using a real database is to only upload the schema.sql
file and never the images.sql
, and data.sql
files!
To monitor large or distributed networks, you can make use of Zabbix proxies. A proxy will then be responsible for a certain number of hosts. The proxy will be the only one talking to the hosts and will forward all the data to the Zabbix server.
The use of proxies is always useful when the Zabbix server cannot reach the hosts due to routing and or firewalls or for hosts in DMZ. The use of a proxy can also be used to monitor resources from outside your network.
The proxy will also reduce database load on the server when you have many hosts to monitor. Since the proxy transmits the data collected in a large block, the database needs only a few large inserts and updates processed. This produces less load than many small operations.
The combination with so-called reverse tunneling (SSH, OpenVPN) allows you to monitor with proxies on networks that can be accessed only through a connection with dynamic IP address.
A proxy can collect data on behalf of the Zabbix server. For this reason, a proxy must be compiled with the same options as the server. When you monitor, for instance, host via SNMP, then the proxy must be built with SNMP support. When you run external scripts, those scripts must be installed on the proxy instead of Zabbix server.
If you use a proxy, remember the following:
zabbix_sender
option, then you must send it to the proxy.