设置Nagios的依赖关系

我正在尝试为路由器和多个服务器设置依赖项.我想要做的是将路由器设置为主主机,因此如果路由器出现故障,服务器上的所有其他服务都不会发出警报.

不幸的是,这说起来容易做起来难.是否有一种简单的方法来为主机(或我的路由器)在服务器上的所有服务设置服务依赖性?

Nagios有一些文档,但为每个服务添加单个服务依赖项定义将非常耗时.

http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#servicedependency

在这种情况下,您想要的不是依赖项(如Nagios所称的那样),而是您希望主机中的父/子关系.如果父母失败并且无法联系到孩子,Nagios会认为他们“无法接触”而不是“失败”.然后,如果事情“无法访问”,您可以配置不通知.您可以在Nagios文档 here中阅读有关此内容的更多信息.

此外,从2.0文档的同一部分可以看出,如果主机关闭,服务将不会发出警报(保存这些警报):

Whenever a service check results in a
non-OK status level,Nagios will
attempt to check and see if the host
that the service is running on is
“alive”. Typically this is done by
pinging the host and seeing if any
response is received. If the host
check command returns a non-OK state,
Nagios assumes that there is a problem
with the host. In this situation
Nagios will “silence” all potential
alerts for services running on the
host and just notify the appropriate
contacts that the host is down or
unreachable. If the host check command
returns an OK state,Nagios will
recognize that the host is alive and
will send out an alert for the service
that is misbehaving.

默认情况下,服务依赖项不能从主机模板继承,但我相信父项是.所以你可以从模板继承父母(如果我在这里是正确的)并节省一些打字.

最后,我实际上希望启用无法访问的警报.如果路由器出现故障,我希望我的手机能够“疯狂”.

相关文章

什么是设计模式一套被反复使用、多数人知晓的、经过分类编目...
单一职责原则定义(Single Responsibility Principle,SRP)...
动态代理和CGLib代理分不清吗,看看这篇文章,写的非常好,强...
适配器模式将一个类的接口转换成客户期望的另一个接口,使得...
策略模式定义了一系列算法族,并封装在类中,它们之间可以互...
设计模式讲的是如何编写可扩展、可维护、可读的高质量代码,...