我目前正试图在我的产品nagios实例上设置nagios herald。我已经完成了所有必要的设置,当我运行以下模拟运行时,立即发送通知:
根@mon1对象]# /usr/local/nagios-herald/bin/nagios-herald -env-file /tmp/test_herald.out -消息类型-电子邮件-r my.email@address.net -格式化程序=$_SERVICEMESSAGE_FORMATTER_NAME$ --nagios-cgi-url=http://192.168.0.1/nagios/cgi-bin/cmd.cgi -应答-to=nagios@omehost.com
我希望能够测试是否保持原有通知就绪,因此我创建了一个新命令、contactgroup和contact定义:
define command {
command_name herald-service-email
command_line /usr/local/nagios-herald/bin/nagios-herald --message-type email -r my.email@address.net --formatter=$_SERVICEMESSAGE_FORMATTER_NAME$ --nagios-cgi-url=http://192.168.0.1/nagios/cgi-bin/cmd.cgi --reply-to=nagios@somehost.com
}
# nagios herald testing
define contactgroup {
contactgroup_name nagios-herald
alias nagios herald
name nagios-herald
members nagios-herald
}
define contact {
contact_name nagios-herald
alias nagios-herald
name nagios-herald
use generic-pager
service_notification_commands herald-service-email
register 1
email my.email@address.net
}最后,我将服务通知命令添加到用于所有警报的全局联系人中(警报电子邮件与/etc/aliases中的实际电子邮件相关联)。
define contact {
contact_name admin
alias admin user
name admin
register 1
host_notification_period 24x7
host_notification_options d,u,r
host_notification_commands notify-host-by-email
service_notification_period 24x7
service_notification_options w,u,c,r
service_notification_commands notify-service-by-email,dump-env,herald-service-email
email admin
pager admin-pager
}我看到通知在我的Thruk中被调用,所以我不知道当调用的命令手动工作时,它是如何/为什么不能工作的。有人有什么想法或建议吗?
发布于 2016-04-22 01:21:40
您能提供您希望看到警报的服务定义之一吗?也许您有一个格式错误的_message_formatter_name指令。
您还可以将--trace参数附加到nagios-herald通知命令的末尾,它将提供更多关于它正在做什么的详细信息。记住,也要在命令中设置-l <logfile>,或者在配置中指定logfile:,以便在文件中捕获输出。
https://stackoverflow.com/questions/36781555
复制相似问题