ZCS6 Day 5 Practical

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 47

6.

0
Training practical tasks
DAY 5

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved
COPYRIGHT NOTICE
Rules
It is prohibited to make any video and/or audio recordings during the whole period of this course.
This course is intended only for the officially enrolled student. Subject to the Copyright Notice below, the student is not allowed to
share his credentials for attending this course, to allow others to join and take part, or otherwise make use of these Materials.

Copyright notice
© Zabbix, 2022. All rights reserved.
Unless otherwise indicated, Zabbix owns the copyright and other intellectual property rights in the text, graphics, information,
designs, data, verbal/audio/video presentations and files, comments, drawings, exam questions and exam answers, and other
training content, lab manuals and practical tasks, and training courses themselves (further – Materials).
The Materials are protected by watermarks, copyright statements, and other means. It is prohibited to remove any of watermarks
and copyright statements, or in any other way to amend or change the content or appearance of the Materials.
Any unauthorized reprint, publication, reproduction, sharing, or use of the Materials is prohibited. No part of the Materials may be
reproduced, transmitted, or published in any form or by any means, electronic or mechanical, including photocopying, recording,
or by any information storage and retrieval system without the express signed written permission from Zabbix.
All course Materials made available to the student during the course of the training may be used solely by the student enrolled in
the relevant course for personal and educational purposes only. Materials provided to the student should be treated as
confidential information shared with the student only for the purpose of the student performing Zabbix Certified training.
The student acknowledges that damages alone would not be an adequate remedy for the breach of this copyright and the student
shall be entitled to the granting of equitable relief concerning any threatened or actual breach of any of the provisions of this
Copyright notice.

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 2
Lab #38
Real-time data export

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved 10 minutes 3
PRACTICAL TASK #38
Create folder "/tmp/zabbix_export/" to store data and change the owner to zabbix user
# mkdir /tmp/zabbix_export
# chown zabbix:zabbix /tmp/zabbix_export

Set ExportDir and ExportFileSize options in Zabbix server configuration file


# vi /etc/zabbix/zabbix_server.conf +/Export
### Option: ExportDir
# Directory for real time export of events, history and trends in newline JSON format.
# If set, enables real time export.
ExportDir=/tmp/zabbix_export

### Option: ExportFileSize


# Maximum size per export file in bytes.
# Only used for rotation if ExportDir is set.
ExportFileSize=50M

### Option: ExportType


# List of comma delimited types of real time export - allows to control export entities by type
# Valid only if ExportDir is set.
ExportType=events,trends

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 4
PRACTICAL TASK #38
Restart Zabbix server
# systemctl restart zabbix-server

Create a new problem


# zabbix_sender -z student-xx.zabbix.training -s Training-VM-XX -k persons -o 1

Look at the event created by history syncer processes


The event can be written in any of the problems-history-syncer* files
# cat /tmp/zabbix_export/problems-history-syncer*

