Module: check_mk
Branch: master
Commit: aa0567e515a57646175348bacaccd50918278e50
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aa0567e515a576…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 21 08:22:44 2011 +0100
canon_pages: Added new check for monitoring processed pages on canon printer/multi-function devices
---
checkman/canon_pages | 18 ++++++++++++
checks/canon_pages | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 89 insertions(+), 0 deletions(-)
diff --git a/checkman/canon_pages b/checkman/canon_pages
new file mode 100644
index 0000000..103b4b7
--- /dev/null
+++ b/checkman/canon_pages
@@ -0,0 +1,18 @@
+title: Monitors printed/scanned pages in canon printers
+agents: snmp
+author: Lars Michelsen <lm(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check reads the number of printed pages separated by paper format and
+ colored or black/white print jobs. If supported by the device the check also
+ monitors the number of scanned pages.
+
+ This check can be used with all printer supporting the {CANON-MIB}
+ (.1.3.6.1.4.1.1602.1.11).
+
+perfdata:
+ The number of processed pages. The label is {count} for all services.
+
+inventory:
+ One service is being created for each measure point
diff --git a/checks/canon_pages b/checks/canon_pages
new file mode 100644
index 0000000..48d2cec
--- /dev/null
+++ b/checks/canon_pages
@@ -0,0 +1,71 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2010 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# Author: Lars Michelsen <lm(a)mathias-kettner.de>, 2011-03-16
+
+# [[['301', '28495']], [['112', '24']], [['113', '14880']], [['122', '146']], [['123', '15870']], [['501', '3761']], [['101', '30920']]]
+
+canon_pages_map = {
+ '101': 'total',
+ '112': 'b/w A3',
+ '113': 'b/w A4',
+ '122': 'color A3',
+ '123': 'color A4',
+ '301': 'print total',
+ '501': 'scan',
+}
+
+def inventory_canon_pages(checkname, info):
+ inventory = []
+ for data in info:
+ if data:
+ inventory.append((canon_pages_map.get(data[0][0],
+ 'unknown-%s' % data[0][0]), None))
+ return inventory
+
+def check_canon_pages(item, params, info):
+ for data in info:
+ if not data or not data[0]:
+ continue
+ index, value = data[0]
+ if canon_pages_map.get(index, 'unknown-'+index) == item:
+ return (0, 'OK - Current count: %s' % value, [('count', value)])
+
+ return (3, 'UNKNOWN - Item not found in SNMP')
+
+check_info['canon_pages'] = (check_canon_pages, "Pages %s", 1, inventory_canon_pages)
+
+snmp_info['canon_pages'] = [
+ ( ".1.3.6.1.4.1.1602.1.11.1.3.1.4", [ OID_END, 101 ]), # count total
+ ( ".1.3.6.1.4.1.1602.1.11.1.3.1.4", [ OID_END, 112 ]), # count b/w A3
+ ( ".1.3.6.1.4.1.1602.1.11.1.3.1.4", [ OID_END, 113 ]), # count b/w A4
+ ( ".1.3.6.1.4.1.1602.1.11.1.3.1.4", [ OID_END, 122 ]), # count color A3
+ ( ".1.3.6.1.4.1.1602.1.11.1.3.1.4", [ OID_END, 123 ]), # count color A4
+ ( ".1.3.6.1.4.1.1602.1.11.1.3.1.4", [ OID_END, 301 ]), # print total
+ ( ".1.3.6.1.4.1.1602.1.11.1.3.1.4", [ OID_END, 501 ]), # scan
+]
+
+snmp_scan_functions['canon_pages'] = lambda oid: oid("1.3.6.1.4.1.1602.1.1.1.1.0") != None
Module: check_mk
Branch: master
Commit: 9312f00329e3a7d492c6765b85227b7af20c91ae
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9312f00329e3a7…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Mar 21 11:44:47 2011 +0100
FIX: Fixed typo in if-manpages
---
checkman/hpux_if | 2 +-
checkman/if | 2 +-
checkman/if64 | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/checkman/hpux_if b/checkman/hpux_if
index 17711ab..d37b868 100644
--- a/checkman/hpux_if
+++ b/checkman/hpux_if
@@ -15,7 +15,7 @@ description:
Depending on the check paramters this check can go WARN or CRIT when the
port status changes (i.e. is down), when the link speed changes (e.g. a
- port expected to be set to 1GBit/s operates only at 1000MBit/s), when the
+ port expected to be set to 1GBit/s operates only at 100MBit/s), when the
absolute or procentual traffic of a port exceeds certain levels or if the
rate of errors or discards exceeds configurable limits.
diff --git a/checkman/if b/checkman/if
index 3d133c7..1a78088 100644
--- a/checkman/if
+++ b/checkman/if
@@ -12,7 +12,7 @@ description:
Depending on the check paramters this check can go WARN or CRIT when the
port status changes (i.e. is down), when the link speed changes (e.g. a
- port expected to be set to 1GBit/s operates only at 1000MBit/s), when the
+ port expected to be set to 1GBit/s operates only at 100MBit/s), when the
absolute or procentual traffic of a port exceeds certain levels or if the
rate of errors or discards exceeds configurable limits.
diff --git a/checkman/if64 b/checkman/if64
index 2c298ec..0491e58 100644
--- a/checkman/if64
+++ b/checkman/if64
@@ -17,7 +17,7 @@ description:
Depending on the check paramters this check can go WARN or CRIT when the
port status changes (i.e. is down), when the link speed changes (e.g. a
- port expected to be set to 1GBit/s operates only at 1000MBit/s), when the
+ port expected to be set to 1GBit/s operates only at 100MBit/s), when the
absolute or procentual traffic of a port exceeds certain levels or if the
rate of errors or discards exceeds configurable limits.
Module: check_mk
Branch: master
Commit: b42fa817e2f2642e9c949ffda39d1e55f89ee83c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b42fa817e2f264…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 17 11:31:23 2011 +0100
printer_alerts: Added new check
The check is used or monitoring alert states reported by
printers using the PRINTER-MIB.
---
checkman/printer_alerts | 31 +++++++++++++
checks/printer_alerts | 112 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 143 insertions(+), 0 deletions(-)
diff --git a/checkman/printer_alerts b/checkman/printer_alerts
new file mode 100644
index 0000000..85ab277
--- /dev/null
+++ b/checkman/printer_alerts
@@ -0,0 +1,31 @@
+title: Lists alerts reported by printers
+agents: snmp
+author: Lars Michelsen <lm(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the alerts reported by a printer supporting the
+ {PRINTER-MIB}. The check generates one service per device and lists
+ all known errors in the service output.
+
+inventory:
+ One check is being created for each device.
+
+examples:
+ # This is the default (hard coded) definition of the
+ # state code handling.
+ # -> All state codes listed after "2:" result in a CRITICAL state
+ # -> All state codes listed after "1:" result in a WARNING state
+ # -> All state codes listed after "0:" result in a OK state
+ printer_alerts_state_map = {
+ 2: [ 8, 1101, 1102, 1112, 1114, 1115 ],
+ 1: [ ],
+ 0: [ 4, 6, 7, 19, 20, 23, 24, 25, 27, 35, 36, 37, 38, 502, 503, 504, 505, 506, 507, 802, 803, 804, 805, 806, 807, 808, 809, 810, 1001, 1002, 1005, 1106, 1107, 1108, 1111, 1113, 1302, 1304, 1501, 1502, 1503, 1504, 1505, 1506, 1509 ],
+ }
+
+[configuration]
+printer_alerts_state_map(dict): Can be used to configure state codes
+ reported by the printer to result in individual nagios states. This
+ dictionary contains three elements. One for each nagios state. Each
+ element holds a list of state codes to result in this state.
+ Take a look at the example section to see the defaults.
diff --git a/checks/printer_alerts b/checks/printer_alerts
new file mode 100644
index 0000000..5982924
--- /dev/null
+++ b/checks/printer_alerts
@@ -0,0 +1,112 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2010 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# Author: Lars Michelsen <lm(a)mathias-kettner.de>, 2011-03-16
+
+# Example output for this case:
+#
+# 1.3.6.1.2.1.43.18.1.1.2.1.1 4
+# 1.3.6.1.2.1.43.18.1.1.4.1.1 11
+# 1.3.6.1.2.1.43.18.1.1.5.1.1 -1
+# 1.3.6.1.2.1.43.18.1.1.7.1.1 1107
+# 1.3.6.1.2.1.43.18.1.1.8.1.1 "The waste toner container is full soon."
+#
+# [['4', '11', '-1', '1107', 'The waste toner container is full soon.']]
+
+printer_alerts_group_map = {
+ '1': 'other',
+ '3': 'hostResourcesMIBStorageTable',
+ '4': 'hostResourcesMIBDeviceTable',
+ '5': 'generalPrinter',
+ '6': 'cover',
+ '7': 'localization',
+ '8': 'input',
+ '9': 'output',
+ '10': 'marker',
+ '11': 'markerSupplies',
+ '12': 'markerColorant',
+ '13': 'mediaPath',
+ '14': 'channel',
+ '15': 'interpreter',
+ '16': 'consoleDisplayBuffer',
+ '17': 'consoleLights',
+ '18': 'alert',
+ '30': 'finDevice',
+ '31': 'finSypply',
+ '32': 'finSupplyMediaInput',
+ '33': 'finAttributeTable',
+}
+
+printer_alerts_state_map = {
+ 2: [ 8, 1101, 1102, 1112, 1114, 1115 ],
+ 1: [ ],
+ 0: [ 4, 6, 7, 19, 20, 23, 24, 25, 27, 35, 36, 37, 38, 502, 503, 504, 505, 506, 507, 802, 803, 804, 805, 806, 807, 808, 809, 810, 1001, 1002, 1005, 1106, 1107, 1108, 1111, 1113, 1302, 1304, 1501, 1502, 1503, 1504, 1505, 1506, 1509 ],
+}
+
+def inventory_printer_alerts(checkname, info):
+ return [ (None, None) ]
+
+def check_printer_alerts(_not_used, _not_used1, info):
+ if not info:
+ return (0, 'OK - No alerts present')
+
+ sum_state = 0
+ sum_txt = []
+ for alert in info:
+ sev, group, group_index, code, desc = alert
+
+ state = 3
+ for s in [ 2, 1, 0 ]:
+ if saveint(sev) in printer_alerts_state_map[s]:
+ state = s
+ break
+
+ group_txt = printer_alerts_group_map.get(group, 'UNKNOWN')
+ if group_index != '-1':
+ group_txt += ' #%s' % group_index
+
+ if state > sum_state:
+ sum_state = state
+
+ sum_txt.append('%s - %s - %s (%s)' % (nagios_state_names[state],
+ group_txt, desc, code))
+
+ return (sum_state, ', '.join(sum_txt))
+
+check_info['printer_alerts'] = (check_printer_alerts, "Alerts", 0, inventory_printer_alerts)
+
+snmp_info['printer_alerts'] = ( ".1.3.6.1.2.1.43.18.1.1", [
+ '2', #prtAlertSeverityLevel
+ '4', #prtAlertGroup
+ '5', #prtAlertGroupIndex
+ '7', #prtAlertCode
+ '8', #prtAlertDescription
+ ] )
+
+check_config_variables.append("printer_alerts_state_map")
+
+snmp_scan_functions['printer_alerts'] = \
+ lambda oid: oid(".1.3.6.1.2.1.43.11.1.1.6.1.1") != None
Module: check_mk
Branch: master
Commit: 99ef4b41dfdb3702a561af06e8262b8257d3a499
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=99ef4b41dfdb37…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 17 11:31:15 2011 +0100
Updated bug entries
---
.bugs/180 | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/.bugs/180 b/.bugs/180
index 7c5827b..784e9ac 100644
--- a/.bugs/180
+++ b/.bugs/180
@@ -14,5 +14,7 @@ the template 'check_mk_perf'. The use line should look like this:
use check_mk_perf,check_mk_default
+Plus the process_perfdata 0 line need to be removed.
+
In fact the data is gathered in the host check but the missing link seems
to confuse the users since the check generates performance data.
Module: check_mk
Branch: master
Commit: f38f9dafbe1f32fb67a9ae3df828f619210f2583
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f38f9dafbe1f32…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 17 11:31:51 2011 +0100
Updated changelog
---
ChangeLog | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cfe6bfc..e104851 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,8 @@
with index 1
* df: split PNP graphs for growth/trend into two graphs
* omd_status: new check for checking status of OMD sites
+ * printer_alerts: Added new check for monitoring alert states reported by
+ printers using the PRINTER-MIB
1.1.10:
Module: check_mk
Branch: master
Commit: 0c4bcaeea3cc6d1e6ca7ab2ffeed9fa339a4a0ba
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0c4bcaeea3cc6d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 17 11:57:04 2011 +0100
Updated bug entries
---
.bugs/181 | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/.bugs/181 b/.bugs/181
new file mode 100644
index 0000000..ace4d98
--- /dev/null
+++ b/.bugs/181
@@ -0,0 +1,9 @@
+Title: Check_MK Dienst zeigt "Agent version (unknown)" bei nur SNMP hosts
+Component: core
+Benefit: 1
+State: open
+Cost: 2
+Date: 2011-03-17 11:55:38
+Class: cleanup
+
+Das ist letztlich nur ein Schönheitsfehler. Man sollte den String bei reinen SNMP Checks einfach komplett rausnehmen. Oder vielleicht die SNMP Version dort anzeigen - das (unknown) ist eher verwirrend.