Get the App
SLTechnology News&Howtos  ›  Servers  › 

[Zabbix4.2 Learning Notes] 4. Data collection-external monitoring

Shulou Source: shulou.com Published: 2022-06-02 13:54:46 11月10日 Update

Working with scen

When the monitored side cannot install agent, external monitoring can be used.

Prepare for

1. You need to configure the ExternalScripts parameter on the server side and specify the script path

two。 Prepare a script to get monitoring data

Data collection process

The script is usually placed on the server/proxy. When there is an external inspection monitoring item to obtain data, the zabbix-server will go to the path specified by the configuration file to find the corresponding script for the monitoring item and execute it. The script gets the data from the monitored device and returns the output to zabbix-server.

Grammar

Script [parameter1, parameter2,...]

1.zabbix-server side configuration

First check the configuration file

Vim / etc/zabbix/zabbix_server.conf View ExternalScripts path ExternalScripts=/usr/lib/zabbix/externalscripts

Script monitoring items in the / usr/lib/zabbix/externalscripts directory

[root@localhost externalscripts] # vim dnsroomtime.shallows timeholders binbinapacheTIMEOUTUT15DNSystSERVERTENT1DOMAINTERT 2if test-z "$1" then echo "not specified DNS Server" fiif test-z "$2" then echo "not specified resolution domain name" exitfiRESOLVE_TIME= `(time dig @ $1 $2) 2 > & 1 | grep real | cut-dm-f 2 | sed's / [s.] / / g`` echo $RESOLVE_TIME script is used to return DNS response time This is used as reference [root@localhost externalscripts] #. / dns_time.sh 114.114.114.114 www.baidu.com0029 # has obtained the DNS response time 2. Add zabbix monitoring item

Viewing the latest data, you can get the dns parsing time correctly.

Huan × ×

Tags: Scripts monitoring data configuration time paths files preparations downloads parameters scenarios domain names processes directories results devices syntax s and will reference Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB NVidia Apple Xiaomi macOS