Module: check_mk
Branch: master
Commit: 0124c926b47ba120a0929c7f94a82b7fce143a55
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0124c926b47ba1…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jan 26 15:03:16 2015 +0100
#1674 ibm_svc_license / other license checks: now able to configure limits
The check ibm_svc_license now has configurable license limits via WATO.
Additionally, the limits for all license check got a small change,
thats why this werk is marked as <tt>incompatible</tt>.
Old limits:
<ul>
<li>Absolute unused levels - Warn/Crit at xx</li>
<li>Percentage unused levels - Warn/Crit at xx</li>
<li>Go critical if all licenses are used</li>
<li>Always report OK</li>
</ul>
New limits:
<ul>
<li>Absolute unused levels - Warn/Crit below xx</li>
<li>Percentage unused levels - Warn/Crit below xx</li>
<li>Go critical if all licenses are used</li>
<li>Always report OK</li>
</ul>
This change has been made because it was hard to configure an OK state
when the used licenses equalled the number of available licenses.
---
.werks/1674 | 33 +++++++++++++++++++++++++++++++++
ChangeLog | 2 ++
checks/ibm_svc_license | 9 +++------
checks/license.include | 4 ++--
web/plugins/wato/check_parameters.py | 20 ++++++++++++++++----
5 files changed, 56 insertions(+), 12 deletions(-)
diff --git a/.werks/1674 b/.werks/1674
new file mode 100644
index 0000000..c0951e7
--- /dev/null
+++ b/.werks/1674
@@ -0,0 +1,33 @@
+Title: ibm_svc_license / other license checks: now able to configure limits
+Level: 1
+Component: wato
+Compatible: incomp
+Version: 1.2.7i1
+Date: 1422280492
+Class: feature
+
+The check ibm_svc_license now has configurable license limits via WATO.
+
+Additionally, the limits for all license check got a small change,
+thats why this werk is marked as <tt>incompatible</tt>.
+
+
+Old limits:
+<ul>
+<li>Absolute unused levels - Warn/Crit at xx</li>
+<li>Percentage unused levels - Warn/Crit at xx</li>
+<li>Go critical if all licenses are used</li>
+<li>Always report OK</li>
+</ul>
+
+
+New limits:
+<ul>
+<li>Absolute unused levels - Warn/Crit below xx</li>
+<li>Percentage unused levels - Warn/Crit below xx</li>
+<li>Go critical if all licenses are used</li>
+<li>Always report OK</li>
+</ul>
+
+This change has been made because it was hard to configure an OK state
+when the used licenses equalled the number of available licenses.
diff --git a/ChangeLog b/ChangeLog
index ff04e32..c097d3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -140,6 +140,8 @@
* 1785 Upload SNMP MIBs via WATO...
* 1461 msexch_dag.copyqueue: added a WATO rule for this check
* 1868 "Successfully created the host" message is also shown on host
diagnose page now
+ * 1674 ibm_svc_license / other license checks: now able to configure limits...
+ NOTE: Please refer to the migration notes!
* 1761 FIX: Ruleset search is now consistent for host & serviceparameters and
manual checks
* 1765 FIX: Fixed bug when generating nagvis backends while having sites with
livestatus proxy configured...
* 1789 FIX: Fix preview of passive checks in WATO list of services
diff --git a/checks/ibm_svc_license b/checks/ibm_svc_license
index 8fe566b..098d553 100644
--- a/checks/ibm_svc_license
+++ b/checks/ibm_svc_license
@@ -65,21 +65,18 @@ def inventory_ibm_svc_license(info):
inventory.append( (license, None) )
return inventory
-def check_ibm_svc_license(item, _no_params, info):
+def check_ibm_svc_license(item, params, info):
licenses = parse_ibm_svc_license(info)
licensed, used = licenses[item]
perfdata = [ ("licensed", licensed), ("used", used) ]
- if used > licensed:
- status = 2
- else:
- status = 0
- return status, "%s %s licensed, %s used" % (item, licensed, used),
perfdata
+ return license_check_levels(licensed, used, params)
check_info["ibm_svc_license"] = {
"check_function" : check_ibm_svc_license,
"inventory_function" : inventory_ibm_svc_license,
"service_description" : "License %s",
+ "group" : "ibmsvc_licenses",
"has_perfdata" : True,
}
diff --git a/checks/license.include b/checks/license.include
index 8bf8f34..198248b 100644
--- a/checks/license.include
+++ b/checks/license.include
@@ -45,9 +45,9 @@ def license_check_levels(have, used, params):
else:
infotext = "used %d licenses, but you have only %d" % (used, have)
- if crit != None and used >= crit:
+ if crit != None and used > crit:
status = 2
- elif warn != None and used >= warn:
+ elif warn != None and used > warn:
status = 1
else:
status = 0
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index adf4487..644b7b5 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6793,15 +6793,15 @@ vs_license = Alternative(
Tuple(
title = _("Absolute levels for unused licenses"),
elements = [
- Integer(title = _("Warning at"), default_value = 5, unit
= _("unused licenses")),
- Integer(title = _("Critical at"), default_value = 0, unit
= _("unused licenses")),
+ Integer(title = _("Warning below"), default_value = 5,
unit = _("unused licenses")),
+ Integer(title = _("Critical below"), default_value = 0,
unit = _("unused licenses")),
]
),
Tuple(
title = _("Percentual levels for unused licenses"),
elements = [
- Percentage(title = _("Warning at"), default_value =
10.0),
- Percentage(title = _("Critical at"), default_value = 0),
+ Percentage(title = _("Warning below"), default_value =
10.0),
+ Percentage(title = _("Critical below"), default_value =
0),
]
),
FixedValue(
@@ -6844,6 +6844,18 @@ register_check_parameters(
register_check_parameters(
subgroup_applications,
+ "ibmsvc_licenses",
+ _("Number of used IBM SVC licenses"),
+ vs_license,
+ TextAscii(
+ title = _("ID of the license, e.g.
<tt>virtualization</tt>"),
+ allow_empty = False,
+ ),
+ "first"
+)
+
+register_check_parameters(
+ subgroup_applications,
"citrix_load",
_("Load of Citrix Server"),
Tuple(