在24小时内不需要对特定事件ID进行严格警报

我正在使用NSClient ++的CheckEventLog 0.5.0.62 2016-09-14

如何使用语法,如果特定的事件ID是不是在24小时内生成,我需要关键的警报,如果事件ID生成我需要状态OK。

我的语法:

./check_nrpe -H 192.168.63.1 -c check_eventlog -a "scan-range=-24h" "crit=count=<0" "filter=id=1" "ok=count>0" "warn=none" 

输出:

 OK: No entries found 

对于上面的语法,事件ID 1不是在24小时内生成的,所以我的状态已经变好了。 但我需要关键

请帮助我上面的语法。

简单的方法是设置空状态并使用计数,就像你做的那样,当没有发现任何东西时,覆盖默认的“ok”。

什么都没find:

 check_eventlog scan-range=24h "filter=id=1008 and written < 24h" warn=none "crit=count=0" empty-state=critical L cli CRITICAL: CRITICAL: No entries found L cli Performance data: 'count'=0;0;0 

发现的东西:

 check_eventlog scan-range=24h "filter=id=1008 and written < 24h" warn=none "crit=count=0" empty-state=critical L cli OK: OK: Event log seems fine L cli Performance data: 'count'=12;0;0 

您可能想要使用以下语法来清理语法:

  • 显示所有
  • 空语法

像这样:

发现的东西:

 check_eventlog scan-range=24h "filter=id=1008 and written < 24h" warn=none "crit=count=0" empty-state=critical show-all "empty-syntax=Nooooohhhh" L cli CRITICAL: Nooooohhhh L cli Performance data: 'count'=0;0;0 

什么都没find:

 check_eventlog scan-range=24h "filter=id=1008 and written < 24h" warn=none "crit=count=0" empty-state=critical show-all L cli OK: OK: 12 message(s) .....) L cli Performance data: 'count'=12;0;0 

另请注意 ,event-id 不是全局唯一的 ,而是每个源都是唯一的,所以如果另一个应用程序(源)碰巧使用相同的事件ID,则只使用事件ID很可能不会按预期工作。

PS这是testing0.5.1而不是0.5.0,但理论上也应该工作在0.5.0以及…