Module: check_mk
Branch: master
Commit: 3fe779ab4360e1fd7ed39a19c2b7a7a45e1edf7e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3fe779ab4360e1…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Jan 8 15:56:38 2016 +0100
#2888 FIX citrix_controller.licensing: ignoring double data from piggy backs
---
.werks/2888 | 9 +++++++++
ChangeLog | 1 +
checks/citrix_controller | 41 ++++++++++++++++++++++-------------------
3 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/.werks/2888 b/.werks/2888
new file mode 100644
index 0000000..804cefd
--- /dev/null
+++ b/.werks/2888
@@ -0,0 +1,9 @@
+Title: citrix_controller.licensing: ignoring double data from piggy backs
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1452264891
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index d791b46..42c3272 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -174,6 +174,7 @@
* 2914 FIX: hr_cpu: fixed check not being applied on some systems...
* 1320 FIX: fjdarye60_sum: Fixed bug in discovery function
* 2898 FIX: smart: Using normalized value for determining reallocated events
state...
+ * 2888 FIX: citrix_controller.licensing: ignoring double data from piggy backs
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/citrix_controller b/checks/citrix_controller
index 082ab51..9d79f6c 100644
--- a/checks/citrix_controller
+++ b/checks/citrix_controller
@@ -185,30 +185,33 @@ def check_citrix_controller_licensing(_no_item, _no_params, info):
"licensingserverstate" : (
"Licensing Server State",
{
- "ServerNotSpecified" : 2,
- "NotConnected" : 1,
- "OK" : 0,
- "LicenseNotInstalled" : 2,
- "LicenseExpired" : 2,
- "Incompatible" : 2,
- "Failed" : 2,
+ "ServerNotSpecified" : (2, "server not
specified"),
+ "NotConnected" : (1, "not connected"),
+ "OK" : (0, "OK"),
+ "LicenseNotInstalled" : (2, "license not
installed"),
+ "LicenseExpired" : (2, "licenese
expired"),
+ "Incompatible" : (2, "incompatible"),
+ "Failed" : (2, "failed"),
}),
"licensinggracestate" : (
- "Licensing Grace State: ",
+ "Licensing Grace State",
{
- "NotActive" : 0,
- "Active" : 2,
- "InOutOfBoxGracePeriod" : 1,
- "InSupplementalGracePeriod" : 1,
- "InEmergencyGracePeriod" : 2,
- "GracePeriodExpired" : 2,
+ "NotActive" : (0, "not active"),
+ "Active" : (2, "active"),
+ "InOutOfBoxGracePeriod" : (1, "in-out-of-box grace
period"),
+ "InSupplementalGracePeriod" : (1, "in-supplemental grace
period"),
+ "InEmergencyGracePeriod" : (2, "in-emergency grace
period"),
+ "GracePeriodExpired" : (2, "grace period
expired"),
}),
}
-
- for what, (title, states) in statedict.items():
- for line in info:
- if line[0].lower() == what:
- yield states[line[1]], title + ": " + line[1]
+ # piggy back data might deliver double data
+ detected_states = []
+ for line in info:
+ if line[0].lower() in statedict and line[0] not in detected_states:
+ detected_states.append(line[0])
+ title, states = statedict[line[0].lower()]
+ state, state_readable = states[line[1]]
+ yield state, "%s: %s" % (title, state_readable)
check_info["citrix_controller.licensing"] = {