Zabbix introduction:
Zabbix is an enterprise-level open-source solution that provides distributed system monitoring and network monitoring functions based on the Web interface.
Role: zabbix can monitor various network parameters to ensure secure operation of server systems. It also provides a flexible notification mechanism for system administrators to quickly locate and solve various problems.
Composition: consists of zabbix server and the optional component zabbix agent2.
Working mechanism and applicable platform: zabbix server can monitor the status of remote servers/networks, and collect data through SNMP, zabbix agent, Ping, and port monitoring, it can run on Linux, Solaris, HP-UX, Aix, Free BSD, open BSD, OS X and other platforms.
Today, we will explain how zabbix-proxy-agent works and how to install and configure it:
Topology:
650) This. width = 650; "style =" border-bottom: 0px; border-left: 0px; Height: 126px; border-top: 0px; border-Right: 0px; "Title =" image "border =" 0 "alt =" image "src =" http://img1.51cto.com/attachment/201410/11/7678232_1413029181aVGM.png "width =" 647 "Height =" 111 "/>
Objective: To use node1 to monitor the node3 server through node2.
Lab preparation:
The Node 1, node 2, and node 3 servers synchronize time.
[[email protected] ~]# ntpdate 172.16.0.110 Oct 15:16:52 ntpdate[1762]: step time server 172.16.0.1 offset 31785.627996 sec
1. install and configure zabbix-server on node1.
1. Install the server service and configure:
[[email protected] zabbix-2.4]# yum install zabbix-server-2.4.0-1.el6.x86_64.rpm zabbix-server-mysql-2.4.0-1.el6.x86_64.rpm zabbix-get-2.4.0-1.el6.x86_64.rpm zabbix-2.4.0-1.el6.x86_64.rpm zabbix-web-2.4.0-1.el6.noarch.rpm zabbix-web-mysql-2.4.0-1.el6.noarch.rpm zabbix-agent-2.4.0-1.el6.x86_64.rpm zabbix-sender-2.4.0-1.el6.x86_64.rpm http mysql-server
2. Create a zabbix database and import zabbix data to the MySQL database:
Create a database:
mysql> create database zabbix;Query OK, 1 row affected (0.00 sec)
Import zabbix table:
[[email protected] zabbix]#cd /usr/share/doc/zabbix-server-mysql-2.4.0/create[[email protected] create]# mysql zabbix <schema.sql[[email protected] create]# mysql zabbix <images.sql[[email protected] create]# mysql zabbix <data.sql
3. Authorize the user server to access the MySQL database and take effect immediately.
mysql> grant all on zabbix.* to ‘zbxuser‘@‘172.16.%.%‘ identified by ‘zbxpass‘;Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)
4. Configure the zabbix-Server Service and start the service:
[[email protected] create]# vim /etc/zabbix/zabbix_server.confDBHost=172.16.22.6 #修改数据库服务器位置DBUser=zbxuser #授权访问数据库zabbix用户的用户名DBPassword=zbxpass #授权访问数据库zabbix用户的密码DBSocket=/var/lib/mysql/mysql.sock #mysql.sock文件的位置,如果是本机则为/tmp/mysql.sock
Startup service:
[[email protected] create]# service zabbix-server startStarting Zabbix server: [ OK ]
5. Configure the PHP time zone and restart the Web Service:
[[email protected] create]# vim /etc/php.inidate.timezone = Asia/Shanghai #修改时区为亚洲/上海
Restart httpd to make the time zone take effect:
[[email protected] create]# service httpd restartStopping httpd: [ OK ]Starting httpd: [ OK ]
Ii. node2 and zabbix-proxy must use an independent database)
1. Install and start the database
[[email protected] zabbix-2.4]# yum -y install mysql-server[[email protected] zabbix-2.4]# /etc/init.d/mysqld start
2. Connect to the database, create a database, and grant the proxy access permission.
mysql> create database zabbixproxy;Query OK, 1 row affected (0.00 sec)mysql> grant all on zabbixproxy.* to ‘zbxuser‘@‘172.16.%.%‘ identified by ‘zbxpass‘;Query OK, 0 rows affected (0.00 sec)mysql> grant all on zabbixproxy.* to ‘zbxuser‘@‘node2‘ identified by ‘zbxpass‘;Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)
3. Install the zabbix-proxy service
[[email protected] zabbix-2.4]# yum install zabbix-2.4.0-1.el6.x86_64.rpm zabbix-proxy-2.4.0-1.el6.x86_64.rpm zabbix-proxy-mysql-2.4.0-1.el6.x86_64.rpm
4. Import the database and configure the proxy.
[[email protected] zabbix-2.4]# mysql zabbixproxy < /usr/share/doc/zabbix-proxy-mysql-2.4.0/create/schema.sql[[email protected] zabbix-2.4]# vim /etc/zabbix/zabbix_proxy.conf修改下列参数:Server=172.16.22.6DBHost=172.16.22.8DBName=zabbixproxyDBUser=zbxuserDBPassword=zbxpass
Iii. node3 and zabbix-agent
1. Install the agentf Service
[[email protected] zabbix-2.4]# yum install zabbix-agent-2.4.0-1.el6.x86_64.rpm zabbix-2.4.0-1.el6.x86_64.rpm
2. Configure the agent and start the service:
[[email protected] zabbix-2.4]# vim /etc/zabbix/zabbix_agentd.conf修改下列参数:Server=172.16.22.8ServerActive=172.16.22.8[[email protected] zabbix-2.4]# /etc/init.d/zabbix-agent startStarting Zabbix agent: [ OK ]
4. Configure zabbix-proxy-agent through the zabbix-Web Interface
1. Web connection zabbix, add a proxy
650) This. width = 650; "style =" width: 670px; float: none; Height: 462px; "Title =" 1.png" alt = "wkiol1q5h_zwokvgaamudiyd6pm956.jpg" src = "http://s3.51cto.com/wyfs02/M01/4C/39/wKioL1Q5H_zwokvgAAMUDIyD6PM956.jpg" width = "949" Height = "655"/>
2. Add hosts in configuration,
650) This. width = 650; "style =" width: 673px; float: none; Height: 585px; "Title =" 2.png" alt = "wKiom1Q5H8aBLEhCAAQBaz8fa-w269.jpg" src = "http://s3.51cto.com/wyfs02/M01/4C/37/wKiom1Q5H8aBLEhCAAQBaz8fa-w269.jpg" width = "605" Height = "583"/>
3. Add a monitoring template
650) This. width = 650; "style =" width: 671px; float: none; Height: pixel PX; "Title =" 3.png" alt = "wkiol1q5h_6xnpybaauz1z8x0uc637.jpg" src = "http://s3.51cto.com/wyfs02/M02/4C/39/wKioL1Q5H_6xNpYBAAUz1z8x0uc637.jpg" width = "856" Height = "356"/>
V. Joint debugging Test
650) This. width = 650; "style =" width: 671px; float: none; Height: 390px; "Title =" 4.png" alt = "wKioL1Q5IADQa7C6AAbV9dpZe-k367.jpg" src = "http://s3.51cto.com/wyfs02/M01/4C/39/wKioL1Q5IADQa7C6AAbV9dpZe-k367.jpg" width = "972" Height = "493"/>
Success !!!!!
Summary:
1. zabbix-proxy-agent operating mode features:
The proxy will not synchronize the configuration to the server, but will only receive the configuration.
The proxy database regularly transmits data to the server. The proxy local database only saves the data that has not been sent recently.
Proxy has only one proxy daemon and has its own database, but its database only saves data for a certain period of time. It communicates with the server by packaging a batch of information and sending it to the server, server integrates the data into the (merge) Server database.
2. Advantages of zabbix-proxy-agent working mode:
The proxy is under low pressure and the database only stores data for a certain period of time.
The pressure on the master is small, and the data is not continuously obtained, reducing the I/O pressure.
The architecture is clear and easy to maintain.
This article is from the Gentoo blog, please be sure to keep this source http://linuxgentoo.blog.51cto.com/7678232/1562669
Zabbix's zabbix-proxy-agent working mode