nag.py acknowledging non-problems for host checks

36 views
Skip to first unread message

Matt Selsky

unread,
Feb 7, 2013, 2:43:24 AM2/7/13
to na...@googlegroups.com
I think I found a bug in nag.py.  When I add an acknowledgement for an entire host, the host check is acknowledged, even if it's not in a problem state.

Here's an example:

$ nag.py s host.example.com
[host.example.com] (----): UP Host up
[di...@host.example.com] (----): OK All filesystems are below usage thresholds
$ nag.py a a host.example.com
[host.example.com]: Acknowledgement added
[di...@host.example.com]: No problem found

Seems to be related to the fact that obj as passed to handle_acknowledgement() for the host check contains:

{'checks_enabled': True,
 'current_state_str': 'UP',
 'event_handler_enabled': True,
 'host_name': 'host.example.com',
 'notifications_enabled': True,
 'plugin_output': 'Host up',
 'problem_has_been_acknowledged': False,
 'services': ['disk'],
 'type': 'host'}

But the problem check code only looks for 'OK' in obj['current_state_str'].

It should check for obj['current_state_str'] == 'UP' as well, yes?  Or should we be checking against the numerical obj['current_state'] and check for numeric equality?

I can submit a patch for either.

Cheers,

-- 
Matt

Matt Selsky

unread,
Feb 7, 2013, 3:12:02 PM2/7/13
to na...@googlegroups.com



-- 
Matt

--
You received this message because you are subscribed to the Google Groups "NagMQ Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nagmq+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jonathan Reams

unread,
Feb 9, 2013, 9:59:28 AM2/9/13
to na...@googlegroups.com
Thanks for the patch, Matt!

JBR
Reply all
Reply to author
Forward
0 new messages