You are on page 1of 65

The Enterprise class Monitoring Solution for Everyone

www.zabbix.com

Zabbix 5.0
Certified Specialist course

LAB Manual Day 1


LAB 1
Zabbix Server installation
ZABBIX SERVER INSTALLATION
List available time zones (replace Europe with your location name)
# timedatectl list-timezones | grep Europe

Europe/Amsterdam
Europe/Andorra
Europe/Astrakhan
Europe/Athens
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
...
Europe/Prague
Europe/Riga
Europe/Rome
...
Europe/Vienna
Europe/Vilnius
Europe/Volgograd
Europe/Warsaw
Europe/Zagreb
Copy the appropriate time zone name, you will use it in the next steps
Europe/Zaporozhye
Europe/Zurich

ZABBIX 5.0 Lab Manual 3


ZABBIX SERVER INSTALLATION
Set proper time zone for OS (replace Europe/Riga with your location from previous step)
# timedatectl set-timezone Europe/Riga

Check the time zone


# date

Wed Apr 15 16:38:47 EEST 2020

Check ntp status


# timedatectl status

Local time: Fri 2020-05-08 06:59:31 EEST


Universal time: Fri 2020-05-08 03:59:31 UTC
RTC time: Fri 2020-05-08 03:59:30
Time zone: Europe/Riga (EEST, +0300)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

ZABBIX 5.0 Lab Manual 4


ZABBIX SERVER INSTALLATION
Install MySQL 8 database server
# dnf -y install mysql-server

Last metadata expiration check: 0:11:20 ago on Fri 08 May 2020 06:54:26 AM EEST.
Dependencies resolved.
======================================================================================================
Package Architecture Version
======================================================================================================
Installing:
mysql-server x86_64 8.0.17-3.module_el8.0.0+181+899d6349
....
Installed:
Enable MariaDB service
mysql-server-8.0.17-3.module_el8.0.0+181+899d6349.x86_64
Complete!

# systemctl enable mysqld

Created symlink /etc/systemd/system/multi-user.target.wants/mysqld.service →


/usr/lib/systemd/system/mysqld.service.

Start MySQL service


# systemctl start mysqld

ZABBIX 5.0 Lab Manual 5


ZABBIX SERVER INSTALLATION
Check MySQL status
# systemctl status mysqld

mysqld.service - MySQL 8.0 database server


Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2020-05-08 07:09:23 EEST; 10min ago
Process: 19467 ExecStartPost=/usr/libexec/mysql-check-upgrade (code=exited, status=0/SUCCESS)
Process: 19340 ExecStartPre=/usr/libexec/mysql-prepare-db-dir mysqld.service (code=exited,
status=0/SUCCESS)
Process: 19316 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=0/SUCCESS)
Main PID: 19424 (mysqld)
Status: "Server is operational"
Tasks: 39 (limit: 5059)
Memory: 347.2M
CGroup: /system.slice/mysqld.service
└─19424 /usr/libexec/mysqld --basedir=/usr

May 08 07:09:14 student-XX systemd[1]: Starting MySQL 8.0 database server...


May 08 07:09:14 student-XX mysql-prepare-db-dir[19340]: Initializing MySQL database
May 08 07:09:23 student-XX systemd[1]: Started MySQL 8.0 database server.

Always check that service is up and running before continuing to next steps !

ZABBIX 5.0 Lab Manual 6


ZABBIX SERVER INSTALLATION
Open MySQL console
# mysql

● Welcome to the MySQL monitor. Commands end with ; or \g.


Your MySQL connection id is 9
Server version: 8.0.17 Source distribution

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its


affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

mysql> prompt at the beginning of command line means you are now working in mysql console.

ZABBIX 5.0 Lab Manual 7


ZABBIX SERVER INSTALLATION
Create database zabbix
mysql> create database zabbix character set utf8 collate utf8_bin;

Query OK, 1 row affected, 2 warnings (0.01 sec)

Database character set and collation are very important !


Create database user zabbix with password P455w0RD
mysql> create user 'zabbix'@'localhost' identified by 'P455w0RD';

Query OK, 0 rows affected (0.00 sec)


