Module: check_mk
Branch: master
Commit: 8fac15f4b8181ed864496dea712f20397a5bf5e0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8fac15f4b8181e…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Sep 23 13:25:00 2014 +0200
#1118 bluecat_dns, bluecat_dhcp: no able to run as clustered checks
Both checks can now be configured as clustered services.
If either of the cluster nodes is in OK state, the check will report OK.
---
.werks/1118 | 11 +++++++++++
ChangeLog | 1 +
checks/bluecat_dhcp | 18 ++++++++++++------
checks/bluecat_dns | 17 +++++++++++------
4 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/.werks/1118 b/.werks/1118
new file mode 100644
index 0000000..9877b90
--- /dev/null
+++ b/.werks/1118
@@ -0,0 +1,11 @@
+Title: bluecat_dns, bluecat_dhcp: no able to run as clustered checks
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1411471414
+Class: feature
+
+Both checks can now be configured as clustered services.
+If either of the cluster nodes is in OK state, the check will report OK.
+
diff --git a/ChangeLog b/ChangeLog
index 657b134..952de45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -64,6 +64,7 @@
* 1403 kernel.util: allow levels for the total CPU utilization...
NOTE: Please refer to the migration notes!
* 1117 agent_vsphere: now able to query license information from esx system...
+ * 1118 bluecat_dns, bluecat_dhcp: no able to run as clustered checks...
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/checks/bluecat_dhcp b/checks/bluecat_dhcp
index e92a589..ff677d8 100644
--- a/checks/bluecat_dhcp
+++ b/checks/bluecat_dhcp
@@ -35,23 +35,29 @@ def inventory_bluecat_dhcp(info):
return [(None, None)]
def check_bluecat_dhcp(item, params, info):
- oper_state, leases_sec = map(int, info[0])
oper_states = {
1 : "running normally",
2 : "not running",
3 : "currently starting",
4 : "currently stopping",
5 : "fault"
-
}
+
state = 0
- if oper_state in params['oper_states']['warning']:
- state = 1
- elif oper_state in params['oper_states']['critical']:
- state = 2
+ for line in info:
+ oper_state, leases_sec = map(int, info[0])
+ if oper_state in params['oper_states']['warning']:
+ state = 1
+ elif oper_state in params['oper_states']['critical']:
+ state = 2
+ else:
+ state = 0
+ break
+
yield state, "DHCP is %s" % oper_states[oper_state]
yield 0, '%s Leases per second' % leases_sec, [ ('leases', leases_sec
) ]
+
check_info["bluecat_dhcp"] = {
"check_function" : check_bluecat_dhcp,
"inventory_function" : inventory_bluecat_dhcp,
diff --git a/checks/bluecat_dns b/checks/bluecat_dns
index 4ec1948..4515454 100644
--- a/checks/bluecat_dns
+++ b/checks/bluecat_dns
@@ -35,20 +35,25 @@ def inventory_bluecat_dns(info):
return [(None, None)]
def check_bluecat_dns(item, params, info):
- oper_state = int(info[0][0])
oper_states = {
1 : "running normally",
2 : "not running",
3 : "currently starting",
4 : "currently stopping",
5 : "fault"
-
}
+
state = 0
- if oper_state in params['oper_states']['warning']:
- state = 1
- elif oper_state in params['oper_states']['critical']:
- state = 2
+ for line in info:
+ oper_state = int(line[0])
+ if oper_state in params['oper_states']['warning']:
+ state = 1
+ elif oper_state in params['oper_states']['critical']:
+ state = 2
+ else:
+ state = 0
+ break
+
yield state, "DNS is %s" % oper_states[oper_state]
check_info["bluecat_dns"] = {