Nagios报警状态有:ok WARNING WARNING UNKNOWN 四种状态。意思顾名思义,自己体会。
- vi check_backfiles
- #!/bin/bash
- # Author Steven
- # This scripts is used to monitor database back file.
- OK=0
- WARNING=1
- CRITICAL=2
- UNKNOWN=3
- #Yerterday
- date=`date +%Y-%m-%d -d "-1 day"`
- BACKFILE=/data/mysqlbak/operator$date.sql.gz
- #echo $size
- if [ -f ${BACKFILE} ];then
- size=`du -s $BACKFILE | awk '{print $1}'`
- if [ ${size} -lt 1000 ];then
- echo "Mysql back file size is error!!!"
- exit $WARNING
- fi
- echo "Mysql back file is exist!"
- exit $OK
- else
- echo "Mysql back file don't exist!"
- exit $CRITICAL
- fi
- define service{
- use mail-service
- host_name static
- service_description check_backfiles
- check_command check_nrpe!check_backfiles
- }
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。