Give this user access to zabbix database
mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost';

Query OK, 0 rows affected (0.01 sec)

Exit MySQL console


mysql> quit;

Bye
[root@student-xx ~]#

ZABBIX 5.0 Lab Manual 8


ZABBIX SERVER INSTALLATION
Install Zabbix official repository
# dnf install http://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm

Retrieving http://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
warning: /var/tmp/rpm-tmp.Ea4awB: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:zabbix-release-5.0-1.el8 ################################# [100%]

Clean dnf cache


# dnf clean all

30 files removed

It is recommended to clean dnf cache after adding or changing repositories, to be sure the new
repositories are used

ZABBIX 5.0 Lab Manual 9


ZABBIX SERVER INSTALLATION
Install Zabbix server from Zabbix repository (answer y to security questions if asked)
# dnf -y install zabbix-server

======================================================================================================
Package Architecture Version
======================================================================================================
Installing:
zabbix-server-mysql x86_64 5.0.0-0.7rc1.el
Installing dependencies:
mysql-libs x86_64 8.0.17-3.module_el8.0.0
unixODBC x86_64 2.3.7-1.el8
OpenIPMI-libs x86_64 2.0.25-4.el8
libtool-ltdl x86_64 2.4.6-25.el8
net-snmp-libs x86_64 1:5.8-12.el8_1.1
fping x86_64 3.16-1.el8
Transaction Summary
======================================================================================================
Install 7 Packages
Installed:
zabbix-server-mysql-5.0.0-0.7rc1.el8.x86_64
mysql-libs-8.0.17-3.module_el8.0.0+181+899d6349.x86_64.el8.x86_64
...
Complete!

ZABBIX 5.0 Lab Manual 10


ZABBIX SERVER INSTALLATION
Load initial DB schema into database (use zabbix DB user password from previous steps)
# zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix

Enter password: P455w0RD


Check that zabbix DB schema is loaded successfully
# mysql
mysql> use zabbix

Database changed

mysql> show tables;

+----------------------------+
| Tables_in_zabbix |
+----------------------------+
| acknowledges |
| actions |
| ...... |
| 166 rows in set (0.01 sec)
11
mysql> quit;

ZABBIX 5.0 Lab Manual


ZABBIX SERVER INSTALLATION
Edit minimum required Zabbix configuration file parameters
You must add DBPassword=P455w0RD entry to the configuration file
# vi /etc/zabbix/zabbix_server.conf

### Option: DBName


DBName=zabbix

### Option: DBUser


# Database user.
# Mandatory: no
# Default:
# DBUser=
DBUser=zabbix

### Option: DBPassword


# Database password.
# Comment this line if no password is used.
# Mandatory: no
# Default:
# DBPassword=
DBPassword=P455w0RD

ZABBIX 5.0 Lab Manual 12


ZABBIX SERVER INSTALLATION
Enable Zabbix server service
# systemctl enable zabbix-server

Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-server.service →


/usr/lib/systemd/system/zabbix-server.service.

Start Zabbix server service


# systemctl start zabbix-server

Check Zabbix service status


# systemctl status zabbix-server

zabbix-server.service - Zabbix Server


Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2020-04-15 21:30:09 EEST; 1s ago
Process: 2696 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 2698 (zabbix_server)
CGroup: /system.slice/zabbix-server.service
├─2698 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
├─2707 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes]
...
Apr 15 21:30:09 student-XX systemd[1]: Started Zabbix Server.

ZABBIX 5.0 Lab Manual 13


ZABBIX SERVER INSTALLATION
Check Zabbix server log file for critical errors
# tail -n50 /var/log/zabbix/zabbix_server.log

tail -n100 /var/log/zabbix/zabbix_server.log


