Zabbix is similar to cacti and is an open source monitoring software based on Web interface. However, it also provides an enterprise-class solution for distributed system monitoring.
Zabbix consists of Zabbix server and optional component Zabbix Agent.
Server side can be Snmp,zabbix agent,ping, port monitoring and other methods to provide remote server status monitoring, data collection and other functions. This component can be run on platforms such as Linux.
Agent side needs to be installed on the target server being monitored, mainly to complete the hardware information or operating system related memory, CPU and other information collection.
Zabbix server can independently monitor the service status of a remote server, can also work with the Zabbix agent, poll the Zabbix agent to actively receive monitoring data, and passively receive data sent by the Zabbix agent.
The advantages and disadvantages of Zabbix are as follows:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7F/DA/wKioL1cwJbPjhzlXAAF3iVPxSzM494.png "title=" 12.png "alt=" Wkiol1cwjbpjhzlxaaf3ivpxszm494.png "/>
Next we'll install the Zabbix:
Before installing the Zabbix, you also need to install the Epel extension source, because CentOS comes with a yum source without Zabbix!
Yum Install-y epel-release
Install the LNMP environment using the Yum installation method:
[[email protected] ~]# yum install-y httpd mysql mysql-libs php php-mysql mysql-server php-bcmath php-gd php-mbstring
To install the Zabbix server:
[email protected] ~]# Yum install zabbix20 zabbix20-agent zabbix20-server zabbix20-server-mysql zabbix20-web zabbix20-w Eb-mysql Net-snmp-devel
After the installation is complete, configure and modify the MySQL configuration file:
VIM/ETC/MY.CNF/Make the following changes [Mysqld]character_set_server = Utf8[mysql]default-character-set = UTF8
Then start MySQL and import three SQL files:
[Email protected] ~]# mysql-uroot-p-E "CREATE database Zabbix" Enter password: [[email protected] ~]# mysql-uroot-p --default-character-set=utf8 Zabbix </usr/share/zabbix-mysql/schema.sqlenter password: [[email protected] ~]# Mysql-uroot-p--default-character-set=utf8 Zabbix </usr/share/zabbix-mysql/images.sqlenter password: [email Protected] ~]# mysql-uroot-p--default-character-set=utf8 Zabbix </usr/share/zabbix-mysql/data.sqlenter password: [Email protected] ~]#
To Zabbix account authorization:
[[email protected] ~]# mysql -urootwelcome to the mysql monitor. Commands end with ; or \g.Your MySQL connection id is 10server version: 5.1.73-log source distributioncopyright (c) 2000, 2013, oracle and/or its affiliates. all rights reserved. oracle is a registered trademark of oracle corporation and/or Itsaffiliates. other names may be trademarks of their respectiveowners . type ' help; ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql> grant all on *.* to ' Zabbix ' @ ' localhost ' identified by ' Zabbix '; /authorized Command query ok, 0 rows affected ( 0.00&NBSP;SEC) Mysql> quIt Bye
Modify the configuration file on the Zabbix--server side,
[[email protected] ~]# vim/etc/zabbix/zabbix_server.conf make the following changes, if the file defaults to meet the requirements, you do not need to modify: dbuser=zabbixdbpassword= Zabbixdbsocket=/var/lib/mysql/mysql.sock View sock files: [[email protected] ~]# Ls/var/lib/mysql/mysql.sockls:cannot Access/var/lib/mysql/mysql.sock:no such file or directory/if the files do not exist, you need to do a soft connection, as follows! [Email protected] ~]# ln-s/tmp/mysql.sock/var/lib/mysql/mysql.sock[[email protected] ~]# ls/var/lib/mysql/ Mysql.sock/var/lib/mysql/mysql.sock
Then start the installed software:
[Email protected] ~]#/etc/init.d/zabbix-server start[[email protected] ~]#/etc/init.d/zabbix-agent Start[[email Protected] ~]#/etc/init.d/httpd start[[email protected] ~]#/etc/init.d/mysqld start check if Zabbix is started: [Email protected] ~]# PS aux |grep Zabbix
Look at the ports where the Zabbix server and client are working:
[[email protected] ~]# netstat -lnp |grep zabbixtcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 1400/zabbix_agentd tcp 0 0 0.0.0.0:10051 0.0.0.0:* listen 2080/zabbix_server tcp 0 0 :: : 10050&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBsp; :::* LISTEN 1400/zabbix_agentd tcp 0 0 :::10051 :::* listen 2080/zabbix_server
The following page is installed Zabbix, in the browser to enter Http://ip/zabbix, just at the beginning will appear as follows:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7F/DD/wKiom1cwKyeQRxsgAAODNbCrcOQ475.png "title=" 1.png " alt= "wkiom1cwkyeqrxsgaaodnbcrcoq475.png"/> warning message appears because the time zone is not set and the time zone in Vim/etc/php.ini is set to "date.timezone=" Asia/shanghai ""
At this point in the interface, the warning message is eliminated! Then click Next and the following screen appears:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7F/DD/wKiom1cwK9fg1_IcAACaV3M7HpU651.png "title=" 2.png " alt= "Wkiom1cwk9fg1_icaacav3m7hpu651.png"/>
There are three lines do not meet the requirements, we want to change the corresponding item in the configuration file to required value, also modify the/etc/php.ini file! When you're done, click retry! As follows:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7F/DD/wKiom1cwLESAXUyKAACX1HkhVwQ501.png "title=" 3.png " alt= "Wkiom1cwlesaxuykaacx1hkhvwq501.png"/> Then click on the Nexr button as follows:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7F/DA/wKioL1cwLUrjeAXFAAB61DsE3QA009.png "title=" 4.png " alt= "Wkiol1cwlurjeaxfaab61dse3qa009.png"/> Enter the account and password that we write to at the time of authorization, click Test Connection, if the test is passed the OK Word will appear, then click Next:
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7F/DD/wKiom1cwLNqi20hcAABzFSL1_Gs581.png "title=" 5.png " alt= "Wkiom1cwlnqi20hcaabzfsl1_gs581.png"/>host and port remain by default, name defines a unique name by itself: click nest!
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7F/DD/wKiom1cwLRqChXfkAACBCPIIFds745.png "title=" 6.png " alt= "Wkiom1cwlrqchxfkaacbcpiifds745.png"/> There will be some setup information, the default, direct next!
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7F/DA/wKioL1cwLiKgJcACAABrNEBQ-mE464.png "title=" 7.png " alt= "Wkiol1cwlikgjcacaabrnebq-me464.png"/> Click the Finish button, the login screen will appear, the default account and password are: admin and Zabbix.
Then increase the monitoring client: first, do the following on the client:
[[email protected] ~]# Yum install-y zabbix20-agent/The Zabbix version here is the same as the server version, or compatible
Then modify the configuration file:
[[email protected] ~]# vim/etc/zabbix_agentd.conf make the following changes: server=192.168.1.114 (server IP address) serveractive= 0.0.0.0:10050 (port number previously checked) hostname=test (custom)
Then start the client:
[[email protected] ~]#/etc/init.d/zabbix-agent startstarting Zabbix agent: [OK]
Then execute the following command on the server:
[[email protected] ~]# zabbix_get-s 192.168.1.120-p 10050-k "System.hostname" LVS/appear the host name of the client, indicating a good communication connection! [Email protected] ~]#
Then under the Web page configuration--->host--->create host, where hostname,visible name can be customized, IP address is written to the client ip!
This article is from "Custom" blog, declined reprint!
Zabbix Monitoring Tools