Module: check_mk
Branch: master
Commit: 95685c15ec475016d2761741ec2357f1abd258b3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=95685c15ec4750…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Feb 25 15:17:36 2011 +0100
h3c_lanswitch_cpu: add PNP graph and RRA cfg
---
README.writing_checks | 19 +++++++---
checkman/.f12 | 2 +-
checks/h3c_lanswitch_cpu | 2 +-
pnp-rraconf/check_mk-h3c_lanswitch_cpu.rra.cfg | 1 +
pnp-templates/check_mk-h3c_lanswitch_cpu.php | 44 ++++++++++++++++++++++++
5 files changed, 60 insertions(+), 8 deletions(-)
diff --git a/README.writing_checks b/README.writing_checks
index 6620511..0e22d34 100644
--- a/README.writing_checks
+++ b/README.writing_checks
@@ -12,12 +12,15 @@ Naming
Product specific checks must be prefixed with a product abbreviation, for
example "steelhead_status" for a Steelhead appliance of Riverbed.
-
* SNMP based checks: if the check makes use of a standardized MIB which
is or might be implemented by more than one vendor, then the check should
not be named after the vendor but after the MIB. An example are the
hr_* checks.
+* The service description of different check types that essentially
+ do the same must be identical (e.g. if/if64/ifoperstatus). Reason:
+ this makes rules in main.mk simpler for the user!
+
Coding style
@@ -52,10 +55,6 @@ Coding style
not hold for variables, that are used by several checks
(e.g. filesystem_levels is used by df, hr_fs, df_netapp, ...)
-* The service description of different check types that essentially
- do the same must be identical (e.g. if/if64/ifoperstatus). Reason:
- this makes rules in main.mk simpler for the user!
-
* If a check does not use check parameter, then the inventory function
must return None as parameter and the check function must name
the parameter argument _no_params.
@@ -125,7 +124,15 @@ Performance data:
* Only set perfdata flag when the check really produces performance data
output.
-* All performance data checks need to provide a pnp template
+* Each check that outputs performance data *must* have a dedicated PNP
+ graph definition in pnp-templates. If the check has warning and critical
+ levels then the graph must display those levels as yellow and red
+ lines.
+
+* Each check that outputs performance data must also have an RRA definition
+ the specifies which of MAX, MIN and AVERAGE is needed to display the
+ graph in its current (and maybe future) forms. Those are in pnp-rraconf.
+ Use a symlink here.
* pnp rra configuration
diff --git a/checkman/.f12 b/checkman/.f12
index 8bbbb7b..5a6d995 100644
--- a/checkman/.f12
+++ b/checkman/.f12
@@ -1 +1 @@
-cp * /usr/share/doc/check_mk/checks/
+sudo cp * /omd/versions/default/share/doc/check_mk/checks/
diff --git a/checks/h3c_lanswitch_cpu b/checks/h3c_lanswitch_cpu
index fdadc26..b720a22 100644
--- a/checks/h3c_lanswitch_cpu
+++ b/checks/h3c_lanswitch_cpu
@@ -86,7 +86,7 @@ def check_h3c_lanswitch_cpu(item, params, info):
-check_info["h3c_lanswitch_cpu"] = (check_h3c_lanswitch_cpu, "CPU Load
%s", 1, inventory_h3c_lanswitch_cpu )
+check_info["h3c_lanswitch_cpu"] = (check_h3c_lanswitch_cpu, "CPU
Utilization %s", 1, inventory_h3c_lanswitch_cpu )
snmp_info["h3c_lanswitch_cpu"] = \
( "1.3.6.1.4.1.43.45.1.6.1.1.1", [
diff --git a/pnp-rraconf/check_mk-h3c_lanswitch_cpu.rra.cfg
b/pnp-rraconf/check_mk-h3c_lanswitch_cpu.rra.cfg
new file mode 120000
index 0000000..19dbf77
--- /dev/null
+++ b/pnp-rraconf/check_mk-h3c_lanswitch_cpu.rra.cfg
@@ -0,0 +1 @@
+max.rra.cfg
\ No newline at end of file
diff --git a/pnp-templates/check_mk-h3c_lanswitch_cpu.php
b/pnp-templates/check_mk-h3c_lanswitch_cpu.php
new file mode 100644
index 0000000..a6e2dd0
--- /dev/null
+++ b/pnp-templates/check_mk-h3c_lanswitch_cpu.php
@@ -0,0 +1,44 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | 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.
+
+$desc = str_replace("_", " ", $servicedesc);
+
+$opt[1] = "--vertical-label 'CPU utilization %' -l0 -u 100 --title
\"CPU Utilization $hostname $desc\" ";
+#
+$def[1] = "DEF:util=$RRDFILE[1]:$DS[1]:MAX ".
+ "CDEF:ok=util,$WARN[1],MIN ".
+ "CDEF:warn=util,$CRIT[1],MIN ".
+ "AREA:util#c0f020 ".
+ "AREA:warn#90f020 ".
+ "AREA:ok#60f020:\"Utilization\:\" ".
+ "LINE:util#40a018 ".
+ "GPRINT:util:LAST:\"%.0lf%%,\" ".
+ "GPRINT:util:MIN:\"min\: %.0lf%%,\" ".
+ "GPRINT:util:MAX:\"max\: %.0lf%%\" ".
+ "HRULE:$WARN[1]#ffe000:\"Warning at $WARN[1]%\" ".
+ "HRULE:$CRIT[1]#ff0000:\"Critical at $CRIT[1]%\\n\" ".
+ "";
+
+?>