[checkmk-commits] Check_MK Git: check_mk: #1891 apc_symmetra: Now supports setting levels on remaining battery time

Konstantin Büttner kb at mathias-kettner.de
Thu Feb 26 12:04:44 CET 2015


Module: check_mk
Branch: master
Commit: 6176f9c072b8e339e12ea483ae30db73131fcc67
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6176f9c072b8e339e12ea483ae30db73131fcc67

Author: Konstantin Büttner <kb at mathias-kettner.de>
Date:   Thu Feb 26 12:04:37 2015 +0100

#1891 apc_symmetra: Now supports setting levels on remaining battery time

The WATO rule and check have been extended to allow setting levels on remaining
battery time. Doing so is optional.

---

 .werks/1891                          |   10 ++++++++++
 ChangeLog                            |    1 +
 checkman/apc_symmetra                |    2 +-
 checks/apc_symmetra                  |    4 ++--
 web/plugins/wato/check_parameters.py |    8 ++++----
 5 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/.werks/1891 b/.werks/1891
new file mode 100644
index 0000000..407de02
--- /dev/null
+++ b/.werks/1891
@@ -0,0 +1,10 @@
+Title: apc_symmetra: Now supports setting levels on remaining battery time
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1424948572
+Class: feature
+
+The WATO rule and check have been extended to allow setting levels on remaining
+battery time. Doing so is optional.
diff --git a/ChangeLog b/ChangeLog
index 6f9d88e..3bc4700 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -96,6 +96,7 @@
     * 2036 docsis_channels_upstream: Add handling for codewords (WATO rule, rate computation, Perf-O-Meter)
     * 1947 agent_ucs_bladecenter: Monitors UCS Bladecenter via Web-API...
     * 2039 mk_logwatch: new per-logfile-options maxfilesize and maxlinesize...
+    * 1891 apc_symmetra: Now supports setting levels on remaining battery time...
     * 1457 FIX: logins: new check renamed from "users" check...
             NOTE: Please refer to the migration notes!
     * 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/checkman/apc_symmetra b/checkman/apc_symmetra
index 89d8a44..d8ea32f 100644
--- a/checkman/apc_symmetra
+++ b/checkman/apc_symmetra
@@ -80,7 +80,7 @@ parameters(dict): parameters is a dictionary with the following keys:
  critical level for the battery capacity in the post-calibration phase in precent.  {"additional_time_span"}
  is a time span the post-calibration phase is extended past the day of the calibration in minutes.
 
- {"battime"}: A tuple (warn(int), crit(int)) of levels for the remaining battery time in minutes.
+ {"battime"}: A tuple (warn(int), crit(int)) of levels for the remaining battery time in seconds.
  This key is optional.
 
 parameters(tuple): The old format of a tuple of 4 values is also still supported, containing what
diff --git a/checks/apc_symmetra b/checks/apc_symmetra
index b0d9021..78d3986 100644
--- a/checks/apc_symmetra
+++ b/checks/apc_symmetra
@@ -202,10 +202,10 @@ def check_apc(item, params, info):
     label = ""
     if params.get('battime'):
         battime_warn, battime_crit = params['battime']
-        if int(RunTimeRemaining) / 60 <= battime_crit:
+        if int(RunTimeRemaining) <= battime_crit:
             battime_state = 2
             label = "(!!)"
-        elif int(RunTimeRemaining) / 60 <= battime_warn:
+        elif int(RunTimeRemaining) <= battime_warn:
             battime_state = 1
             label = "(!)"
 
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 066b889..f3e5f49 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6159,17 +6159,17 @@ register_check_parameters(
             Tuple(
                 title = _("Time left on battery"),
                 elements = [
-                    Integer(
+                    Age(
                         title = _("Warning at"),
                         help = _("Time left on Battery at and below which a warning state is triggered"),
-                        unit = _("min"),
                         default_value = 0,
+                        display = [ "hours", "minutes" ]
                     ),
-                    Integer(
+                    Age(
                         title = _("Critical at"),
                         help = _("Time Left on Battery at and below which a critical state is triggered"),
-                        unit = _("min"),
                         default_value = 0,
+                        display = [ "hours", "minutes" ]
                     ),
                 ],
             ),



More information about the checkmk-commits mailing list