Using proxy for distributed monitoring of zabbix

Source: Internet
Author: User
Tags snmp

Zabbix proxy is equivalent to zabbix server. It collects monitoring data from one or more monitoring devices at intervals and sends it to zabbix server, the proxy then stores the data in the database for a period of time (Measures to prevent the Proxy from failing to monitor the data to the server, and the data will be automatically cleared after the arrival time ).

Deploying proxy is optional, but it is very effective for sharing the load of zabbix server. If you collect monitoring data on proxies, it will greatly reduce the consumption of CPU resources and disk Io by server processes.


I. Environment

IP role hostname zabbix Version System 192.168.244.20.zabbix server 255.2.2.5 centos 6.5192.168.244.134 zabbix proxy proxy.xxx.com 2.2.5 centos 6.5192.168.244.135 zabbix agent node1.xxx.com 2.2.5 centos 6.5

Zabbix server and zabbix Agent installation see: http://gzguitar.blog.51cto.com/5406286/1542176


Ii. Install zabbix proxy

  1. Install dependency packages

# yum -y install mysql mysql-server gcc gcc-c++ automake autoconf curl curl-devel net-snmp net-snmp-devel libssh2 libssh2-devel


2. Add a user

# groupadd zabbix# useradd -g zabbix zabbix


3. Download, decompress, and install the source package

# tar xf zabbix-2.2.5.tar.gz# cd zabbix-2.2.5# ./configure --prefix=/usr/local/zabbix --enable-agent --enable-proxy --with-mysql --with-net-snmp --with-libcurl --with-ssh2# make && make install


4. Configure the database

# mysql -uroot -p  mysql> create database zabbix character set utf8;  mysql> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix’;  mysql> flush privileges; # mysql -uzabbix -pzabbix zabbix < database/mysql/schema.sql


5. Modify the zabbix_proxy.conf file. The modified file is as follows:

[[Email protected] etc] # grep-V "#" zabbix_proxy.conf | sed '/^ $/d' Server = 192.168.244.133 # The value should be the IP address of zabbix server or the hostname = proxy.xxx.com # proxy host name logfile =/tmp/zabbix_proxy.logdbhost = localhostdbname = zabbixdbuser = zabbixdbpassword = zabbixproxylocalbuffer = 0 proxyofflinebuffer = 1 # proxy or server cannot be connected, the time when offline monitoring data is retained, in the unit of hour configfrequency = 120 # The synchronization interval between server and proxy configuration modification, set 5-10 minutes to datasenderfrequency = 10 # data sending interval, 10-30sstartpollers = 10 # enable multiple threads. Generally, do not exceed 30 startpollersunreachable = 1 # This thread is used to separately monitor hosts that cannot be connected, starttrappers = 10 # Trapper thread count startpingers = 1 # fping thread count cachesize = 64 m # The number of caches used to save monitoring data, adjust timeout = 10 # The timeout value based on the number of monitored hosts. Set the timeout value to be less than 30 s. Otherwise, the system will slow down other monitoring data capture times. trappertimeout = 30


6. Create a STARTUP script

# /bin/cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_proxy# sed -i ‘s/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g‘ /etc/init.d/zabbix_proxy# sed -i ‘s/\s\+BINARY_NAME=zabbix_agentd/BINARY_NAME=zabbix_proxy/g‘ /etc/init.d/zabbix_proxy# /bin/cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd# sed -i ‘s/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g‘ /etc/init.d/zabbix_agentd


7. Start the zabbix_proxy Service

# service zabbix_proxy start


3. Agent Configuration

1. Modify the zabbix_agentd.conf File

# Vim/usr/local/zabbix/etc/zabbix_agentd.confserver = 192.168.244.133 # proxy IP or domain name serveractive = 192.168.244.133 # proxy IP or domain name hostname = node1.xxx.com


2. Restart the zabbix_agentd service.

service zabbix_agentd restart


Iv. Server Configuration

1. Add the proxy node, administration --> DM --> Create proxy under the web page

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/97/wKiom1QWUE6QSGmyAADXPz24S-g298.jpg "Title =" proxy.png "alt =" wKiom1QWUE6QSGmyAADXPz24S-g298.jpg "/>

(1) The proxy name must be consistent with the hostname in zabbix_proxy.conf.

(2) The proxy mode is divided into active and passive. Active means that the proxy server will actively connect to the zabbix server and request data distribution. passive means that the zabbix server connects to the proxy server, because zabbix server has a large load and I/O, we recommend that you do not use the passive mode.

(3) hosts is the monitored server under the proxy.


2. Add the server information to be monitored under the proxy's jurisdiction on the web page, configuration --> host --> Create host --> enter information and associated template --> Save

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/97/wKiom1QWUWLQC3xkAALfoAR-v1k245.jpg "Title =" proxy1.png "alt =" wKiom1QWUWLQC3xkAALfoAR-v1k245.jpg "/>

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/97/wKiom1QWUYOxu_hsAAFHMzkzIP4499.jpg "Title =" proxy2.png "alt =" wkiom1qwuyoxu_hsaafhmzkzip4499.jpg "/>


After a while, related data will appear.

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/97/wKiom1QWUbfjDTLGAAK5SOjPKEU927.jpg "Title =" proxy3.png "alt =" wkiom1qwubfjdtlgaak5sojpkeu927.jpg "/>

This article is from the "gzguitar" blog, please be sure to keep this source http://gzguitar.blog.51cto.com/5406286/1552763

Using proxy for distributed monitoring of zabbix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.