[checkmk-commits] Check_MK Git: check_mk: docsis_downstream_channels: disable frequency check per default

Mathias Kettner mk at mathias-kettner.de
Fri Aug 29 16:33:47 CEST 2014


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

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Fri Aug 29 16:33:40 2014 +0200

docsis_downstream_channels: disable frequency check per default

---

 checks/docsis_channels_downstream |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/checks/docsis_channels_downstream b/checks/docsis_channels_downstream
index 96df170..10d0d6a 100644
--- a/checks/docsis_channels_downstream
+++ b/checks/docsis_channels_downstream
@@ -25,7 +25,6 @@
 # Boston, MA 02110-1301 USA.
 
 factory_settings["docsis_channels_downstream"] = {
-    "frequency" : ( 155,  163 ),
     "power"     : ( 5.0, 1.0 ),
 }
 
@@ -54,16 +53,17 @@ def check_docsis_channels_downstream(item, params, info):
             # Check Frequency
             frequency_mhz = float(frequency) / 1000000
             infotext = "Frequency is %.1f MHz" % frequency_mhz
-            warn, crit = params["frequency"]
             perfdata = [("frequency" , frequency_mhz, warn, crit )]
-            levels = " (Levels Warn/Crit at %d MHz/ %d MHz)" % ( warn, crit )
             state = 0
-            if frequency_mhz >= crit:
-                state = 2
-                infotext += levels
-            elif frequency_mhz >= warn:
-                state  = 1
-                infotext += levels
+            if "frequency" in params:
+                warn, crit = params["frequency"]
+                levels = " (warn/crit at %d MHz/ %d MHz)" % ( warn, crit )
+                if frequency_mhz >= crit:
+                    state = 2
+                    infotext += levels
+                elif frequency_mhz >= warn:
+                    state  = 1
+                    infotext += levels
             # Change this to yield in case of future extension of the check
             yield state, infotext, perfdata
             return



More information about the checkmk-commits mailing list