nagios check_udp 就是一残废
nagios中check_udp是链接到的check_tcp
lrwxrwxrwx 1 root root 9 Sep 23 22:01 check_udp -> check_tcp
两个例子:
./check_udp -H 2hei.net -p 161 -s “” -e “” -w 2 -c 5
No data received from host
./check_udp -H 2hei.net -p 123 -s “” -e “” -w 2 -c 5
CRITICAL – Socket timeout after 10 seconds
/usr/lib64/nagios/plugins/check_udp -h
check_udp: No arguments found
Usage:
check_udp -H host -p port [-w
[-e
[-t
[-D
需要输入[-s
看来还得自己动手丰衣足食。
根据netstat值,简单写了一个,先凑合着用:
#!/bin/bash
# check_udpport
# by 2hei.net 2013.11.03PORT=$1
if [ -z ${PORT} ];then
echo “Port is null”
exit 1
fiLISTEN_NUM=`/bin/netstat -lnup | grep ${PORT} | grep -v grep | wc -l`
if [ ${LISTEN_NUM} -ge 1 ];then
echo “OK. UDP port ${PORT} is running.”
exit 0
else
echo “CRITICAL. UDP port ${PORT} listen number is ${LISTEN_NUM},please check.”
fi
/usr/lib64/nagios/plugins/check_udpport 5002
OK. UDP port 5002 is running.
/usr/lib64/nagios/plugins/check_udpport 161
CRITICAL. UDP port 161 listen number is 2,please check.
实际上可以自定义修改,udp端口监听的数量可能不止一个哦。
本文固定链接: https://www.2hei.net/2013/11/03/nagios-check_udp-is-pool/ | 2hei.net
【下一篇】Canonical “abused trademark law” to target a site critical of Ubuntu privacy
最活跃的读者