您好,登錄后才能下訂單哦!
nagios主配置文件 vi /usr/local/nagios/etc/nagios.cfg 從里面可以看到相關的cfg文件,相關路徑。
檢測tomcat8080端口是否存活,主要是通過訪問/tomcat/webapps/test文件實現的
define command {
command_name check_tomcat8080
command_line $USER1$/check_http -I $HOSTADDRESS$ -p 8080 -u /test/test.jsp -e 200
}
郵件配置部分
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/local/bin/sendEmail -f jiankong@*****.com -t $CONTACTEMAIL$ -s *.*.*.* -u "** $NOTIFICATIONTYPE$ Host: $HOSTADDRESS$ is $HOSTSTATE$ **" -xu jiankong@***** -xp 123456
}
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/local/bin/sendEmail -f jiankong@******.com -t $CONTACTEMAIL$ -s *.*.*.* -u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **" -xu jiankong@******.com -xp 123456
}
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。