2698:20200415:213009.587 Starting Zabbix Server. Zabbix 5.0.0 (revision d3cf98e98b).
2698:20200415:213009.588 ****** Enabled features ******
2698:20200415:213009.588 SNMP monitoring: YES
2698:20200415:213009.588 IPMI monitoring: YES
...
2698:20200415:213009.588 using configuration file: /etc/zabbix/zabbix_server.conf
2698:20200415:213009.596 current database version (mandatory/optional): 05000000/05000000
2698:20200415:213009.596 required mandatory version: 05000000
2698:20200415:213009.605 server #0 started [main process]
2704:20200415:213009.606 server #1 started [configuration syncer #1]
...
2736:20200415:213009.969 server #31 started [preprocessing worker #1]
2722:20200415:213010.995 Zabbix agent item "system.cpu.load[all,avg1]" on host "Zabbix server"
failed: first network error, wait for 15 seconds
2724:20200415:213025.999 Zabbix agent item "system.cpu.util[,user]" on host "Zabbix server" failed:
another network error, wait for 15 seconds
It is expected to have some unsupported item or agent failure messages here, these errors
are not critical !

ZABBIX 5.0 Lab Manual 14


ZABBIX SERVER INSTALLATION
Install Zabbix frontend packages
# dnf -y install zabbix-web-mysql zabbix-apache-conf

Last metadata expiration check: 0:26:12 ago on Fri 08 May 2020 07:51:07 AM EEST.
Dependencies resolved.
======================================================================================================
Package Architecture Version
Repository Size
======================================================================================================
Installing:
zabbix-apache-conf noarch 5.0.0-0.7rc1.el8
zabbix-web-mysql noarch 5.0.0-0.7rc1.el8
Installing dependencies:
apr x86_64 1.6.3-9.el8
apr-util x86_64 1.6.1-6.el8
centos-logos-httpd noarch 80.5-2.el8
...
Installed:
zabbix-apache-conf-5.0.0-0.7rc1.el8.noarch
zabbix-web-mysql-5.0.0-0.7rc1.el8.noarch
...
Complete!

ZABBIX 5.0 Lab Manual 15


ZABBIX SERVER INSTALLATION
Configure PHP for Zabbix frontend
uncomment php_value[date.timezone] and replace Europe/Riga with your timezone
# vi /etc/php-fpm.d/zabbix.conf

[zabbix]
...
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 35

php_value[session.save_handler] = files
php_value[session.save_path] = /var/opt/rh/rh-php72/lib/php/session/

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[date.timezone] = Europe/Riga

ZABBIX 5.0 Lab Manual 16


ZABBIX SERVER INSTALLATION
Enable apache service
# systemctl enable httpd php-fpm

Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service →


/usr/lib/systemd/system/httpd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service →
/usr/lib/systemd/system/php-fpm.service.

# systemctl start httpd php-fpm

Check apache service status


systemctl status httpd

httpd.service - The Apache HTTP Server


Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2020-04-16 09:16:23 UTC; 2min 41s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 1661 (httpd)
Status: "Total requests: 20; Current requests/sec: 0; Current traffic: 0 B/sec"
...
student-XX systemd[1]: Started The Apache HTTP Server.
student-XX httpd[20926]: Server configured, listening on: port 80
ZABBIX 5.0 Lab Manual 17
ZABBIX SERVER INSTALLATION
Type http://<your_server_ip>/zabbix into your browser address bar
Press Next step

ZABBIX 5.0 Lab Manual 18


ZABBIX SERVER INSTALLATION
Check that all pre-requisites are OK
Press Next step

ZABBIX 5.0 Lab Manual 19


ZABBIX SERVER INSTALLATION
Enter P455w0RD into the Password field
Press Next step

ZABBIX 5.0 Lab Manual 20


ZABBIX SERVER INSTALLATION
Enter your student name into Name box (replace xx with your student number)
Press Next step

ZABBIX 5.0 Lab Manual 21


ZABBIX SERVER INSTALLATION
Re-check that all parameters are correct
Press Next step

ZABBIX 5.0 Lab Manual 22


ZABBIX SERVER INSTALLATION
Press Finish to complete frontend installation

ZABBIX 5.0 Lab Manual 23


ZABBIX SERVER INSTALLATION
Enter Admin into Username field (case sensitive!)
Enter zabbix into password field (case sensitive!)
Press Sign in

ZABBIX 5.0 Lab Manual 24


ZABBIX SERVER INSTALLATION
Congratulations ! You have successfully installed Zabbix

