This section describes the installation and configuration of Zabbix for monitoring OpenVino infrastructure and services. 

Information about zabbix can be found at Zabbix.com.

The installation instructions outlined her include some corrections to the zabbix documentation.

  1. Download zabbix packages for CentOS 

  2. Install Zabbix packages
    Install Zabbix respository
    #rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
    #yum clean all
    
    Install Zabbix server, frontend, agent
    #yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

  3. Install MySQL

    #rpm -Uvh https://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm
    #sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/mysql-community.repo
     #yum --enablerepo=mysql80-community install mysql-community-server
    #service mysqld start
    #grep "A temporary password" /var/log/mysqld.log
    #mysql_secure_installation
    #service mysqld restart
    #chkconfig mysqld on
    #mysql -u -root -p
    
    mysql> create user 'zabbix'@'localhost' identified by 'kookooforcoco';
    mysql> create user 'zabbix'@'foxtrot' identified by 'kookooforcoco';
    mysql> ALTER USER zabbix@localhost IDENTIFIED WITH mysql_native_password BY 'cocoforkookoo';
    mysql> ALTER USER zabbix@foxtrot IDENTIFIED WITH mysql_native_password BY 'cocoforkookoo';
    mysql> GRANT ALL PRIVILEGES ON *.* to zabbix@foxtrot WITH GRANT OPTION;
    mysql> FLUSH PRIVILEGES;

Import initial schema and data. You will be prompted to enter your newly created password

[mbarrow@foxtrot ~]$ zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -D zabbix -p

Configure the database for Zabbix server

# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=<password>

Edit file /etc/httpd/conf.d/zabbix.conf, uncomment and set the right timezone for you.

<Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride None
    Require all granted

    <IfModule mod_php5.c>
        php_value max_execution_time 300
        php_value memory_limit 128M
        php_value post_max_size 16M
        php_value upload_max_filesize 2M
        php_value max_input_time 300
        php_value max_input_vars 10000
        php_value always_populate_raw_post_data -1
        php_value date.timezone America/Argentina/Mendoza
    </IfModule>
</Directory>

Start Zabbix server and agent processes

Start Zabbix server and agent processes and make it start at system boot. 

# systemctl restart zabbix-server zabbix-agent httpd
# systemctl enable zabbix-server zabbix-agent httpd

5. SElinux configuration

SELinux configuration

Having SELinux status enabled in enforcing mode, you need to execute the following commands to enable communication between Zabbix frontend and server:

# setsebool -P httpd_can_connect_zabbix on
If the database is accessible over network (including 'localhost' in case of PostgreSQL), you need to allow Zabbix frontend to connect to the database too:
# setsebool -P httpd_can_network_connect_db on

As frontend and SELinux configuration is done, you need to restart Apache web server:

# service httpd restart

Configuring Zabbix

Connect to http://foxtrot:81/zabbix

Zabbix Configuration

Login and configuring users


Overview

In this section you will learn how to log in and set up a system user in Zabbix.

Login

This is the Zabbix “Welcome” screen. Enter the user name Admin with password cacaforcocopuffs to log in as a Zabbix superuser.

Configuring Zabbix Agents

openvinopi

Install the zabbix-agent :

sudo apt-get install zabbix-agent

sudo vi /etc/zabbix/zabbix_agentd.conf

PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix-agent/zabbix_agentd.log
LogFileSize=0
Server=192.168.0.67
ServerActive=192.1687.0.67
Hostname=foxtrot
Include=/etc/zabbix/zabbix_agentd.conf.d/

alpha-echo

From foxtrot., insure connectivity with the host:

[mbarrow@charlie ~]$ who am i
mbarrow  pts/1        Apr  4 22:11 (foxtrot)

[root@charlie ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-agent-4.0.19-1.el7.x86_64.rpm

[root@charlie ~]# yum install zabbix zabbix-agent

sudo vi /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pidLogFile=/var/log/zabbix-agent/zabbix_agentd.logLogFileSize=0Server=192.168.0.67ServerActive=192.1687.0.67Hostname=foxtrotInclude=/etc/zabbix/zabbix_agentd.conf.d/

[root@charlie ~]# systemctl enable zabbix-agent

[root@charlie ~]# systemctl restart zabbix-agent

[root@charlie ~]# systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2020-04-04 22:26:04 CEST; 5s ago
  Process: 6324 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
 Main PID: 6326 (zabbix_agentd)
   CGroup: /system.slice/zabbix-agent.service
           ├─6326 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
           ├─6327 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
           ├─6328 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
           ├─6329 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
           ├─6330 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
           └─6331 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

Apr 04 22:26:04 charlie systemd[1]: Starting Zabbix Agent...
Apr 04 22:26:04 charlie systemd[1]: zabbix-agent.service: Supervising process 6326 which is not our...xits.
Apr 04 22:26:04 charlie systemd[1]: Started Zabbix Agent.
Hint: Some lines were ellipsized, use -l to show in full.

[root@charlie ~]# sestatus
SELinux status:                 disabled
[root@charlie ~]# firewall-cmd --permanent --add-port=10050/tcp --zone=public
success
[root@charlie ~]#  firewall-cmd --permanent --add-port=10051/tcp --zone=public
success
[root@charlie ~]#  firewall-cmd --reload
success
[root@charlie ~]#  systemctl restart zabbix-agent
[root@charlie ~]# tail -f /var/log/zabbix//zabbix_agentd.log
  6385:20200404:222835.276 TLS support:           YES
  6385:20200404:222835.276 **************************
  6385:20200404:222835.276 using configuration file: /etc/zabbix/zabbix_agentd.conf
  6385:20200404:222835.276 agent #0 started [main process]
  6387:20200404:222835.277 agent #2 started [listener #1]
  6388:20200404:222835.277 agent #3 started [listener #2]
  6386:20200404:222835.277 agent #1 started [collector]
  6390:20200404:222835.278 agent #5 started [active checks #1]
  6389:20200404:222835.279 agent #4 started [listener #3]
  6390:20200404:222838.281 active check configuration update from [foxtrot:10051] started to fail (ZBX_TCP_READ() timed out)