/usr/share/check_mk/checks/blade_blowers is in check-mk-server 1.1.12-1ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
# | | |___| | | | __/ (__| < | | | | . \ |
# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
# | |
# | Copyright Mathias Kettner 2010 mk@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.
# The BLADE-MIB is somewhat goofy redarding the blower
# information. The blowers are listed sequentially
# below the same subtrees:
# BLADE-MIB::blower1speed.0 = STRING: "50% of maximum"
# BLADE-MIB::blower2speed.0 = STRING: "50% of maximum"
# BLADE-MIB::blower1State.0 = INTEGER: good(1)
# BLADE-MIB::blower2State.0 = INTEGER: good(1)
# BLADE-MIB::blowers.20.0 = STRING: "1712"
# BLADE-MIB::blowers.21.0 = STRING: "1696"
# BLADE-MIB::blowers.30.0 = INTEGER: 0
# BLADE-MIB::blowers.31.0 = INTEGER: 0
#
# The same with -On:
# .1.3.6.1.4.1.2.3.51.2.2.3.1.0 = STRING: "49% of maximum"
# .1.3.6.1.4.1.2.3.51.2.2.3.2.0 = STRING: "No Blower"
# .1.3.6.1.4.1.2.3.51.2.2.3.10.0 = INTEGER: good(1)
# .1.3.6.1.4.1.2.3.51.2.2.3.11.0 = INTEGER: unknown(0)
# .1.3.6.1.4.1.2.3.51.2.2.3.20.0 = STRING: "1696"
# .1.3.6.1.4.1.2.3.51.2.2.3.21.0 = STRING: "No Blower"
# .1.3.6.1.4.1.2.3.51.2.2.3.30.0 = INTEGER: 0
# .1.3.6.1.4.1.2.3.51.2.2.3.31.0 = INTEGER: 2
#
# How can we safely determine the number of blowers without
# assuming that each blower has four entries?
# We assume that all blowers are in state OK (used for
# inventory only)
def number_of_blowers(info):
n = 0
while len(info) > n and len(info[n][0]) > 1: # state lines
n += 1
return n
def inventory_blade_blowers(info):
inventory = []
n = number_of_blowers(info)
for i in range(0, n):
if info[i + n][0] != "0": # skip unknown blowers
inventory.append( ("%d/%d" % (i+1,n), None, None) )
return inventory
def check_blade_blowers(item, _no_params, info):
blower, num_blowers = map(int, item.split("/"))
text = info[blower-1][0]
perfdata = []
output = ''
state = info[blower-1 + num_blowers][0]
try:
rpm = int(info[blower-1 + 2*num_blowers][0])
perfdata += [("rpm", rpm)]
output += 'Speed at %d RMP' % rpm
except:
pass
try:
perc = int(text.split("%")[0])
perfdata += [("perc", perc, None, None, 0, 100)]
if output == '':
output += 'Speed is at %d%% of max' % perc
else:
output += ' (%d%% of max)' % perc
except:
pass
if state == "1":
return (0, "OK - " + output, perfdata)
else:
return (2, "CRIT - " + output, perfdata)
check_info['blade_blowers'] = ( check_blade_blowers, "Blower %s", 1, inventory_blade_blowers)
snmp_info['blade_blowers'] = ( ".1.3.6.1.4.1.2.3.51.2.2", [3] )
snmp_scan_functions['blade_blowers'] = \
lambda oid: re.match('BladeCenter( Advanced)* Management Module', oid(".1.3.6.1.2.1.1.1.0"))
|