{"clock":1643293245,"ns":718446551,"value":1,"eventid":4549,"name":"Only 1 persons person attending the


training!","severity":5,"hosts":[{"host":"Training-VM-XX","name":"Training-VM-
XX"}],"groups":["Training/Servers"],"tags":[{"tag":"Environment","value":"Production"}]}

Resolve the problem and look at the files again - a new line is added
# zabbix_sender -z student-xx.zabbix.training -s Training-VM-XX -k persons -o 10
# cat /tmp/zabbix_export/problems-history-syncer*

{"clock":1643293245,"ns":718446551,"value":1,"eventid":4549,"name":"Only 1 persons person attending the


training!","severity":5,"hosts":[{"host":"Training-VM-XX","name":"Training-VM-
XX"}],"groups":["Training/Servers"],"tags":[{"tag":"Environment","value":"Production"}]}
{"clock":1643293669,"ns":714509312,"value":0,"eventid":4555,"p_eventid":4549}

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 5
PRACTICAL TASK #38
Restart zabbix server process
Trends are written at the beginning of every hour or on Zabbix server restart
# systemctl restart zabbix-server

Trends can be written in any of the problems-history-syncer* files normally


# cat /tmp/zabbix_export/trends-history-syncer*

They are empty because on the server restart the main process writes trends
# cat /tmp/zabbix_export/trends-main-process-0.ndjson

{"host":{"host":"Zabbix server","name":"Zabbix server"},"groups":["Zabbix


servers"],"item_tags":[{"tag":"Application","value":"Zabbix server"}],"itemid":23276,"name":"Zabbix server: Trend
write cache, % used","clock":1643292000,"count":6,"min":0.068665,"avg":0.308545,"max":0.364494,"type":0}
{"host":{"host":"Zabbix server","name":"Zabbix server"},"groups":["Zabbix
servers"],"item_tags":[{"tag":"Application","value":"Disk vda"}],"itemid":39917,"name":"vda: Disk average queue
size (avgqu-sz)","clock":1643292000,"count":5,"min":0.016591,"avg":0.018986,"max":0.023770,"type":0}
{"host":{"host":"Zabbix server","name":"Zabbix server"},"groups":["Zabbix
servers"],"item_tags":[{"tag":"Application","value":"Zabbix raw items"}],"itemid":39915,"name":"vda: Disk read
time (rate)","clock":1643292000,"count":5,"min":0.000419,"avg":0.001326,"max":0.002325,"type":0}
{"host":{"host":"Zabbix server","name":"Zabbix server"},"groups":["Zabbix
servers"],"item_tags":[{"tag":"Application","value":"General"}],"itemid":29186,"name":"System local
time","clock":1643292000,"count":6,"min":1643293826,"avg":1643293976,"max":1643294126,"type":3}
..........

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 6
Congratulations
Practical task #38 is completed !

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved 7
Lab #39
Graphs

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved 10 minutes 8
PRACTICAL TASK #39
Go to Configuration -> Templates and click on the Graphs for Template Basic
Click here

Press Create graph


Name: Network traffic and CPU load
Y axis min value Fixed 0
Click on Add

Click here

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 9
PRACTICAL TASK #39
Select Items:
Interface eth0: Incoming traffic
Interface eth0: Outgoing traffic
Press Select

Select
Click on Add and select "CPU load" item
Change Y axis side to Right for the "CPU load" item

Y Axis

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 10
PRACTICAL TASK #39
Press Add to create graph
Go to Monitoring -> Hosts and click on Graphs for the "Training-VM-XX" host

The graph is displayed:

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 11
Congratulations
Practical task #39 is completed !

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved 12
Lab #40
Network Maps

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved 20 minutes 13
PRACTICAL TASK #40
Go to Monitoring → Maps
Click on "All maps" if some map is already displayed

All maps

Click on Create map in the upper right corner


Enter map properties
Owner: student-XX
Name: Training network

Press Add

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 14
PRACTICAL TASK #40
Click on Constructor for "Training network" map

Click here

Click on Add to create a new map element


Click on the element to change properties:
Add element
Type: Image
Label: Network switch
Icons: Switch_(96)

Press Apply

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 15
PRACTICAL TASK #40
Reposition switch to the center of the map
Add another element and change its properties
Type: Host
Label: Name: {HOST.NAME}
Address: {HOST.CONN}
Uptime: {?last(//system.uptime)}
CPU load: {?avg(//system.cpu.load,10m)}
Memory available:{?avg(//memory.available,1h)}
Host: Training-VM-XX

Press Apply and then press Close

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 16
PRACTICAL TASK #40
Switch "Expand macros" to On - the current information is displayed
Expand
macros

CTRL + Click on the host and switch icons to select both and click on "Link: Add"
Add link

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 17
PRACTICAL TASK #40
The mass update elements form is still open
Click on Edit in the Links section:
Add label: Traffic in:{?last(/Training-VM-XX/net.if.in[eth0])}
Traffic out:{?last(/Training-VM-XX/net.if.out[eth0])}

Edit

Press Apply

Network traffic is displayed


Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 18
PRACTICAL TASK #40
Right click on the "Training-VM-XX" host and select "Copy"

Then right click on empty map space and select "Paste"

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 19
PRACTICAL TASK #40
Change the host to "Training-VM-XY"

Do not forget to
Scroll down to Links section change host name!
Change the host name in the label

Press Apply and then press Close

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 20
PRACTICAL TASK #40
A new host is added

Repeat the last step and add "Training-VM-XZ" host using copy/paste

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 21
Congratulations
Practical task #40 is completed !

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved 22
LAB #41
Dashboards

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved 23
PRACTICAL TASK #41
Go to Monitoring → Dashboard and press Create dashboard

Name the dashboard "Training dashboard"

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 24
PRACTICAL TASK #41
Click on the rectangle to add a new widget

Click here

Choose widget:
Type: Clock
Time type: Server time

Time type

Press Add

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 25
PRACTICAL TASK #41
Click on empty space to add another widget:
Type: Host availability
Click here
Name: Training servers availability
Refresh interval: 1 minute
Host groups: Training/Servers
Interface type Zabbix agent, SNMP, IPMI
Show hosts in maint.: Checked

Press Add

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 26
PRACTICAL TASK #41
Two widgets are now displayed

Add another widget


Type: Item value
Refresh interval: 1 minute
Item: Zabbix server: Available memory
Show: Time, Value, Change indicator
Check advanced configuration

Advanced
configuration

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 27
PRACTICAL TASK #41
Adjust settings for Value:
Decimal places: 2
Color: Green Change color
Units: B
Size: 25%
Color: Teal Change color

Adjust settings for Time:


Horizontal position: Left Change color
Color: Red

Change background color to Black Change color

Press Add

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 28
PRACTICAL TASK #41
Add another widget:
Type: Top Hosts
Host groups: Training/servers, Zabbix servers
Host count: 5
Click on Columns: Add

Add columns

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 29
PRACTICAL TASK #41
Change column properties
Name: Available memory Select item
Data: Item value
Item: Available memory
Base color: Green
Min: 0
Max 2G

Choose "Available
memory"

Press Add

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 30
PRACTICAL TASK #41
Add another column
Name: Host
Data: Host name

Add
Change
column
data

Press Add

Press Add on widget page to add the widget

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 31
PRACTICAL TASK #41
Choose some threshold in the middle of values
In my example it is ~180MB

Change
properties

Use middle value as


a threshold

Change properties for the "Top hosts" widget


Rearrange columns
Click on Edit next to Available memory
Edit

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 32
PRACTICAL TASK #41
Change base color to red

Add a threshold
Value: 180M
Color: Green Change color

Add threshold

Press Update to update the widget

The bar will change color if the threshold is exceeded


Because more memory is better in our case, we are using red as base color, and then
green as a threshold
Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 33
PRACTICAL TASK #41
Dashboard displays colored bars

Colored
indicators

Add another top hosts widget:


Type: Top hosts
Name: Top hosts by CPU Utilization
Refresh interval: 10 seconds
Hosts: Zabbix server

Add columns

Click on Columns: Add

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 34
PRACTICAL TASK #41
Add new column:
Name: Host
Data: Host name

Add another new column


Name: CPU utilization in %
Data: Item value
Item: CPU utilization
Display: Indicators
Base color: Green
Min: 0
Max: 100
Threshold Yellow 50
Threshold Red 80

Press Add to add the widget

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 35
PRACTICAL TASK #41
Press Save changes to save the dashboard

Save
dashboard

Open SSH console and generate CPU load


# cat /dev/urandom | md5sum

Look how indicator color changes


Press CTRL+C to stop generating CPU Load
^C

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 36
PRACTICAL TASK #41
Press Edit dashboard to add more widgets
Edit
dashboard

Add map navigation tree widget


Click on + to add map
Name: Training network map
Linked map Training network Click here

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 37
PRACTICAL TASK #41
Add a map widget:
Type: Map
Source type: Map navigation tree
Filter: Map navigation tree

Press Save changes to save Dashboard


Map navigation tree can be used to navigate through maps

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 38
PRACTICAL TASK #41
Edit the dashboard and add a new page:
Name: Network traffic graph

Click here

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 39
PRACTICAL TASK #41
Add a graph widget
Type: Graph
Host pattern: Training-VM-*
Item pattern: Interface eth0: Incoming traffic
Base color: Blue
Draw: Bar
Transparency: 3

Set custom time period


From now-15m
To now
Click here
Add the graph widget

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 40
Congratulations
Practical task #41 is completed !

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved 41
Lab #42
Reports

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved 15 minutes 42
PRACTICAL TASK #42
Open SSH console and install zabbix-web-service
# dnf install -y zabbix-web-service

Start the zabbix-web-service and enable auto start


# systemctl enable zabbix-web-service --now
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-web-service.service →
/usr/lib/systemd/system/zabbix-web-service.service

Add Google chrome repository (copy/paste the info into google-chrome.repo file)
# vi /etc/yum.repos.d/google-chrome.repo

[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Install Chrome headless browser


# dnf install -y google-chrome-stable

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 43
PRACTICAL TASK #42
Open Zabbix server configuration file and specify report settings
# vi /etc/zabbix/zabbix_server.conf +/Report

### Option: StartReportWriters


# Number of pre-forked report writer instances.
#
# Mandatory: no
# Range: 0-100
# Default:
StartReportWriters=1

### Option: WebServiceURL


# URL to Zabbix web service, used to perform web related tasks.
# Example: http://localhost:10053/report
#
# Mandatory: no
# Default:
WebServiceURL=http://localhost:10053/report

Restart Zabbix server


# systemctl restart zabbix-server

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 44
PRACTICAL TASK #42
Go to Administration → General → Other and enter the Frontend URL
You can copy the URL from the browser bar

Go to Reports → Scheduled reports and press Create report

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 45
PRACTICAL TASK #42
Fill required fields:
Name: Training report
Dashboard: Global view
Period: Previous day
Cycle: Daily
Start time: 09:00
Subject: Zabbix global dashboard
Message: Auto generated report

Press Test to send a test report

Press Add to create scheduled report

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved Practical task 46
Congratulations
Practical task #42 is completed !

Zabbix 6.0 Certified Specialist ● Day 5 © 2022 by Zabbix. All rights reserved 47

You might also like