歡迎您光臨本站 註冊首頁

問個nagios報警問題

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

問個nagios報警問題

我有一台centos伺服器 裡面安裝了許多Tomcat他們的埠個不同,現在的問題是我用nagios的check_tcp 進行監控。
define service{
        use                             generic-service,srv-pnp
        host_name                       localhost
        service_description             Nav_tomcat
        check_command                   check_tcp!8585
        notifications_enabled           1
        }
define service{
        use                             generic-service,srv-pnp
        host_name                       localhost
        service_description             Naven_tomcat
        check_command                   check_tcp!8686
        notifications_enabled           1
        }

commad.cfg
define command{
       command_name notify-service-by-sms
       command_line /usr/bin/curl 'http://sms.api.bz/fetion.php?username=15994822241&password=mitmax2019&sendto=15992322241&message=IP地址$HOSTADDRESS$伺服器描述:$HOSTALIAS$/$SERVICEDESC目前狀態:$SERVICESTATE$'
}



我這監控了2個埠分別是 8585 8686但是nagios報警的時候信息時這樣的. IP地址:127.0.0.1伺服器描述:localhost/HTTP/目前狀態:CRITICAL
他這樣報警的信息我根本不知道是8585出問題還是8686出問題,麻煩高手幫忙修改下.加上埠信息
《解決方案》

把service_description            修改為諸如Naven_tomcat_8585, Naven_tomcat_8586這樣。
《解決方案》

本帖最後由 blueswxs 於 2010-05-25 22:07 編輯

二樓的主意也挺好的。呵呵。再來一個參考一下。


$ARGn$

The nth argument passed to the command
(notification, event handler, service check, etc.).
Nagios supports up to 32 argument macros
($ARG1$ through $ARG32$).

資料來源,nagios 3.x 手冊。
引用當初執行命令的參數即可。

[火星人 ] 問個nagios報警問題已經有502次圍觀

http://coctec.com/docs/service/show-post-17777.html