nagios监控mfs脚本
原创
©著作权归作者所有:来自51CTO博客作者ahwind的原创作品,请联系作者获取转载授权,否则将追究法律责任
#!/bin/bash
#a nagios plugin for check moosefs healthy
#write 20120821
CHECK_OK=0
CHECK_WARNING=1
CHECK_CRITICAL=2
CHECK_UNKNOWN=3
CHECK_MASTER () {
check_process=`ps aux|grep '/usr/local/mfs/sbin/mfsmaster'|grep -v grep`
check_port=`netstat -lunpt|grep ':9419'`
if [ -n "$check_process" -a -n "$check_port" ]
then
echo "mfsmaster is OK"
exit 0
else
echo "mfsmaster is not running"
exit 2
fi
}
CHECK_CHUNK () {
check_process=`ps aux|grep '/usr/local/mfs/sbin/mfschunkserver'|grep -v grep`
check_port=`netstat -lunpt|grep ':9422'`
if [ -n "$check_process" -a -n "$check_port" ]
then
echo "mfschunkserver is OK"
exit 0
else
echo "mfschunkserver is not running"
exit 2
fi
}
CHECK_CLIENT () {
check_process=`ps aux|grep '/usr/local/mfs/bin/mfsmount'|grep -v grep`
if [ -n "$check_process" ]
then
echo "mfsclient is OK"
exit 0
else
echo "mfsclient is not running"
exit 2
fi
}
CHECK_METALOGGER () {
check_process=`ps aux|grep '/usr/local/mfs/sbin/mfsmetalogger'|grep -v grep`
if [ -n "$check_process" ]
then
echo "mfschunkserver is OK"
exit 0
else
echo "mfschunkserver is not running"
exit 2
fi
}
case "$1" in
-M)
CHECK_MASTER
;;
-c)
CHECK_CLIENT
;;
-C)
CHECK_CHUNK
;;
-L)
CHECK_METALOGGER
;;
*)
echo "Unknown argement: $1"
;;
esac
上一篇:MFS启动脚本
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
nagios监控服务脚本
nagios监控服务脚本
nagios iOS 监控服务脚本 -
nagios 监控nginx脚本插件
nagios 监控nginx脚本插件
nagios 监控nginx脚本插件 -
nagios监控slave(借助脚本)
nagios调用脚本示例(监控slave)
nagios iOS nagios监控slave -
nagios监控fms(借助脚本)
nagios监控fms(借助脚本)
nagios iOS nagios监控fms -
nagios监控http(借助脚本)
nagios监控http(借助脚本)
nagios iOS nagios监控http -
懒人nagios页面监控脚本
懒人nagios页面监控脚本
职场 nagios iOS 休闲 监控脚本
















