Module: check_mk
Branch: master
Commit: 14a7744df4bce1c75a1e04eea4645b345406779a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=14a7744df4bce1…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Fri Jun 24 17:48:43 2011 +0200
bluecoat_diskcpu: add scan function
postfix_mailq: remove oum as we supply a template that doesnt need it
postfix_mailq.php: above pnp template
nvidia.temp: linked to ipmi temperature template
various indentation fixes
---
checks/bluecoat_diskcpu | 3 ++
checks/f5_bigip_temp | 4 +-
checks/mcdata_fcport | 4 +-
checks/postfix_mailq | 4 +-
pnp-rraconf/check_mk-nvidia.temp.rra.cfg | 1 +
pnp-templates/check_mk-nvidia.temp.php | 1 +
pnp-templates/check_mk-postfix_mailq.php | 53 ++++++++++++++++++++++++++++++
7 files changed, 64 insertions(+), 6 deletions(-)
diff --git a/checks/bluecoat_diskcpu b/checks/bluecoat_diskcpu
index 6b0e074..a4893d6 100644
--- a/checks/bluecoat_diskcpu
+++ b/checks/bluecoat_diskcpu
@@ -48,3 +48,6 @@ check_info['bluecoat_diskcpu'] = (
snmp_info['bluecoat_diskcpu'] = (
".1.3.6.1.4.1.3417.2.4.1.1.1",
[ 3, 4, 6 ]) # BLUECOAT disk und CPU-Tabelle
+
+snmp_scan_functions["bluecoat_sensors"] = \
+ lambda oid: '1.3.6.1.4.1.3417.1.1' in oid(".1.3.6.1.2.1.1.2.0")
diff --git a/checks/f5_bigip_temp b/checks/f5_bigip_temp
index c1c98f0..91ef6d1 100644
--- a/checks/f5_bigip_temp
+++ b/checks/f5_bigip_temp
@@ -76,7 +76,7 @@ def check_f5_bigip_temp(item, params, info):
warn = nom_temp + 9
crit = nom_temp + 18
msgtxt = " - Temperature is %dC, Levels at %d/%d" % (cur_temp,
warn, crit)
- perfdata = [ ("temp", cur_temp, warn, crit) ]
+ perfdata = [("temp", cur_temp, warn, crit)]
if warn >= cur_temp:
return (0, "OK" + msgtxt, perfdata)
elif crit <= cur_temp:
@@ -96,7 +96,7 @@ snmp_info["f5_bigip_temp"] = \
( ".1.3.6.1.4.1.3375.2.1.3.1.2.1", [ 1, 2 ]), ]
-check_info["f5_bigip_temp"] = (check_f5_bigip_temp, "TEMP %s", 1,
inventory_f5_bigip_temp )
+check_info["f5_bigip_temp"] = (check_f5_bigip_temp, "TEMP %s", 1,
inventory_f5_bigip_temp)
# Get ID and Speed from the CPU and chassis fan tables
diff --git a/checks/mcdata_fcport b/checks/mcdata_fcport
index 2dff73b..e035136 100644
--- a/checks/mcdata_fcport
+++ b/checks/mcdata_fcport
@@ -28,7 +28,7 @@ mcdata_fcport_speedbits = { "2": '1000000000',
"3": '2000000000' }
mcdata_fcport_opstatus = { "1" : "1", "2": "2",
"3": "testing", "4": "faulty" }
def mcdata_bin_to_64(bin, mult = 1):
- # McData encodes 64 bit counters as big endian HEX strings,
+ # McData encodes 64 bit counters as big endian HEX strings,
# e.g. Hex-STRING: 00 00 00 01 AC C2 8C EE. Check_MK converts
# such strings into binary Python strings
value = 0
@@ -70,7 +70,7 @@ def mcdata_fcport_convert_line_to_if64(line):
'0', # ifOutQLen 17
index, # ifAlias 18
]
-
+
def inventory_mcdata_fcport(checkname, info):
return inventory_if_common(mcdata_fcport_convert_to_if64(info))
diff --git a/checks/postfix_mailq b/checks/postfix_mailq
index f5c410e..c1021f9 100644
--- a/checks/postfix_mailq
+++ b/checks/postfix_mailq
@@ -72,12 +72,12 @@ def check_postfix_mailq(item, params, info):
for line in info:
if " ".join(line[-2:]) == 'is empty':
return (0, 'OK - The mailqueue is empty ', [ ('length', 0,
params[0], params[1]),
- ('size', '0b')
])
+ ('size', '0')
])
elif line[0] == '--':
size = postfix_mailq_to_bytes(float(line[1]), line[2])
len = int(line[4])
perfdata = [ ('length', len, params[0], params[1]),
- ('size', '%db' % size) ]
+ ('size', '%d' % size) ]
if len > params[1]:
return (2, 'CRITICAL - Mailqueue length is %d '
diff --git a/pnp-rraconf/check_mk-nvidia.temp.rra.cfg
b/pnp-rraconf/check_mk-nvidia.temp.rra.cfg
new file mode 120000
index 0000000..19dbf77
--- /dev/null
+++ b/pnp-rraconf/check_mk-nvidia.temp.rra.cfg
@@ -0,0 +1 @@
+max.rra.cfg
\ No newline at end of file
diff --git a/pnp-templates/check_mk-nvidia.temp.php
b/pnp-templates/check_mk-nvidia.temp.php
new file mode 120000
index 0000000..6f57a09
--- /dev/null
+++ b/pnp-templates/check_mk-nvidia.temp.php
@@ -0,0 +1 @@
+check_mk-ipmi_sensors.php
\ No newline at end of file
diff --git a/pnp-templates/check_mk-postfix_mailq.php
b/pnp-templates/check_mk-postfix_mailq.php
new file mode 100644
index 0000000..33837c1
--- /dev/null
+++ b/pnp-templates/check_mk-postfix_mailq.php
@@ -0,0 +1,53 @@
+<?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.
+
+# (length=22;10;20;; size=2048;;;;)
+$opt[1] = "--vertical-label Mails -l0 --title \"Mail Queue Length\"
";
+$def[1] = "DEF:length=$RRDFILE[1]:$DS[1]:MAX " ;
+$def[1] .= "HRULE:$WARN[1]#FFFF00 ";
+$def[1] .= "HRULE:$CRIT[1]#FF0000 ";
+$def[1] .= "AREA:length#6890a0:\"Mails\" " ;
+$def[1] .= "LINE:length#2060a0 " ;
+$def[1] .= "GPRINT:length:LAST:\"%6.2lf last\" " ;
+$def[1] .= "GPRINT:length:AVERAGE:\"%6.2lf avg\" " ;
+$def[1] .= "GPRINT:length:MAX:\"%6.2lf max\\n\" ";
+
+
+$opt[2] = "--vertical-label MBytes -b1024 -X6 -l0 --title \"Mail Queue
Size\" ";
+$def[2] = "DEF:size=$RRDFILE[2]:$DS[2]:MAX " ;
+$def[2] .= "CDEF:queue_mb=size,1048576,/ ";
+$def[2] .= "AREA:queue_mb#65ab0e:\"Megabytes\" ";
+$def[2] .= "LINE:queue_mb#206a0e ";
+$def[2] .= "GPRINT:queue_mb:MAX:\"%6.2lf MB max\\n\" ";
+
+# geht nicht.
+#$def[2] .= "DEF:size_avg=$RRDFILE[2]:$DS[2]:AVG " ;
+#$def[2] .= "DEF:size_last=$RRDFILE[2]:$DS[2]:LAST " ;
+#$def[2] .= "CDEF:queue_mb_avg=size_avg,1048576,/ ";
+#$def[2] .= "CDEF:queue_mb_last=size_last,1048576,/ ";
+#$def[2] .= "GPRINT:queue_mb:LAST:\"%6.2lf MB last\" ";
+#$def[2] .= "GPRINT:queue_mb:AVERAGE:\"%6.2lf MB avg\" ";
+
+?>