ZABBIX 5.0 Lab Manual 25


CONGRATULATIONS!
Zabbix Server installation lab is finished
LAB 2
User profile
USER PROFILE
Go to Administration -> User groups
Press Create user group

Enter Training as a group name and press Add

ZABBIX 5.0 Lab Manual 28


USER PROFILE
Go to Administration -> Users
Press Create user

ZABBIX 5.0 Lab Manual 29


USER PROFILE
Enter student-XX into Alias field (this will be your username)
Press Select right to Groups field and choose Training user group
Enter <password> into Password and Password (once again) fields
Enter zabbix.php?action=host.view in the URL (after login) field

ZABBIX 5.0 Lab Manual 30


USER PROFILE
Click on Permissions tab
Choose Zabbix Super Admin as a user type
Press Add to create user

ZABBIX 5.0 Lab Manual 31


USER PROFILE
Press Sign out in Main menu to log out from Zabbix frontend

ZABBIX 5.0 Lab Manual 32


USER PROFILE
Enter student-XX into Username field (replace XX with your student number)
Enter your password into Password field
Press Sign in

ZABBIX 5.0 Lab Manual 33


USER PROFILE
Congratulations ! You have logged in with your newly created user

ZABBIX 5.0 Lab Manual 34


USER PROFILE
Go to Administration -> Users and click on Admin user

Press Change password


Enter P455w0RD into fields
• Password
• Password (once again)

Press Update

ZABBIX 5.0 Lab Manual 35


CONGRATULATIONS!
User profile lab is finished
LAB 3
Create Host groups and Host
HOST GROUPS AND HOST
Go to Configuration -> Host groups in Main menu
Press Create host group

ZABBIX 5.0 Lab Manual 38


HOST GROUPS AND HOST
Enter Training into Group name field
Press Add

Press Create host group again to create nested group

Enter Training/Servers into Group name field


Press Add

ZABBIX 5.0 Lab Manual 39


HOST GROUPS AND HOST
Click on Filter if the filter form is not visible
Enter Training into Name field (this is a filter field)
Press Apply to filter by group name

Almost every page in Zabbix frontend has a filter. By clicking on Filter you can show or hide the
filter form
ZABBIX 5.0 Lab Manual 40
HOST GROUPS AND HOST
Go to Configuration -> Hosts in Main menu
Press Create host

ZABBIX 5.0 Lab Manual 41


HOST GROUPS AND HOST
Enter Training-VM-XX into Host name field
Enter your host name (student-XX) into DNS name field and select Connect to: DNS

It is recommended to clean up unused IP address fields to avoid confusion


ZABBIX 5.0 Lab Manual 42
HOST GROUPS AND HOST
Type tr into Groups field
Pick Training/Servers from the search list

You can also use Select button to pick up one or more groups from the list

ZABBIX 5.0 Lab Manual 43


HOST GROUPS AND HOST
Click on Tags tab
Enter Location as a tag Name and your training location as a tag Value

Initial host setup is complete, press Add

Tags will be used in next tasks, by example to filter problems or assign permissions

ZABBIX 5.0 Lab Manual 44


HOST GROUPS AND HOST
Display the filter on Hosts form and enter Training-VM into Name field
Press Apply

When you will have a lot of hosts, using filters will help to find correct ones quickly

ZABBIX 5.0 Lab Manual 45


HOST GROUPS AND HOST
You can click on << in Main menu to hide it

Notice, that all availability icons are gray, because we do not have any items to check

Main menu Filters will be hidden on most of the following slides. Please check filters if you cannot
find information on the frontend page

ZABBIX 5.0 Lab Manual 46


CONGRATULATIONS!
Create Host groups and Host lab is finished
LAB 4
Agentless monitoring
AGENTLESS MONITORING
First , you need to create a new host and put it into Training/Servers group
Go to Configuration -> Hosts and press Create host

Fill Required fields


• Host name: training.lan
• Visible name: Training Resources
• Groups: Training/Servers (enter group name or press Select)
• Interfaces: Enter: training.lan into DNS name field and select Connect to: DNS

