Module: check_mk
Branch: master
Commit: e8f737b670d2e6f32c67344b99de820fefe1d0fc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e8f737b670d2e6…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Sep 1 16:06:20 2015 +0200
fixed default levels on new ipr400 checks
---
checks/ipr400_in_voltage | 6 +++---
checks/ipr400_temp | 22 ++++++++++++++--------
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/checks/ipr400_in_voltage b/checks/ipr400_in_voltage
index 5eb878f..e1d0d19 100644
--- a/checks/ipr400_in_voltage
+++ b/checks/ipr400_in_voltage
@@ -25,8 +25,8 @@
# Boston, MA 02110-1301 USA.
-ipr400_in_voltage_default_levels = (12.0, 11.5) # 11.5-13.8V is the operational voltage
according
- # to the manual
+ipr400_in_voltage_default_levels = (12, 11) # 11.5-13.8V is the operational voltage
according
+ # to the manual
def inventory_ipr400_in_voltage(info):
if len(info) > 0:
@@ -37,7 +37,7 @@ def check_ipr400_in_voltage(item, params, info):
power = int(info[0][0]) / 1000.0 # appears to be in mV
perfdata = [ ( "in_voltage", power, warn, crit ) ]
infotext = "in voltage: %.1fV" % power
- limitstext = "(warn/crit below %.1fV/%.1fV)" % (warn, crit)
+ limitstext = "(warn/crit below %dV/%dV)" % (warn, crit)
if power <= crit:
return 2, infotext + ", " + limitstext, perfdata
diff --git a/checks/ipr400_temp b/checks/ipr400_temp
index 3c6593a..6f71f23 100644
--- a/checks/ipr400_temp
+++ b/checks/ipr400_temp
@@ -25,6 +25,11 @@
# Boston, MA 02110-1301 USA.
+factory_settings["ipr400_temp_default_levels"] = {
+ "levels": (30, 40), # reported temperature seems to be near room
temperature usually
+}
+
+
def inventory_ipr400_temp(info):
if len(info) > 0:
yield "Ambient", None
@@ -33,13 +38,14 @@ def check_ipr400_temp(item, params, info):
return check_temperature(int(info[0][0]), params)
check_info["ipr400_temp"] = {
- "check_function" : check_ipr400_temp,
- "inventory_function" : inventory_ipr400_temp,
- "service_description" : "Temperature %s ",
- "has_perfdata" : True,
- "group" : "temperature",
- "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0").lower().startswith("ipr voip device
ipr400"),
- "snmp_info" : ( ".1.3.6.1.4.1.27053.1.4.5", [ 9 ] ),
- "includes" : [ "temperature.include" ],
+ "check_function" : check_ipr400_temp,
+ "inventory_function" : inventory_ipr400_temp,
+ "default_levels_variable" : "ipr400_temp_default_levels",
+ "service_description" : "Temperature %s ",
+ "has_perfdata" : True,
+ "group" : "temperature",
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0").lower().startswith("ipr voip device
ipr400"),
+ "snmp_info" : ( ".1.3.6.1.4.1.27053.1.4.5", [ 9 ]
),
+ "includes" : [ "temperature.include" ],
}