2012-02-03 80 views
1

我正在嘗試使用JASIG站點上列出的Nagios插件來監視我的CAS服務器。如何使用Nagios Perl插件?

腳本從命令行運行良好,所以我把它放在/usr/local/nagios/libexec,使它可執行並重新啓動Nagios。

我用的命令是:

define command { 
    command_name check_cas 
    command_line check_cas.pl -H cas.baba.org -u "/cas/login" -p 8443 -l abc -a booey -r "Log In Successful" 
} 

從我所知道的,插件沒有被發現:

(Return code of 127 is out of bounds - plugin may be missing) 

有沒有別的東西,我需要做什麼?

回答

2

我的配置中的插件使用/etc/nagios3/resource.cfg中定義的變量($USER1$=/usr/lib/nagios/plugins)或插件的完整路徑。

嘗試指定插件的完整路徑,這應該有所幫助。

實施例(的Debian nagios的插件)

define command{ 
    command_name check_ssh 
    command_line /usr/lib/nagios/plugins/check_ssh '$HOSTADDRESS$' 
} 

實施例(自定義)

define command { 
    command_name check-host-alive 
    command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5 
} 

兩個例子都指定該插件的完整路徑。所以如果你添加你的路徑,支票將起作用。

+0

我在我的resources.cfg中有這個。只需雙重檢查。 – user1187931 2012-02-03 19:23:30

+0

@ user1187931編輯我的答案 – dgw 2012-02-03 20:01:10