您好,登錄后才能下訂單哦!
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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。