Module: check_mk
Branch: master
Commit: 279ee84de6a612596b31207fee6f60489858c78a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=279ee84de6a612…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Mar 20 23:03:46 2014 +0100
Improved details of check output of all dell_poweredge_* checks
---
checkman/dell_poweredge_pci | 2 +-
checks/dell_poweredge_amperage | 24 +++++++++++++-----------
checks/dell_poweredge_cpu | 2 +-
checks/dell_poweredge_mem | 2 +-
checks/dell_poweredge_netdev | 1 -
checks/dell_poweredge_pci | 2 +-
checks/dell_poweredge_status | 16 ++++++++--------
checks/dell_poweredge_temp | 2 +-
8 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/checkman/dell_poweredge_pci b/checkman/dell_poweredge_pci
index 995f01f..d0043fa 100644
--- a/checkman/dell_poweredge_pci
+++ b/checkman/dell_poweredge_pci
@@ -14,7 +14,7 @@ description:
No limits are set in the check.
- In addition to the state the following information of the memory modules
+ In addition to the state the following information
is retrieved and displayed in the check output: width of the data bus,
description of the device and manufacturer,
diff --git a/checks/dell_poweredge_amperage b/checks/dell_poweredge_amperage
index a6dfcb3..e31a561 100644
--- a/checks/dell_poweredge_amperage
+++ b/checks/dell_poweredge_amperage
@@ -78,18 +78,20 @@ def check_dell_poweredge_amperage(item, _no_params, info):
}
state_txt, state = state_table.get(Status, "2")
- if UpperNonCritical or UpperCritical:
+ if UpperNonCritical and UpperCritical:
limittext = " (upper limits %s/%s)" % (UpperNonCritical,
UpperCritical)
+ maxi = savefloat(UpperCritical) * 1.1
else:
limittext = ""
+ maxi = ""
if ProbeType in ( "23", "25" ): # Amps
current = str(int(Reading)/10.0)
infotext = "%s Ampere %s" % ( current, state_txt )
- perfdata = [( "current", current+"A",
UpperNonCritical, UpperCritical )]
+ perfdata = [( "current", current+"A",
UpperNonCritical, UpperCritical, "", maxi )]
elif ProbeType in ( "24", "26" ): # Watts
infotext = "%s Watt %s" % ( Reading, state_txt )
- perfdata = [( "power", Reading+"W", UpperNonCritical,
UpperCritical )]
+ perfdata = [( "power", Reading+"W", UpperNonCritical,
UpperCritical, "", maxi )]
else:
infotext = "Unknown Probe Type %s" % ProbeType
return 3, infotext
@@ -107,11 +109,11 @@ check_info["dell_poweredge_amperage.power"] = {
"snmp_scan" : dell_poweredge_amperage_scan,
}
-check_info["dell_poweredge_amperage.current"] = {
- "check_function" : check_dell_poweredge_amperage,
- "inventory_function" : inventory_dell_poweredge_amperage_current,
- "service_description" : "%s",
- "has_perfdata" : True,
- "snmp_info" : dell_poweredge_amperage_info,
- "snmp_scan" : dell_poweredge_amperage_scan,
-}
+#check_info["dell_poweredge_amperage.current"] = {
+# "check_function" : check_dell_poweredge_amperage,
+# "inventory_function" : inventory_dell_poweredge_amperage_current,
+# "service_description" : "%s",
+# "has_perfdata" : True,
+# "snmp_info" : dell_poweredge_amperage_info,
+# "snmp_scan" : dell_poweredge_amperage_scan,
+#}
diff --git a/checks/dell_poweredge_cpu b/checks/dell_poweredge_cpu
index de91938..2168a67 100644
--- a/checks/dell_poweredge_cpu
+++ b/checks/dell_poweredge_cpu
@@ -65,7 +65,7 @@ def check_dell_poweredge_cpu(item, _no_params, info):
"5" : ( "Critical", 2 ),
"6" : ( "NonRecoverable", 2 ),
}
- state_txt, state = state_table.get(Status, "2")
+ state_txt, state = state_table.get(Status, ( "unknown state", 2 ))
infotext = "%s %s" % ( BrandName, state_txt )
return state, infotext
diff --git a/checks/dell_poweredge_mem b/checks/dell_poweredge_mem
index 3acd7bc..083fefd 100644
--- a/checks/dell_poweredge_mem
+++ b/checks/dell_poweredge_mem
@@ -66,7 +66,7 @@ def check_dell_poweredge_mem(item, _no_params, info):
"5" : ( "Critical", 2 ),
"6" : ( "NonRecoverable", 2 ),
}
- infotext, state = state_table.get(status, "2")
+ infotext, state = state_table.get(status, ( "unknown state", 2 ))
for parameter, value in di.items():
infotext += ", %s: %s" % ( parameter, value )
diff --git a/checks/dell_poweredge_netdev b/checks/dell_poweredge_netdev
index a8f874a..687a901 100644
--- a/checks/dell_poweredge_netdev
+++ b/checks/dell_poweredge_netdev
@@ -55,7 +55,6 @@ def check_dell_poweredge_netdev(item, _no_params, info):
di = dict()
for status, connection_status, di['Product'], cur_mac, fqdd in info:
if item == fqdd:
- print connection_status
di['MAC'] = '-'.join( [ "%02X" % ord( c ) for c in
cur_mac ] ).strip()
state_table = {
"1" : ( "other,", 1 ),
diff --git a/checks/dell_poweredge_pci b/checks/dell_poweredge_pci
index 451ec19..f6a90c2 100644
--- a/checks/dell_poweredge_pci
+++ b/checks/dell_poweredge_pci
@@ -59,7 +59,7 @@ def check_dell_poweredge_pci(item, _no_params, info):
"5" : ( "Critical", 2 ),
"6" : ( "NonRecoverable", 2 ),
}
- infotext, state = state_table.get(status, "2")
+ infotext, state = state_table.get(status, ( "unknown state", 2 ))
for parameter, value in di.items():
infotext += ", %s: %s" % ( parameter, value )
diff --git a/checks/dell_poweredge_status b/checks/dell_poweredge_status
index 4724485..c3cd7ff 100644
--- a/checks/dell_poweredge_status
+++ b/checks/dell_poweredge_status
@@ -44,18 +44,18 @@ def check_dell_poweredge_status(item, _no_params, info):
di['racURL'], di['Chassis'], di['Slot'], di['Model'],
status, di['ServiceTag'] = info[0]
state_table = {
- "1" : ( "other", 1 ),
- "2" : ( "unknown", 1 ),
- "3" : ( "ok", 0 ),
- "4" : ( "nonCritical", 1 ),
- "5" : ( "Critical", 2 ),
- "6" : ( "NonRecoverable", 2 ),
+ "1" : ( "other, ", 1 ),
+ "2" : ( "unknown, ", 1 ),
+ "3" : ( "", 0 ),
+ "4" : ( "nonCritical, ", 1 ),
+ "5" : ( "Critical, ", 2 ),
+ "6" : ( "NonRecoverable, ", 2 ),
}
state_txt, state = state_table.get(status, "2")
infotext, state = state_table.get(status, "2")
for parameter, value in di.items():
- infotext += ", %s: %s" % ( parameter, value )
- infotext = re.sub("^, ","", infotext)
+ infotext += "%s: %s, " % ( parameter, value )
+ infotext = re.sub(", $","", infotext)
return state, infotext
diff --git a/checks/dell_poweredge_temp b/checks/dell_poweredge_temp
index 6eb5d93..0790493 100644
--- a/checks/dell_poweredge_temp
+++ b/checks/dell_poweredge_temp
@@ -74,7 +74,7 @@ def check_dell_poweredge_temp(item, _no_params, info):
"9" : ( "NonRecoverableLower", 2 ),
"10" : ( "failed", 2 ),
}
- state_txt, state = state_table.get(Status, "2")
+ state_txt, state = state_table.get(Status, ( "unknown state", 2 ))
infotext = "%.1f Degrees (upper limits %s/%s) %s" % ( temp, warn,
crit, state_txt )
perfdata = [( "temp", temp, warn, crit )]