In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Nginx added status monitoring to add locationlocation / status {in the nginx configuration file
Stub_status on
Access_log off
}
Add monitoring scripts on the agent side
#! / bin/bash
# Description:zabbix monitors nginx performance and process status
# Note: this script needs to be configured before being monitored: go! Control side, otherwise ping detection will get results that do not conform to expectations
HOST= "192.168.171.146"
PORT= "80"
# detect whether the nginx process exists
Function ping {
/ sbin/pidof nginx | wc-l
}
# testing nginx performance
Function active {
/ usr/bin/curl "http://$HOST:$PORT/status/" 2 > / dev/null | grep 'Active' | awk' {print $NF}'
}
Function reading {
/ usr/bin/curl "http://$HOST:$PORT/status/" 2 > / dev/null | grep 'Reading' | awk' {print $2}'
}
Function writing {
/ usr/bin/curl "http://$HOST:$PORT/status/" 2 > / dev/null | grep 'Writing' | awk' {print $4}'
}
Function waiting {
/ usr/bin/curl "http://$HOST:$PORT/status/" 2 > / dev/null | grep 'Waiting' | awk' {print $6}'
}
Function accepts {
/ usr/bin/curl "http://$HOST:$PORT/status/" 2 > / dev/null | awk NR==3 | awk'{print $1}'
}
Function handled {
/ usr/bin/curl "http://$HOST:$PORT/status/" 2 > / dev/null | awk NR==3 | awk'{print $2}'
}
Function requests {
/ usr/bin/curl "http://$HOST:$PORT/status/" 2 > / dev/null | awk NR==3 | awk'{print $3}'
}
# execute function
, 1
Remote testing
Sh / etc/zabbix/zabbix_agentd.d/ngx_status.sh active
Server-side testing
Zabbix_get-s 192.168.169.98-k nginx.status [active]
Modify agent configuration file
Timeout = 30
UnsafeUserParameters=1
UserParameter=nginx.status [*], / etc/zabbix/zabbix_agentd.d/ngx_status.sh $1
Restart the client service zabbix-agent restart
New monitoring items for zabbix:
Add triggers and graphics
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.