nagios主配置文件 vi /usr/local/nagios/etc/nagios.cfg 從里面可以看到相關(guān)的cfg文件,相關(guān)路徑。
站在用戶的角度思考問題,與客戶深入溝通,找到合江網(wǎng)站設計與合江網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:做網(wǎng)站、成都網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣、主機域名、網(wǎng)頁空間、企業(yè)郵箱。業(yè)務覆蓋合江地區(qū)。
檢測tomcat8080端口是否存活,主要是通過訪問/tomcat/webapps/test文件實現(xiàn)的
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
}