Module: check_mk
Branch: master
Commit: 92506652a8a241a38dc8b9d017b5ae329eb76897
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=92506652a8a241…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 31 13:23:16 2014 +0100
#1167 citrix_license/esx_license: Can now be configured to always show OK as state
---
.bugs/2203 | 9 +++++++++
.werks/1167 | 9 +++++++++
ChangeLog | 1 +
checks/license.include | 7 +++++--
web/plugins/wato/check_parameters.py | 12 +++++++++---
5 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/.bugs/2203 b/.bugs/2203
new file mode 100644
index 0000000..6204949
--- /dev/null
+++ b/.bugs/2203
@@ -0,0 +1,9 @@
+Title: Windows-Dateien: Sicherstellen, dass alle CRLF-Umbrüche nutzen
+Component: checks
+State: open
+Date: 2014-10-31 11:36:39
+Targetversion: 1.2.5i1
+Class: bug
+
+Some files contained in the windows agent (example config) and agent plugins do not use
windows
+line endings. This should be changed to make easier editing on windows systems easier
diff --git a/.werks/1167 b/.werks/1167
new file mode 100644
index 0000000..c7378b9
--- /dev/null
+++ b/.werks/1167
@@ -0,0 +1,9 @@
+Title: citrix_license/esx_license: Can now be configured to always show OK as state
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1414758172
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 2da460d..2c57c0b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
1.2.5i7:
Checks & Agents:
+ * 1167 citrix_license/esx_license: Can now be configured to always show OK as state
* 1478 FIX: kernel.util, statgrab_cpu: fix computation of utilization...
Multisite:
diff --git a/checks/license.include b/checks/license.include
index fd8936b..8bf8f34 100644
--- a/checks/license.include
+++ b/checks/license.include
@@ -29,6 +29,9 @@ def license_check_levels(have, used, params):
if params == None:
warn = have
crit = have
+ elif params == False:
+ warn = None
+ crit = None
elif type(params[0]) == int:
warn = max(0, have - params[0])
crit = max(0, have - params[1])
@@ -42,9 +45,9 @@ def license_check_levels(have, used, params):
else:
infotext = "used %d licenses, but you have only %d" % (used, have)
- if used >= crit:
+ if crit != None and used >= crit:
status = 2
- elif 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 381b24e..fe9254c 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6189,18 +6189,19 @@ register_check_parameters(
vs_license = Alternative(
+ title = _("Levels for Number of Licenses"),
style = "dropdown",
default_value = None,
elements = [
Tuple(
- title = _("Absolute Levels for unused licenses"),
+ 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")),
]
),
Tuple(
- title = _("Percentual Levels for unused licenses"),
+ title = _("Percentual levels for unused licenses"),
elements = [
Percentage(title = _("Warning at"), default_value =
10.0),
Percentage(title = _("Critical at"), default_value = 0),
@@ -6208,9 +6209,14 @@ vs_license = Alternative(
),
FixedValue(
None,
- totext = _("critical if all are used"),
+ totext = _("Critical when all licenses are used"),
title = _("Go critical if all licenses are used"),
),
+ FixedValue(
+ False,
+ title = _("Always report OK"),
+ totext = _("Alerting depending on the number of used licenses is
disabled"),
+ )
]
)