Simple monitoring of the use of icmpping in Zabbix-20

1. Goal

How to use zabbix to detect the network delay of the target host, how to use the "icmppingsec" in the "simple check" of zabbix to obtain the ping return time of the target host, and create a trigger (when the delay reaches the number of milliseconds, the alarm will be sent)

2. Introduction

1. The icmpPing in the zabbix simple check uses the fping tool. If the fping tool is not installed on your zabbix server or the server where the icmpPing tool is applied, please install the fping tool by yourself and set the relevant permissions. See the introduction below .

2. Introduction to zabbix official website about ICMP

ICMP ping
Zabbix uses an external utility fping to handle ICMP pings.

This utility is not part of the Zabbix distribution and must be installed separately. If the utility is lost, its permissions or its location does not match the location set in the Zabbix server/proxy server configuration file ("FpingLocation" parameter), then ICMP ping (icmpping, icmppingloss, icmppingsec) will not be processed.

fping must be executed by the user Zabbix daemon running as and setuid root. Run these commands as the root user to set the correct permissions:

chmod 4710 /usr/sbin/fping
chown root:zabbix /usr/sbin/fping

Also check, if the user zabbix belongs to the group zabbix, run:

groups zabbix

If it is not added by the following command:

usermod -a -G zabbix zabbix

 

Three, the main setting steps

1. Find a host to act as the source of ping, we will use zabbix server as

2. Create a new monitoring item in the monitoring items of the zabbix server.
Open the zabbix web homepage, click [Configuration---Host] to find "zabbix server", and click "zabbix server" in the host list (maybe yours is not called zabbix server, anyway, as long as there is a linux host that has installed fping and set permissions), then click "monitor item", and finally click [create monitoring item] on the far right

3. Fill in the parameters of the monitoring item

Name: xFpingFrom17 (write it casually for easy identification)
Type: Simple check
Key value: icmppingsec[192.168.0.17,4,1000,32,10000,avg]
Host interface: 127.0.0.1:10050
Information type: Floating point
unit: s (lowercase s seconds)
update time: 1m
enabled: check

 Click the "simple check" in the upper right corner of the "selection" in the above figure, and then click the key value "icmppingsec[<target>,<packets>,<interval>,<size>,<timeout>,<mode>] "

4. Explanation of the key value
target: the ip address of the target host you want to ping, just write the ip address directly, without double quotation marks or single quotation marks.
packets: the number of ping packets sent each time
interval: the number of milliseconds between each ping sent. 1000 milliseconds is equal to 1 second
size: the size of each packet
timeout: the time to wait for the timeout, the unit is also milliseconds
mode: there are three types (min, max, avg)
Note that each parameter is separated by a comma.

5. (Extension) Create graphics for the monitoring items just created

Then do what you just did, click on the connection "graphics" above, and then click on the upper right corner of the [Create Graphic]

 Enter the name of the graph, and then click the parameter "add" link under the monitoring item

 Click on the monitoring item "xFpingFrom17" just created

Finally click the [Add] button

6. (Extension) View the graphics generated by icmppingsec just added

7. Make a trigger (the alarm is triggered when the network delay reaches a certain threshold)

● Find its trigger link in zabbix server in the host list, and then click [Create Trigger]

●Fill in the trigger parameters

Name: xFpingFrom139 is greater than 4 triggers
Severity: It depends on the situation
Expression: {Zabbix server:icmppingsec[192.168.0.139,4,1000,32,10000,avg].last(#1)}>0.004
allows manual shutdown :It depends on the situation.
Enabled: checked

 

Note: The threshold of 4 milliseconds in the expression should be written in seconds, that is, 0.004 seconds. Because the return value of the monitoring item's fping returns a millisecond floating point number.

At this point, the trigger is also built. The actual measurement is valid.

--------------------------------------------------------------------------

This post is finished. Achieved the purpose of the test.

Using this icmppingsec can determine the network delay between target hosts and help us effectively determine the network health. Hope it will help you!

 -------------END-------------June 6, 2020 18:30:30------------ --------------------------

 

Guess you like

Origin blog.csdn.net/xoofly/article/details/106591218