Module: check_mk
Branch: master
Commit: f5654a7a4c069117ca06d8cf350696707593c39d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f5654a7a4c0691…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Mar 27 15:24:08 2017 +0200
4549 FIX citrix_licenses: Fixed always ok state even if all licenses are used
Previously the state has been always been ok, even if no rule has been set
(with default on "Go crit if all licenses are used") and no license has
been left.
Change-Id: I47a976a2b5baf8b472e37fc3c61ccec7062f8f02
---
.werks/4549 | 12 ++++++++++++
checks/license.include | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/4549 b/.werks/4549
new file mode 100644
index 0000000..2923c8e
--- /dev/null
+++ b/.werks/4549
@@ -0,0 +1,12 @@
+Title: citrix_licenses: Fixed always ok state even if all licenses are used
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1490620927
+Class: fix
+
+Previously the state has been always been ok, even if no rule has been set
+(with default on "Go crit if all licenses are used") and no license has
+been left.
diff --git a/checks/license.include b/checks/license.include
index 269086b..e5ef665 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