我正在使用Sensu查看带有check-log.rb的日志文件中是否存在错误日志。(https://github.com/sensu-plugins/sensu-plugins-logs/blob/master/bin/check-log.rb)
我认为我们在检查错误日志时不需要"OK“通知,所以我不想在Sensu中检查日志文件时通知"OK”。我知道如何在Nagios中做到这一点,但在Sensu的文档中找不到方法。
有没有人帮我一下?
提前谢谢你。
发布于 2016-07-30 03:43:22
实际上,这很简单。您需要定义一个过滤器来删除OK/resolved消息。
{
"filters": {
"resolve": {
"attributes": {
"check": {
"status": 0
}
},
"negate": true
}
}
}然后在您的处理程序上应用过滤器。如果使用默认处理程序,则需要使用“默认”名称定义一个新的处理程序。
如果你想要更多的灵活性,你可以添加
{
"filters": {
"resolve": {
"attributes": {
"check": {
"status": 0,
"filter_resolve": true
}
},
"negate": true
}
}
}然后,您可以将此过滤器添加到所有处理程序中。如果要将自定义属性"filter_resolve": true包括到要过滤解析事件的检查中,它将执行此操作。所有其他检查都将忽略此筛选器,因为它们没有"filter_resolve": true属性。
https://stackoverflow.com/questions/38654654
复制相似问题