Module: check_mk
Branch: master
Commit: b74a6bb70e3f3146e8e536580f84409dcf9b2163
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b74a6bb70e3f31…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Nov 4 16:42:38 2013 +0100
cisco_cpu: check now recognizes new object cpmCPUTotal5minRev
Cisco has depreceated the object named cpmCPUTotal5min by cpmCPUTotal5minRev.
Both objects are now recognized by the check, with priority to cpmCPUTotal5minRev.
---
.werks/61 | 2 +-
ChangeLog | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.werks/61 b/.werks/61
index 7814310..45950e5 100644
--- a/.werks/61
+++ b/.werks/61
@@ -1,4 +1,4 @@
-Title: cisco cpu check now recognizes new object cpmCPUTotal5minRev
+Title: cisco_cpu: check now recognizes new object cpmCPUTotal5minRev
Level: 1
Component: checks
Version: 1.2.3i7
diff --git a/ChangeLog b/ChangeLog
index e2dd514..9692f40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
1.2.3i7:
Checks & Agents:
* 0060 : cisco_fantray: new check for monitoring fan trays of Cisco Nexus switches...
- * 0061 : cisco cpu check now recognizes new object cpmCPUTotal5minRev...
+ * 0061 : cisco_cpu: check now recognizes new object cpmCPUTotal5minRev...
Multisite:
* 0001 : New filters for selecting several host/service-groups at once...
Module: check_mk
Branch: master
Commit: 6d53caf97e3f48eabf51acabc121c2047f84177a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d53caf97e3f48…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Nov 4 12:36:23 2013 +0100
cisco cpu check now recognizes new object cpmCPUTotal5minRev
Cisco has depreceated the object named cpmCPUTotal5min by cpmCPUTotal5minRev.
Both objects are now recognized by the check, with priority to cpmCPUTotal5minRev.
---
.werks/61 | 9 +++++++++
ChangeLog | 1 +
checkman/cisco_cpu | 9 +++++++++
checks/cisco_cpu | 13 ++++++++++---
4 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/.werks/61 b/.werks/61
new file mode 100644
index 0000000..7814310
--- /dev/null
+++ b/.werks/61
@@ -0,0 +1,9 @@
+Title: cisco cpu check now recognizes new object cpmCPUTotal5minRev
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1383564852
+Class: feature
+
+Cisco has depreceated the object named cpmCPUTotal5min by cpmCPUTotal5minRev.
+Both objects are now recognized by the check, with priority to cpmCPUTotal5minRev.
diff --git a/ChangeLog b/ChangeLog
index b0f390e..a61458f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.2.3i7:
Checks & Agents:
* 0060 : check to monitor fan trays of cisco nexus switches...
+ * 0061 : cisco cpu check now recognizes new object cpmCPUTotal5minRev...
Multisite:
* 0001 : New filters for selecting several host/service-groups at once...
diff --git a/checkman/cisco_cpu b/checkman/cisco_cpu
index da950ee..82c5431 100644
--- a/checkman/cisco_cpu
+++ b/checkman/cisco_cpu
@@ -5,6 +5,15 @@ license: GPL
distribution: check_mk
description:
Check CPU utilization of the last 5 minutes in percent on Cisco devices.
+ This check tests for two oids out of {cpmCPUTotalEntry}:
+
+ {.1.3.6.1.4.1.9.9.109.1.1.1.1.5.1 = cpmCPUTotal5min}
+
+ {.1.3.6.1.4.1.9.9.109.1.1.1.1.8.1 = cpmCPUTotal5minRev}
+
+ The latter is depreceated by cisco and will only be used if {cpmCPUTotal5minRev}
+ is unavailable.
+
perfdata:
Just one value: The CPU utilization of the last 5 minutes in percent.
diff --git a/checks/cisco_cpu b/checks/cisco_cpu
index d1343f3..e156dd7 100644
--- a/checks/cisco_cpu
+++ b/checks/cisco_cpu
@@ -24,10 +24,16 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+# oid(".1.3.6.1.4.1.9.9.109.1.1.1.1.5.1") is depreceated by
+# oid(".1.3.6.1.4.1.9.9.109.1.1.1.1.8.1"), we recognize both for now
+
cisco_cpu_default_levels = (80.0, 90.0)
def check_cisco_cpu(item, params, info):
- util = float(info[0][0])
+ if info[0][1]:
+ util = float(info[0][1])
+ else:
+ util = float(info[0][0])
infotext = "%2.1f%% utilization in the last 5 minutes" % util
warn, crit = params
perfdata = [("util", util, warn, crit, 0, 100)]
@@ -44,7 +50,8 @@ check_info["cisco_cpu"] = {
"service_description" : "CPU utilization",
"has_perfdata" : True,
"group" : "cpu_utilization",
- "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.9.9.109.1.1.1.1.5.1"),
- "snmp_info" : ( ".1.3.6.1.4.1.9.9.109.1.1.1.1", [ 5 ]),
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.9.9.109.1.1.1.1.8.1") \
+ or oid(".1.3.6.1.4.1.9.9.109.1.1.1.1.5.1"),
+ "snmp_info" : ( ".1.3.6.1.4.1.9.9.109.1.1.1.1", [ 5, 8 ]),
}
Module: check_mk
Branch: master
Commit: e5bc3432a6d9fb0fca697be43f32fced7461ae31
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e5bc3432a6d9fb…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Nov 4 11:53:45 2013 +0100
usage updated for werk
---
werk | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/werk b/werk
index cfb8db0..3b9c9d2 100755
--- a/werk
+++ b/werk
@@ -260,7 +260,7 @@ def add_comment(werk, title, comment):
def usage():
- sys.stdout.write("""Usage: gb COMMAND [ARGS...]
+ sys.stdout.write("""Usage: werk COMMAND [ARGS...]
where COMMAND is one of:
@@ -274,7 +274,6 @@ where COMMAND is one of:
grep [-v] KW1 KW2... - show werks containing all of the given keywords (-v: verbose)
edit [#] - open werk # in editor (or newest werk)
blame [#] - show who worked on a werk
- commit - commit all changed and new werks
""")
sys.exit(1)
Module: check_mk
Branch: master
Commit: 7248f70728aeb59595538ce8fae1c9743100d697
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7248f70728aeb5…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Nov 4 11:51:39 2013 +0100
check to monitor fan trays of cisco nexus switches
---
checkman/cisco_fantray | 17 +++++++++++++++
checks/cisco_fantray | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 71 insertions(+)
diff --git a/checkman/cisco_fantray b/checkman/cisco_fantray
new file mode 100644
index 0000000..08e8f82
--- /dev/null
+++ b/checkman/cisco_fantray
@@ -0,0 +1,17 @@
+title: Cisco switches: FAN health status
+agents: snmp
+catalog: hw/network/cisco
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of fans on Cisco devices like the
+ nexus series of switches. The following states are returned by the
+ device: {1}: unknown, {2}: up, {3}: down, {4}: warning. They are evaluated
+ by the check as follows: {1}: WARN, {2}: OK, {3}: CRIT, {4}: WARN.
+
+item:
+ The id of the sensor as provided by the snmp agent of the device.
+
+inventory:
+ One check for each sensor is created by the inventory.
+
diff --git a/checks/cisco_fantray b/checks/cisco_fantray
new file mode 100644
index 0000000..3a5f5eb
--- /dev/null
+++ b/checks/cisco_fantray
@@ -0,0 +1,54 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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.
+
+cisco_fan_states = ('', 'unknown', 'up', 'down', 'warning')
+
+def inventory_cisco_fantray(info):
+ if info[0]:
+ return [ (line[0], None) for line in info ]
+
+def check_cisco_fantray(item, params, info):
+ for line in info:
+ if line[0] == item:
+ state = saveint(line[1])
+ status = [ "", "unknown", "up", "down", "warning" ]
+ if state == 2:
+ return (0, "State is %s (%d)" % (status[state], state))
+ elif state in ( 0, 1, 4 ):
+ return (1, "State is %s (%d)" % (status[state], state))
+ else:
+ return (2, "State is %s (%d)" % (status[state], state))
+ return (3, "item not found in snmp data")
+
+
+check_info["cisco_fantray"] = {
+ 'check_function': check_cisco_fantray,
+ 'inventory_function': inventory_cisco_fantray,
+ 'service_description': 'FAN %s',
+ 'snmp_info': ('.1.3.6.1.4.1.9.9.117.1.4.1.1.1',[ OID_END, '' ]),
+ 'snmp_scan_function': \
+ lambda oid: "cisco" in oid(".1.3.6.1.2.1.1.1.0").lower(),
+}