我尝试在我的测试VM上安装nagios-Herald。 我试图配置先驱报发送电子邮件。当我尝试通过命令发送邮件时,它正在工作但无法使用正确的格式化来获取/发送。
以下是供您参考的命令。
[root@localhost ~]# /usr/local/nagios-herald/bin/nagios-herald --env-file /usr/local/nagios-herald/test/env_files/nagios_vars.EXAMPLE --formatter=check_ping -r amit@example.com -y nagios@example.com --message-type email -u http://192.168.124.25 --trace
请有人建议我使用Nagios配置nagios-Herald。
答案 0 :(得分: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 --reply-to=nagios@somehost
}
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 --reply-to=nagios@somehost
}
在此之后你应该让它工作。 祝你好运。
答案 1 :(得分:0)
默认项目中没有check_ping
格式化程序。如果您已经编写了一个并且它位于项目目录之外,您可以通过nagios-herald
教授-F </path/to/custom/formatters>
如何找到它。
我还注意到您使用的是--trace
选项。如果您在命令中指定-l <logfile>
或在配置中指定logfile:
,则会看到nagios-herald
遇到的问题。我打赌你会看到它说它无法找到check_ping
格式化程序并重新回到基本格式化程序。