Use zabbix to monitor latency of international lines
In many cases, the lines of various manufacturers in China are unstable, but they can only be tested temporarily. No detailed statistics are provided. Here, zabbix is used to collect statistics under this record.
Trigger can be used for alarm when you are concerned about latency
1. Compile the zabbix monitoring script. The following uses monitoring the Hong Kong server as an example:
- #! /Bin/bash
- (Time curl-s $1)> & amp;/monitor/hk_logfile.log
- If [[$? -Eq 0]; then
- Real = 'cat/monitor/hk_logfile.log | grep 'real' | awk '{print $2 }''
- MS =$ {real: 2: 5}
- Echo $ ms
- Fi
Note: $1 is transmitted from the zabbix server, that is, the destination address to be tested.
The script must be placed on the test source server.
Zabbix requires 777 permissions to call scripts and printed log files, or the group is zabbix users.
2. Use UserParameter of zabbix to call the script
UserParameter = script.hk [*],/monitor/monitor_hk.sh $1
$1 is transmitted from the zabbix server, that is, the destination address to be tested.
3. display the latency between lines through zabbix plotting
4. Graphic Display
So far, latency monitoring has been completed, in ms.