Module: check_mk
Branch: master
Commit: 6e866ccb3c1c07abbebbb43761db654ee5e5c4c4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6e866ccb3c1c07…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 8 16:08:13 2010 +0100
printer_supply: Added new parameter "printer_supply_some_remaining_status" to
configure the reported state on small remaining capacity.
imm_health: Renamed to ibm_imm_health
rsa_health: Renamed to ibm_rsa_health
---
ChangeLog | 2 ++
checkman/printer_supply | 2 ++
checks/{imm_health => ibm_imm_health} | 10 ++++------
checks/{rsa_health => ibm_rsa_health} | 10 +++++-----
checks/printer_supply | 10 +++++++++-
5 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 97e3b34..448a345 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -106,6 +106,8 @@
* df_netapp32: Added better detection for possible 32bit counter wrap
* fc_brocade_port_detailed: Made check handle phystate
"noSystemControlAccessToSlot" (10)
The check also handles unknown states better now
+ * printer_supply: Added new parameter
"printer_supply_some_remaining_status" to
+ configure the reported state on small remaining capacity.
Multisite:
* The custom open/close states of custom links are now stored for each
diff --git a/checkman/printer_supply b/checkman/printer_supply
index 7f3118b..bd79c91 100644
--- a/checkman/printer_supply
+++ b/checkman/printer_supply
@@ -31,4 +31,6 @@ critical(int): The supply level in percentage at which (and below) a
critical st
[configuration]
printer_supply_default_levels(int, int): Set global default levels for warning and
critical
+printer_supply_some_remaining_status (int): Set the reported nagios state when the fill
state
+ is something between empty and small remaining capacity. Default is: 1 (WARN).
diff --git a/checks/imm_health b/checks/ibm_imm_health
similarity index 87%
rename from checks/imm_health
rename to checks/ibm_imm_health
index 3dd09de..79a3d46 100644
--- a/checks/imm_health
+++ b/checks/ibm_imm_health
@@ -26,11 +26,11 @@
# Author: Michael Nieporte <micha.nieporte(a)gmail.com> - Based on rsa_health by
Mathias Kettner
-def inventory_imm_health(checkname, info):
+def inventory_ibm_imm_health(checkname, info):
if len(info) > 0:
return [(None, None)]
-def check_imm_health(_no_item, _no_params, info):
+def check_ibm_imm_health(_no_item, _no_params, info):
num_alerts = (len(info) - 1) / 3
infotext = ""
for i in range(0, num_alerts):
@@ -52,7 +52,5 @@ def check_imm_health(_no_item, _no_params, info):
else:
return (3, "UNKNOWN - " + infotext)
-check_info['imm_health'] = ( check_imm_health, "System health", 0,
inventory_imm_health)
-snmp_info['imm_health'] = ( ".1.3.6.1.4.1.2.3.51.3.1", ["4"]
)
-snmp_scan_functions['imm_health'] = \
- lambda oid: "IMM" in oid(".1.3.6.1.2.1.1.1.0")
+check_info['ibm_imm_health'] = ( check_ibm_imm_health, "System health",
0, no_inventory_possible )
+snmp_info['ibm_imm_health'] = ( ".1.3.6.1.4.1.2.3.51.3.1",
["4"] )
diff --git a/checks/rsa_health b/checks/ibm_rsa_health
similarity index 89%
rename from checks/rsa_health
rename to checks/ibm_rsa_health
index d8fa1e5..61a6cc6 100644
--- a/checks/rsa_health
+++ b/checks/ibm_rsa_health
@@ -32,11 +32,11 @@
# systemLevel(4),
# normal(255)
-def inventory_rsa_health(checkname, info):
+def inventory_ibm_rsa_health(checkname, info):
if len(info) > 0:
return [(None, None)]
-def check_rsa_health(_no_item, _no_params, info):
+def check_ibm_rsa_health(_no_item, _no_params, info):
num_alerts = (len(info) - 1) / 3
infotext = ""
for i in range(0, num_alerts):
@@ -56,7 +56,7 @@ def check_rsa_health(_no_item, _no_params, info):
else:
return (3, "UNKNOWN - " + infotext)
-check_info['rsa_health'] = ( check_rsa_health, "System health", 0,
inventory_rsa_health)
-snmp_info['rsa_health'] = ( ".1.3.6.1.4.1.2.3.51.1.2", ["7"]
)
-snmp_scan_functions['rsa_health'] = \
+check_info['ibm_rsa_health'] = ( check_ibm_rsa_health, "System health",
0, inventory_ibm_rsa_health)
+snmp_info['ibm_rsa_health'] = ( ".1.3.6.1.4.1.2.3.51.1.2",
["7"] )
+snmp_scan_functions['ibm_rsa_health'] = \
lambda oid: "Remote Supervisor Adapter" in
oid(".1.3.6.1.2.1.1.1.0")
diff --git a/checks/printer_supply b/checks/printer_supply
index 2c9d742..a6df030 100644
--- a/checks/printer_supply
+++ b/checks/printer_supply
@@ -50,6 +50,12 @@
printer_supply_default_levels = (20, 10)
+# When the printer reports -3 as fill threshold the toner
+# might be empty or might have some small remaining capacities
+# the exact amount is unknown. This makes the nagios state reported
+# in this state configurable
+printer_supply_some_remaining_status = 1
+
# Workaround for toners and drum units in c5900 devices
# which have equal names for the single parts.
# Add the color description to that item
@@ -83,7 +89,7 @@ def check_printer_supply(item, params, info):
elif current == -2 or maxlevel == -2:
return (3, "UNKNOWN - Couldn't get info about supply")
elif current == -3:
- return (0, "OK - Some remaining", perfdata)
+ return (printer_supply_some_remaining_status, "%s - Some
remaining" % (nagios_state_names[printer_supply_some_remaining_status]), perfdata)
elif leftperc <= crit:
return (2, "CRIT - %s" % infotext, perfdata)
elif leftperc <= warn:
@@ -100,5 +106,7 @@ snmp_info['printer_supply'] = ( ".1.3.6.1.2.1.43", [
'11.1.1.6',
'11.1.1.9',
'12.1.1.4' ] )
+check_config_variables.append("printer_supply_some_remaining_status")
+
snmp_scan_functions['printer_supply'] = \
lambda oid: not not oid(".1.3.6.1.2.1.43.11.1.1.6.1.1")