Module: check_mk
Branch: master
Commit: 41c61be2cd60fb9c650bc40b35dac51404baa30d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=41c61be2cd60fb…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Oct 15 15:33:00 2014 +0200
#1126 FIX bluecat_ntp: check no longer crashes on evaluating sysLeap values higher than 1
The oid sysLeap is specificied as bitfield.
The 4 possible values are reported as
<ul>
<li>0: no warning</li>
<li>1: add second</li>
<li>10: subtract second</li>
<li>11: Alarm</li>
</ul>
<br>
The previous implementation was incorrected, because it expected the numbers 0-3.
---
.werks/1126 | 20 ++++++++++++++++++++
ChangeLog | 1 +
checks/bluecat_ntp | 13 +++++++------
3 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/.werks/1126 b/.werks/1126
new file mode 100644
index 0000000..c15dc7d
--- /dev/null
+++ b/.werks/1126
@@ -0,0 +1,20 @@
+Title: bluecat_ntp: check no longer crashes on evaluating sysLeap values higher than 1
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1413379702
+Class: fix
+
+The oid sysLeap is specificied as bitfield.
+The 4 possible values are reported as
+
+<ul>
+<li>0: no warning</li>
+<li>1: add second</li>
+<li>10: subtract second</li>
+<li>11: Alarm</li>
+</ul>
+<br>
+
+The previous implementation was incorrected, because it expected the numbers 0-3.
diff --git a/ChangeLog b/ChangeLog
index 21e8864..9c23b35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -106,6 +106,7 @@
* 1184 FIX: cisco_power: Fixed detection of item. In some cases the status
information was part of the item...
NOTE: Please refer to the migration notes!
* 1078 FIX: Fix compensation for daylight safing time in prediction
+ * 1126 FIX: bluecat_ntp: check no longer crashes on evaluating sysLeap values higher
than 1...
Multisite:
* 1066 Implemented Dashboard Designer...
diff --git a/checks/bluecat_ntp b/checks/bluecat_ntp
index 4b3b50c..7f90e00 100644
--- a/checks/bluecat_ntp
+++ b/checks/bluecat_ntp
@@ -45,6 +45,7 @@ def check_bluecat_ntp(item, params, info):
5 : "fault"
}
+
state = 0
if oper_state in params['oper_states']['warning']:
state = 1
@@ -53,15 +54,15 @@ def check_bluecat_ntp(item, params, info):
yield state, "Process is %s" % oper_states[oper_state]
sys_leap_states = {
- 0 : 'no Warning',
- 1 : 'add second',
- 2 : 'subtract second',
- 3 : 'Alarm'
+ 0 : 'no Warning',
+ 1 : 'add second',
+ 10 : 'subtract second',
+ 11 : 'Alarm'
}
state = 0
- if sys_leap == 3:
+ if sys_leap == 11:
state = 2
- elif sys_leap in [ 1, 2 ]:
+ elif sys_leap in [ 1, 10 ]:
state = 1
yield state, "Sys Leap: %s" % sys_leap_states[sys_leap]