Press Add to create host

ZABBIX 5.0 Lab Manual 49


AGENTLESS MONITORING
You have created a host, but it may be not visible, because of the filter !
Press the Reset
Reset button to reset all filters

Always check your filters if you can not find information on Zabbix frontend !

ZABBIX 5.0 Lab Manual 50


AGENTLESS MONITORING
Before creating ICMP Ping item, we will create Application for this item
Click on Applications for Training Resources host

Make sure you click on Applications for correct host !


ZABBIX 5.0 Lab Manual 51
AGENTLESS MONITORING
Press Create application

Enter ICMP into the Name field and press Add

ZABBIX 5.0 Lab Manual 52


AGENTLESS MONITORING
Application is created
Now click on Items for this host

To create applications, items or other host elements click on the corresponding link it the top
menu of the host
Press Create item

ZABBIX 5.0 Lab Manual 53


AGENTLESS MONITORING
Fill the required fields to create item
• Name : ICMP ping
• Type : Simple check
• Key : icmpping
• Type of inf...: Numeric (unsigned)
• Applications: Select: ICMP
Press Add

Application is not required, but it helps to


filter out items

You can find more details on the item in


Zabbix documentation

ZABBIX 5.0 Lab Manual 54


AGENTLESS MONITORING
The frontend must return to Items page and display Item added message

If you receive error like in the picture below, please read carefully the Details and fix the
incorrect field

Press Create item to create next item for Web service availability
Create item

ZABBIX 5.0 Lab Manual 55


AGENTLESS MONITORING
Fill the required fields to create item
• Name: Service Web performance
• Type: Simple check
• Key: net.tcp.service.perf[http]
• Type of inf...: Numeric (float)
• Units: s
• New app...: Service

You are creating new application directly


from item form, which is faster
Press Add

You can find more details on the item in


Zabbix documentation

ZABBIX 5.0 Lab Manual 56


AGENTLESS MONITORING
Now create the third item
• Name: Service NTP availability
• Type: Simple check
• Key: net.udp.service[ntp]
• Type of inf...: Numeric (unsigned)
• Show value: Service state
• Applications: Service

You will be using value map "Service state"


to display result in human readable format.

Application Service is already created from


the previous item
Press Add

ZABBIX 5.0 Lab Manual 57


AGENTLESS MONITORING
Go to Monitoring -> Hosts and check Latest data for Training Resources host
You may need to wait a minute before data are collected from host

Are all the data displayed in human readable format in Last value field ?
• Service NTP availability shows status Up (1)
• Service WEB performance shows response time 3ms
• ICMP Ping displays just 1, which may be confusing for non-technical personal
You need to create a new value map and assign it to ICMP Ping item
ZABBIX 5.0 Lab Manual 58
AGENTLESS MONITORING
Go to Administration -> General and click on GUI. This will open a list
Select Value mapping

ZABBIX 5.0 Lab Manual 59


AGENTLESS MONITORING
This frontend section has a lot of pre-defined value maps, but there is none for ICMP Ping
Press Create value map

Create a new value map


• Name: ICMP Ping status
• Mappings
• Value 0 => Ping lost
• Value 1 => Ping received

Press Add

ZABBIX 5.0 Lab Manual 60


AGENTLESS MONITORING
Go back to Configuration -> Hosts and click Items for Training Resources host

Click on ICMP Ping item

You can click on blue colored column names to sort items ascending / descending
The same works for other forms also. A small triangle is displayed on the sort column

ZABBIX 5.0 Lab Manual 61


AGENTLESS MONITORING
Click on Show value field and Choose ICMP Ping status

Press Update
Update at the bottom of the screen to update item
ZABBIX 5.0 Lab Manual 62
AGENTLESS MONITORING
Go to Monitoring -> Hosts and look at the Latest data for Training Resources host one
more time

All items now are displaying data in human readable format

ZABBIX 5.0 Lab Manual 63


CONGRATULATIONS!
Agentless monitoring lab is finished
The Enterprise class Monitoring Solution for Everyone
www.zabbix.com

Zabbix 5.0
Certified Specialist course

End of Day 1

You might also like