Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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 × ×

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report