Module: check_mk
Branch: master
Commit: 46e1a664946d38829bc059d2ccb145fc08c45391
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=46e1a664946d38…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Jul 31 04:35:05 2012 +0200
Added check for Cisco CPU
---
checks/cisco_cpu | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/checks/cisco_cpu b/checks/cisco_cpu
new file mode 100644
index 0000000..6de3d74
--- /dev/null
+++ b/checks/cisco_cpu
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 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_cpu_default_levels = (80.0, 90.0)
+
+def check_cisco_cpu(item, params, info):
+ util = float(info[0][0])
+ infotext = " - %2.1f%% utilization in last 5minutes" % util
+ warn, crit = params
+ perfdata = [("util", util, warn, crit, 0, 100)]
+ if util >= crit:
+ return (2, "CRIT" + infotext + " (critical at %d%%)" % crit,
perfdata)
+ elif util >= warn:
+ return (1, "WARN" + infotext + " (warning at %d%%)" % warn,
perfdata)
+ else:
+ return (0, "OK" + infotext, perfdata)
+
+check_info["cisco_cpu"] = {
+ "check_function" : check_cisco_cpu,
+ "inventory_function" : lambda info: [(None,
"cisco_cpu_default_levels")],
+ "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", [ 1 ]),
+}
+