Module: check_mk
Branch: master
Commit: d98ef05a257135034e5a82185b9942c0dd608291
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d98ef05a257135…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jul 23 16:27:28 2014 +0200
FIX ups_capacity: Fix exception when running on battery
The check went to UNKNOWN when the UPS was running on battery. This has been fixed.
The correct plugin output is now being displayed.
---
.werks/1049 | 9 +++++++++
ChangeLog | 1 +
checks/ups_capacity.include | 6 ++----
3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/.werks/1049 b/.werks/1049
new file mode 100644
index 0000000..cdbbab4
--- /dev/null
+++ b/.werks/1049
@@ -0,0 +1,9 @@
+Title: ups_capacity: Fix exception when running on battery
+Level: 1
+Component: checks
+Version: 1.2.5i5
+Date: 1406125592
+Class: fix
+
+The check went to UNKNOWN when the UPS was running on battery. This has been fixed.
+The correct plugin output is now being displayed.
diff --git a/ChangeLog b/ChangeLog
index ef761aa..bad989c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,6 +68,7 @@
* 0638 FIX: windows_updates: agent plugin now always sends section header, even if no
update information provided...
* 1084 FIX: ps: now able to handle bigger process groups without constant
MKCounterWrapped Exceptions...
* 1087 FIX: Active checks: Non-ascii check commands now converted into utf-8...
+ * 1049 FIX: ups_capacity: Fix exception when running on battery...
Multisite:
* 1013 Sort host names naturally, e.g. foobar11 comes after foobar2...
diff --git a/checks/ups_capacity.include b/checks/ups_capacity.include
index 3969304..c532850 100644
--- a/checks/ups_capacity.include
+++ b/checks/ups_capacity.include
@@ -47,12 +47,10 @@ def check_ups_capacity(item, params, info):
cap_label = ""
if time_on_bat > crit:
state = 2
- time_label = "On battery since %ds(%ds/%ds)(!!), " % time_on_bat, warn,
crit
- #return(2, "On battery since %ds(!!) " % time_on_bat + info_text,
perf)
+ time_label = "On battery since %ds (levels at %ds/%ds)(!!), " %
(time_on_bat, warn, crit)
elif time_on_bat > warn:
state = 1
- time_label = "On battery since %ds(%ds/%ds)(!)" % time_on_bat, warn,
crit
- #return(1, "On battery since %ds(!) " % time_on_bat + info_text, perf)
+ time_label = "On battery since %ds (levels at %ds/%ds)(!)" %
(time_on_bat, warn, crit)
if percent_fuel < cap_crit:
state = 2
cap_label = "(!!)"