Wednesday, June 7, 2017

Install Zabbix proxy on CentOS 7

11:47 AM Posted by Dilli Raj Maharjan No comments
A Zabbix proxy collects performance and availability data on behalf of the Zabbix server.  This way, a proxy can take on itself some of the load of collecting data and offload the Zabbix server. Using a proxy is the easiest way of implementing centralized and distributed monitoring, when all agents and proxies report to one Zabbix server and all data is collected centrally.

A Zabbix proxy can be used to:
  1. Monitor remote locations
  2. Monitor locations having unreliable communications
  3. Offload the Zabbix server when monitoring thousands of devices
  4. Simplify the maintenance of distributed monitoring
Monitoring hosts inside NAT using zabbix proxy.



Install zabbix-proxy on the one of the host inside NAT. Make Sure you have enable port forwarding so that zabbix server is able to reach the proxy host. If required enable firewall to allow traffic from and to the proxy from Zabbix server. 
rpm -ivh zabbix-proxy-sqlite3-3.2.6-1.el7.x86_64.rpm 


Unzip the file with SQL command to be executed on the database version. Here sqlite is used so we need to change directory to doc with sqlite database
cd /usr/share/doc/zabbix-proxy-sqlite3-3.2.6/
gunzip schema.sql.gz



Create sqlite database and create required schema objects.
mkdir /var/lib/sqlite
sqlite3 /var/lib/sqlite/zabbix.db



Change ownership of the sqlite database file.
chown -R zabbix:zabbix /var/lib/sqlite


Modify zabbiz-proxy configuration file and change the value of the server. We need to specify the IP address of the zabbix server on Passive checks related and Active checks related headings.
vi /etc/zabbix/zabbix_proxy.conf
Server=x.x.y.z
DBHost=localhost
DBName=/var/lib/sqlite/zabbix.db
DBUser=
DBPassword=
DBPort=

Note: Since we are using sqlite database we need to specify DBName with the location of the dbfile.





Now we can start zabbix-proxy server.


Add the proxy on the Zabbix Server Web. Click on Configuration >> Hosts.

Provide details of the host to be added. We need to provide the public IP address so that the machine can be accessible from the zabbix server.


Once host has been added add proxy setting. Click on Administration >> Proxies.


Provide the name of the proxy Select the required hosts and Click on Add.




In we can add the additional host that is inside the NAT. We can provide private IPaddress of the host.


Select the name of the proxy on the Monitor by proxy drop down list.



Zabbix Proxy cannot be start if the selinux mode is set to Enforcing. Following error message will be noticed while starting.



Following is the log message that is being displayed.



Use semodule -l command to list all selinux modules
semodule -l




Setting selinux for zabbix agent and zabbix proxy to permissive mode.
semanage permissive -a zabbix_t
semanage permissive -a zabbix_agent_t





Now zabbix agent and zabbix proxy can be started.



0 comments:

Post a Comment