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)