特定主机的 Nagios 服务通知给特定用户

特定主机的 Nagios 服务通知给特定用户

问题描述:

使用 Nagios,我希望能够在特定主机上的服务失败时发送用户通知.然而,另一台主机上的相同服务应该提醒其他人.

Using Nagios, I want to be able to send a user notifications when the services on a specific host fail. Yet those same services on another host should alert somebody else.

例如:

HostA"已启动,但HostA"上的www"服务已关闭 --> 通知用户 A
HostB"已启动,HostB"上的www"服务已启动 --> 未通知 UserB

"HostA" is up, but "www" service on "HostA" is down --> Notify UserA
"HostB" is up, and "www" service on "HostB" is up --> UserB is not notified

换句话说...如果 HostA 上的 WWW 服务关闭,则只应通知 UserA,
但如果 HostB 上的 WWW 服务宕机,则由 UserB 负责.

In other words... if the WWW service on HostA is down, only UserA should be notified,
but if the WWW service on HostB is down, then UserB is responsible for it.

我可以轻松地将用户 A 分配给主机 A 和/或 www 服务,但我希望用户 A 负责主机 A,在主机 A 上运行的所有服务.

I can easily assign User A to Host A and/or to the www service, but I want user A to be responsible for Host A, and for all the services running on Host A.

想法?

将 UserA 分配给 HostA 作为联系人.不要为 HostA 的服务定义/分配任何联系人.然后服务将继承主机的联系信息.请参阅文档中表格的第一行:

Assign UserA to HostA as the contact. Don't define/assign any contacts to the services for HostA. Then the services will inherit the contact info for the Host. See the first line in the table in the docs:

或者,您可以将联系人放入联系人组.

Optionally, you can put the contact into a contactgroup.