Summary of Zabbix usage

Keywords: Linux EPEL Zabbix MySQL RPM

1. Launching zabbix-server on CentOS 7 failed. The error message in / var/log/messages is as follows:

Feb 22 12:56:43 mysql-server1 systemd: Starting Zabbix Server with MySQL DB...
Feb 22 12:56:43 mysql-server1 kernel: zabbix_server[1599]: segfault at 18 ip 00007fce09ca6bd0 sp 00007fffa39b7808 error 4 in libpthread-2.17.so[7fce09c9d000+16000]
Feb 22 12:56:43 mysql-server1 systemd: zabbix-server-mysql.service: control process exited, code=killed status=11
Feb 22 12:56:43 mysql-server1 systemd: Failed to start Zabbix Server with MySQL DB.
Feb 22 12:56:43 mysql-server1 systemd: Unit zabbix-server-mysql.service entered failed state.

Solution:

# rpm -Uvh --force ftp://bo.mirror.garr.it/1/slc/centos/7.0.1406/updates/x86_64/Packages/gnutls-3.1.18-10.el7_0.x86_64.rpm

Retrieving ftp://bo.mirror.garr.it/1/slc/centos/7.0.1406/updates/x86_64/Packages/gnutls-3.1.18-10.el7_0.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:gnutls-3.1.18-10.el7_0           ################################# [ 50%]
Cleaning up / removing...
   2:gnutls-3.3.8-12.el7              ################################# [100%]

The download address of the RPM package is:

http://rpm.pbone.net/index.php3/stat/4/idpl/27966545/dir/centos_7/com/gnutls-3.1.18-10.el7_0.x86_64.rpm.html

 

2. Zabbix official source and epel source of CentOS 7

    # rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/7/x86_64/zabbix-2.2.11-1.el7.x86_64.rpm

    # rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

The former is the official source of Zabbix, and the latter is epel. The former is just to install the software Zabbix, while the latter is the yum source of installing epel. The EPEL source contains the relevant software package of Zabbix, and only one of them can be used. If both are installed, conflicts will occur during the subsequent installation process.

Transaction check error:
  file /var/log/zabbix from install of zabbix22-agent-2.2.11-1.el7.x86_64 conflicts with file from package zabbix-2.2.11-1.el7.x86_64

The zabbix package included in epel is as follows:

zabbix20.x86_64                                             2.0.16-1.el7                               epel              
zabbix20-agent.x86_64                                       2.0.16-1.el7                               epel              
zabbix20-proxy.noarch                                       2.0.16-1.el7                               epel              
zabbix20-proxy-mysql.x86_64                                 2.0.16-1.el7                               epel              
zabbix20-proxy-pgsql.x86_64                                 2.0.16-1.el7                               epel              
zabbix20-proxy-sqlite3.x86_64                               2.0.16-1.el7                               epel              
zabbix20-server.noarch                                      2.0.16-1.el7                               epel              
zabbix20-server-mysql.x86_64                                2.0.16-1.el7                               epel              
zabbix20-server-pgsql.x86_64                                2.0.16-1.el7                               epel              
zabbix20-web.noarch                                         2.0.16-1.el7                               epel              
zabbix20-web-mysql.noarch                                   2.0.16-1.el7                               epel              
zabbix20-web-pgsql.noarch                                   2.0.16-1.el7                               epel              
zabbix22.x86_64                                             2.2.11-1.el7                               epel              
zabbix22-agent.x86_64                                       2.2.11-1.el7                               epel              
zabbix22-dbfiles-mysql.noarch                               2.2.11-1.el7                               epel              
zabbix22-dbfiles-pgsql.noarch                               2.2.11-1.el7                               epel              
zabbix22-dbfiles-sqlite3.noarch                             2.2.11-1.el7                               epel              
zabbix22-proxy.noarch                                       2.2.11-1.el7                               epel              
zabbix22-proxy-mysql.x86_64                                 2.2.11-1.el7                               epel              
zabbix22-proxy-pgsql.x86_64                                 2.2.11-1.el7                               epel              
zabbix22-proxy-sqlite3.x86_64                               2.2.11-1.el7                               epel              
zabbix22-server.noarch                                      2.2.11-1.el7                               epel              
zabbix22-server-mysql.x86_64                                2.2.11-1.el7                               epel              
zabbix22-server-pgsql.x86_64                                2.2.11-1.el7                               epel              
zabbix22-web.noarch                                         2.2.11-1.el7                               epel              
zabbix22-web-mysql.noarch                                   2.2.11-1.el7                               epel              
zabbix22-web-pgsql.noarch                                   2.2.11-1.el7                               epel    

 

3. Use zabbix_get to verify that the configuration of Agent is correct

# zabbix_get -s 192.168.244.144 -p 10050 -k system.uanme
ZBX_NOTSUPPORTED

ZBX_NOTSUPPORTED Represents Problems with Monitoring Items

# zabbix_get -s 192.168.244.144 -p 10050 -k agent.ping
1

 

4.  59635:20160223:161315.258 no active checks on server [192.168.244.146:10051]: host [192.168.244.146] not found

Reason: / etc/zabbix_agent d.conf's Hostname does not match the Name of zabbix web page Monitoring - > Configuration - > Hosts page

 

5. Error "ZBX_NOTSUPPORTED" in executing system.run

[root@localhost ~]# zabbix_get -s 192.168.244.10 -k system.run['df -h']
ZBX_NOTSUPPORTED

Reason: EnableRemoteCommands in the client configuration file defaults to 0 and is not turned on.

After opening,

[root@localhost ~]# zabbix_get -s 192.168.244.10 -k system.run['df -h']
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        18G  8.7G  8.0G  53% /
tmpfs           238M     0  238M   0% /dev/shm
/dev/sda1       190M   27M  154M  15% /boot

 

6. The difference between passive mode and active mode

Passive mode:

1 > Server opens a TCP connection

2 > Server sends a key as agent.ping\n

3 > Agent accepts the request and then responds to the data < HEADER > < DATALEN > 1

4 > Server processes the received data

5 > TCP Connection Closed

Active mode:

Agent establishes a TCP connection to Server

2 > Agent requests a list of data to be detected

3 > Server responds to Agent and sends an Items list (item key, delay)

4 > Agent responds to requests

5 > TCP Connection Closed

Agent begins to collect data periodically.

Agent recommends a TCP connection to Server

8 > Agent sends the data to Server during the acquisition period.

Server processes data sent by Agent s.

10 > TCP Connection Closed

Posted by asaschool on Thu, 28 Mar 2019 11:36:28 -0700