Module: check_mk
Branch: master
Commit: 4f59acb912eb79deac4f891718e1814eb080b5f8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4f59acb912eb79…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 7 11:01:49 2011 +0100
heartbeat_nodes: Fixed error handling when node is active but at least one link is dead
---
ChangeLog | 3 +++
checks/heartbeat_nodes | 9 ++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dfa1fbf..6412443 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* Bugfix: Servicegroups can be searched with the quicksearch snapin using
the 'sg:' prefix again
+ Checks & Agents:
+ * heartbeat_nodes: Fixed error handling when node is active but at least one link is
dead
+
1.1.9i7:
Core, Setup, etc.:
* Fix crash on Python 2.4 (e.g. RedHat) with fake_file
diff --git a/checks/heartbeat_nodes b/checks/heartbeat_nodes
index c940aba..ab59ba2 100644
--- a/checks/heartbeat_nodes
+++ b/checks/heartbeat_nodes
@@ -45,19 +45,22 @@ def check_heartbeat_nodes(item, params, info):
linkOutput = ''
for link, state in nodeLinks:
+ state_txt = ''
if state != 'up':
status = 2
- linkOutput += ' %s: %s, ' % (link, state)
+ state_txt = ' (CRIT)'
+ linkOutput += '%s: %s%s, ' % (link, state, state_txt)
linkOutput = linkOutput.rstrip(', ')
if nodeStatus in [ 'active', 'up', 'ping' ] and
status <= 0:
status = 0
elif nodeStatus == 'dead' and status <= 2:
status = 2
- else:
+
+ if not nodeStatus in [ 'active', 'up', 'ping',
'dead' ]:
return (3, "UNKNOWN - Node %s has an unhandled state: %s" %
(line[0], nodeStatus))
- return (status, '%s - Node %s is in state "%s". Links:%s' %
(nagios_state_names[status], line[0], nodeStatus, linkOutput))
+ return (status, '%s - Node %s is in state "%s". Links: %s'
% (nagios_state_names[status], line[0], nodeStatus, linkOutput))
return (3, "UNKNOWN - Node is not present anymore")