歡迎您光臨本站 註冊首頁

nagios如何監控修改埠的服務

←手機掃碼閱讀     火星人 @ 2014-03-03 , reply:0
NAGIOS默認監控服務默認的埠,但是如果把服務的埠改了后如何監控呢。
比如我把SSH改成1500后,NAGIOS再不能監控到SSH了,應該怎麼改才能讓它監控到1500就是SSH呢?

我也最近才開始裝nagios的。好像官方默認帶的pluging文件都是編譯好的不能修改,用守住每一天大俠的腳本就可以了。

不好意思,我明白了官方的自帶的pluging的配置文件其實你可以根據commands.cfg里指定的來設置一些參數,比如

define command{
        command_name    check_http
        command_line    $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
        }



define command{
        command_name    check_ssh
        command_line    $USER1$/check_ssh $ARG1$ $HOSTADDRESS$

那你就可以在localhost.cfg

define service{
        use                             local-service         ; Name of service template to use
        host_name                       localhost
        service_description             SSH
        check_command                   check_ssh! -p 22!192.168.0.123
        notifications_enabled           0
        }


define service{
        use                             local-service         ; Name of service template to use
        host_name                       localhost
        service_description             HTTP
        check_command                   check_http! -I 192.168.0.123!80
        notifications_enabled           0
        }

終於找到了問題所在:
define service{
        use     generic-service
        host_name       webserver
        service_description     SSH
        check_command   check_ssh! -p 1500!遠程被監控伺服器IP
}


[火星人 ] nagios如何監控修改埠的服務已經有1191次圍觀

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