Zabbix is an enterprise-level open-source solution that provides distributed system monitoring and network monitoring functions based on the Web interface. 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. Zabbix consists of two parts: zabbix server and the optional component zabbix agent. Zabbix server can provide remote server/network status monitoring, data collection and other functions through SNMP, zabbix agent, ping, port monitoring and other methods, it can run in Linux, Solaris, HP-UX, aix, Free BSD, open BSD, OS X, and other platforms. The zabbix agent must be installed on the monitored target server. It collects hardware information, memory, CPU, and other information related to the operating system. Zabbix agent can run on Linux, Solaris, HP-UX, Aix, Free BSD, open BSD, OS X, Tru64/osf1, windows and other systems. The zabbix server can independently monitor the service status of the remote server. It can also be used with the zabbix agent to poll the zabbix agent to actively receive monitoring data (in the agent mode ), it can also passively receive data sent by zabbix agent (trapping mode ).
In addition, zabbix server also supports SNMP (V1, V2) and can be used with SNMP software (for example, net-snmp.
Deploy zabbix below. Version 2.0.4 is used.
1. Download zabbix
[email protected]:tmp# axel -n 10 http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.0.4/zabbix-2.0.4.tar.gz
2. Create a user account
[email protected]:tmp# groupadd zabbix[email protected]:tmp# useradd -g zabbix zabbix
3. Create and initialize the zabbix Database
mysql>create database zabbix;mysql>grant all on zabbix.* to [email protected] identified by ‘179179‘;mysql>flush privileges;[email protected]:tmp# tar zxvf zabbix-2.0.4.tar.gz[email protected]:tmp# cd zabbix-2.0.4[email protected]:zabbix-2.0.4# mysql -uroot zabbix -p179179 < database/mysql/schema.sql[email protected]:zabbix-2.0.4# mysql -uroot zabbix -p179179 < database/mysql/images.sql[email protected]:zabbix-2.0.4# mysql -uroot zabbix -p179179 < database/mysql/data.sql
4. Install zabbix in source code
[Email protected]: zabbix-2.0.4 # apt-Get install SNMP libsnmp-dev # compile the server and client [email protected]: zabbix-2.0.4 #. /configure -- prefix =/usr/local/zabbix -- enable-server -- enable-agent -- With-mysql -- With-net-snmp -- With-libcurl [email protected]: zabbix-2.0.4 # Make [email protected]: zabbix-2.0.4 # make install [email protected]: ~ # Ls-L/usr/local/zabbix/etc/total 56-rw-r -- r -- 1 root staff 1601 Jul 7 zabbix_agent.confdrwxr-sr-x 2 root staff 4096 Jul 7 zabbix_agent.conf.d-rw-r -- r -- 1 root staff 5834 Jul 7 zabbix_agentd.confdrwxr-sr-x 2 root staff 4096 Jul 7 zabbix_agentd.conf.d-rw-r -- r -- 1 root staff 6387 Jul 7 zabbix_agentd.win.conf-rw-r -- r -- 1 root staff 9704 Jul 7 zabbix_proxy.conf-rw-r -- r -- 1 Root staff 10385 Jul 7 zabbix_server.confdrwxr-sr-x 2 root staff 4096 Jul 7 zabbix_server.conf.d # For ease of configuration, A soft connection [email protected]: ETC # cd/etc/[email protected]: ETC # ln-S/usr/local/zabbix # copy the template configuration [email protected]: zabbix-2.0.4 # cp-a conf/*/etc/zabbix/# copy the front page [email protected]: zabbix-2.0.4 # cp-A frontends/PHP/*/var/www/[email protected]: zabbix-2.0.4 # chown www-data.www-data/var/www/-R
5. Copy the generated binfile to/bin,/sbin, and configure the startup script.
[Email protected]: zabbix # cd/bin [email protected]: Bin # ln-S/usr/local/zabbix/bin/zabbix_get [email protected]: bin # ln-S/usr/local/zabbix/bin/zabbix_sender [email protected]: zabbix # cd/sbin [email protected]: sbin # ln-S/usr/local/zabbix/sbin/zabbix_agent [email protected]: sbin # ln-S/usr/local/zabbix/sbin/zabbix_agentd [email protected]: sbin # ln-S/usr/local/zabbix/sbin/zabbix_server # copy startup service script [email protected]: zabbix-2.0.4 # cp MISC/init. d/Debian/*/etc/init. d/# Modify/etc/init. d/zabbix-* bin program path daemon =/sbin/$ {name}
6. Modify the zabbix configuration file
Zabbix_server.conf Server Configuration
[email protected]:zabbix# egrep -v "(#|^$)" /etc/zabbix/zabbix_server.confListenPort=10051SourceIP=10.1.1.179LogFile=/tmp/zabbix_server.logDBHost=10.1.1.179DBName=zabbixDBUser=zabbixDBPassword=179179DBPort=3306
Zabbix_agentd.conf client Configuration
/Etc/zabbix/zabbix_agentd.conf (agentd, not Agent)
Angentd obtains host data and sends the collected data to the server (active mode ). Or the server actively retrieves data (passive mode ).
[Email protected]: zabbix # egrep-V "(# | ^ $) "/etc/zabbix/zabbix_agentd.conf logfile =/tmp/queues = 1 logremotecommands = 1 Server = 10.1.1.179listenport = 10050 listenip = protocol = 3 serveractive = 10.1.1.179hostname = 10.1.1.179 # host management for monitoring configuration this name
7. Start the zabbix Service
[email protected]:zabbix#/etc/init.d/zabbix-server start[email protected]:zabbix#/etc/init.d/zabbix-agent start[email protected]:zabbix# ss -lt | grep zabbixLISTEN 0 128 *:zabbix-agent *:* LISTEN 0 128 *:zabbix-trapper *:* [email protected]:zabbix# ss -ltn | grep 10050LISTEN 0 128 *:10050 *:* [email protected]:zabbix# ss -ltn | grep 10051LISTEN 0 128 *:10051 *:*
8. Configure zabbix in the browser
Modify the PHP configuration as prompted by the browser
Default password admin/zabbix
9. Set Chinese
[Email protected]: zabbix # apt-Get install debconf # select zh_CN.UTF-8 [email protected]: zabbix # dpkg-reconfigure locales
Click profile in the upper-right corner of the page to set
10. New client
[email protected]:zabbix#groupadd zabbix[email protected]:zabbix#useradd -g zabbix zabbix[email protected]:zabbix#tar zxvf zabbix-2.0.4.tar.gz[email protected]:zabbix#cd zabbix-2.0.4/[email protected]:zabbix#./configure --prefix=/usr/local/zabbix --enable-agent[email protected]:zabbix#make[email protected]:zabbix#make install[email protected]:zabbix#cp misc/init.d/debian/* /etc/init.d/[email protected]:zabbix#cd /sbin[email protected]:zabbix#ln -s /usr/local/zabbix/sbin/zabbix_agent zabbix_agent[email protected]:zabbix#ln -s /usr/local/zabbix/sbin/zabbix_agentd zabbix_agentd[email protected]:zabbix#cd /etc[email protected]:zabbix#ln -s /usr/local/zabbix/etc zabbix[email protected]:zabbix# vim /etc/init.d/zabbix-agent DAEMON=/sbin/${NAME} [email protected]:zabbix# /etc/init.d/zabbix-agent start
In browser configuration, create a host in the host and add a template
Refer:
Https://www.zabbix.com/documentation/2.0/