2015-04-03 134 views
0

我試圖在我的測試虛擬機上安裝nagios-herald。 我試圖配置先驅發送電子郵件。當我試圖通過命令發送郵件時,它正在工作,但無法使用正確的格式進行讀取/發送。nagios-herald安裝和配置

以下是供您參考的命令。

[[email protected] ~]# /usr/local/nagios-herald/bin/nagios-herald --env-file /usr/local/nagios-herald/test/env_files/nagios_vars.EXAMPLE --formatter=check_ping -r [email protected] -y [email protected] --message-type email -u http://192.168.124.25 --trace 

請有人建議我與Nagios配置的Nagios先驅。

回答

1

只是一個快速的提示,不要忘記設置nagios.cfg如下:

enable_environment_macros=1 

而且,這裏是我的commands.cfg

define command { 
    command_name notify-host-by-email 
    command_line /usr/local/nagios-herald/bin/nagios-herald --message-type email -r $CONTACTEMAIL$ --formatter=$_HOSTMESSAGE_FORMATTER_NAME$ --nagios-cgi-url=http://192.168.0.1/nagios/cgi-bin/cmd.cgi [email protected] 
} 

define command { 
    command_name notify-service-by-email 
    command_line /usr/local/nagios-herald/bin/nagios-herald --message-type email -r $CONTACTEMAIL$ --formatter=$_SERVICEMESSAGE_FORMATTER_NAME$ --nagios-cgi-url=http://192.168.0.1/nagios/cgi-bin/cmd.cgi [email protected] 
} 

在這之後,你應該有它的工作。 祝你好運。

0

默認項目中沒有check_ping格式化程序。如果您已經編寫了一個,並且它不在項目目錄中,則可以教nagios-herald如何使用-F </path/to/custom/formatters>來找到它。

我也注意到你正在使用--trace選項。如果您在命令中指定-l <logfile>或在配置中指定logfile:,您將看到nagios-herald遇到了什麼問題。我打賭你會看到它說明它不能找到check_ping格式化程序並回退到基本格式化程序。