Install and configure Zabbix open source monitoring
Operating environment:
Operating system: CentOS release 6.8 (Final)
Database: MySQL 5.5.52
Web Application Server: Apache/2.2.15 (Unix):
Open source monitor program: Zabbix 3.2.6
Task: install zabbix.
Procedure:
[root@sky9896html] # tar xf zabbix-3.2.6.tar.gz
[root@sky9896html] # cd zabbix-3.2.6
[root@sky9896zabbix-3.2.6] # cd database/
Root@sky9896database] # cd mysql/
[root@sky9896mysql] # ll
The total dosage is 3068
-rw-r--r-- 1 10001000 1036662 May 522 purl 51 data.sql
-rw-r--r-- 1 10001000 1978341 May 522 purge 50 p_w_picpaths.sql
-rw-r--r-- 1 10001000 122134 May 5 22:51schema.sql
[root@sky9896mysql] # mysql-uroot-p
Enter password:
Mysql > createdatabase zabbix character set utf8
Mysql > insertinto mysql.user (Host,User,Password) values ('localhost','zabbix',password (' *'))
Mysql > flushprivileges
Mysql > grantall on zabbix.* to 'zabbix'@'127.0.0.1' identified by' * * 'with grant option
Mysql > usezabbix
Mysql > source/var/www/html/zabbix-3.2.6/database/mysql/schema.sql
Mysql > source/var/www/html/zabbix-3.2.6/database/mysql/p_w_picpaths.sql
Mysql > source/var/www/html/zabbix-3.2.6/database/mysql/data.sql
Mysql > exit
[root@sky9896mysql] # ln-s libmysqlclient.so.16.0.0libmysqlclient.so
[root@sky9896mysql] # ln-s libmysqlclient_r.so.16.0.0libmysqlclient_r.so
[root@sky9896mysql] # useradd zabbix
Useradd: user "zabbix" already exists
[root@sky9896mysql] # ln-s / usr/local/lib/libiconv.so.2 / usr/lib/libiconv.so.2
[root@sky9896mysql] # / sbin/ldconfig
Root@sky9896zabbix-3.2.6] #. / configure\
-- prefix=/usr/local/zabbix\
-- enable-server\
-- enable-agent\
-- with-net-snmp\
-- with-libcurl\
-- enable-proxy\
-- with-mysql=/usr/bin/mysql_config
[root@sky9896 zabbix-3.2.6] # make
[root@sky9896 zabbix-3.2.6] # make install
[root@sky9896 zabbix-3.2.6] # vi / usr/local/zabbix/etc/zabbix_server.conf # configuration file
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=***
DBPort=3306
DBSocket=/var/lib/mysql/mysql.sock
[root@sky9896 etc] # vi zabbix_agentd.conf
Server=127.0.0.1 # is recommended to change to actual IP
ServerActive=127.0.0.1 # is recommended to change to actual IP
Hostname=Zabbix server
User=zabbix
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
UnsafeUserParameters=1
[root@sky9896 zabbix-3.2.6] #
Cp / var/www/html/zabbix-3.2.6/misc/init.d/fedora/core/zabbix_server / etc/rc.d/init.d/zabbix_server
[root@sky9896 zabbix-3.2.6] #
Cp / var/www/html/zabbix-3.2.6/misc/init.d/fedora/core/zabbix_agentd/etc/rc.d/init.d/zabbix_agentd
[root@sky9896 zabbix-3.2.6] # chmod + x / etc/rc.d/init.d/zabbix_server
[root@sky9896 zabbix-3.2.6] # chmod + x / etc/rc.d/init.d/zabbix_agentd
[root@sky9896 zabbix-3.2.6] # chkconfig zabbix_server on
[root@sky9896 zabbix-3.2.6] # chkconfig zabbix_agentd on
[root@sky9896 zabbix-3.2.6] # vi / etc/rc.d/init.d/zabbix_server
BASEDIR=/usr/local/zabbix/
[root@sky9896 zabbix] # vi / etc/rc.d/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix/
[root@sky9896 zabbix] # cp-r / var/www/html/zabbix-3.2.6/frontends/php/var/www/html/zabbix
[root@sky9896 zabbix] # chown apache.apache-R/var/www/html/zabbix
[root@sky9896 zabbix] # service zabbix_server restart
[root@sky9896 zabbix] # service zabbix_agentd start
[root@sky9896 zabbix] # vi/var/www/html/zabbix/include/locales.inc.php
'zh_CN' = > [' name' = > _ ('Chinese (zh_CN)'), 'display' = > true], # enable Chinese version
The above are all pre-installation configurations:
Install now: http://IP+setup.php
The picture is the Chinese version of the configuration
The following problems occurred during the publishing process:
Problem 1:zabbix Monitoring error zabbixserver is not running: the information displayed may not be current
[root@sky9896 tmp] # cat zabbix_server.log # check logs
26996 Can't connect to local MySQLserver through socket 20170619 tmp/mysql.sock' 203827.925 [Z3001] Can't connect to local MySQLserver through socket 'zabbix' failed: [2002] Can't connect to local MySQLserver through socket' / tmp/mysql.sock' (2)
26996:20170619:203827.926 database is down:reconnecting in 10 seconds
Solve problem 1:
[root@sky9896 etc] # pwd
/ usr/local/zabbix/etc
[root@sky9896 etc] # vi zabbix_server.conf
# DBSocket=/tmp/mysql.sock # default directory
DBSocket=/var/lib/mysql/mysql.sock # specify the actual mysql.sock directory
[root@sky9896 init.d] # vi zabbix_server.conf
The default installation directory for BASEDIR=/usr/local/ is zabbix or specify: BASEDIR=/usr/local/zabbix/
[root@sky9896 init.d] # vi zabbix_agentd.conf
The default installation directory for BASEDIR=/usr/local/ is zabbix or specify: BASEDIR=/usr/local/zabbix/
Question 2:
[root@sky9896 tmp] # cat zabbix_agentd.log
23521:20170620:091435.666 using configuration file:/usr/local/zabbix/etc/zabbix_agentd.conf
23521:20170620:091435.667 agent # 0 started [main process]
23523:20170620:091435.668 agent # 1 started [collector]
23525:20170620:091435.668agent # 3 started [listener # 2]
23527:20170620:091435.669 agent # 5 started [active checks # 1]
23524:20170620:091435.669 agent # 2 started [listener # 1]
23526:20170620:091435.669 agent # 4 started [listener # 3]
23527 cannot connect to 20170620 active checkconfiguration update from 100835.983 [127.0.0.1 cannot connect to 10051] Connection refused
Resolve problem 2:
[root@sky9896 etc] # vi zabbix_agentd.conf
Server=117.40.*.* # change 127.0.0.1 to actual IP
ServerActive=117.40.*.* # change 127.0.0.1 to actual IP
The installation is finished here.