Module: check_mk
Branch: master
Commit: 5f5cb23cd22d40a7a16211438c533d1dec6a6487
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5f5cb23cd22d40…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Dec 19 14:08:55 2013 +0100
Remove werk 76 from changelog
---
ChangeLog | 1 -
1 file changed, 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 85c23d3..ab48683 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,7 +26,6 @@
* 0396 cmciii_access cmciii_io cmciii_psm_current cmciii_psm_plugs: Support other firmeware versions as well...
* 0111 kemp_loadmaster_ha, kemp_loadmaster_realserver, kemp_loadmaster_services: New Checks for Kemp Loadbalancer
* 0318 hitachi_hnas_fan: New check for fans in Hitachi HNAS systems
- * 0076 kemp_loadmaster_services: Check now collects performance data of number of active connections
* 0319 hitachi_hnas_psu, hitachi_hnas_psu: New checks for Hitachi HNAS storage systems
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
Module: check_mk
Branch: master
Commit: cafc9e9c864a4b0116ee5d621d38433e5632af12
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cafc9e9c864a4b…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Wed Dec 18 16:39:59 2013 +0100
hitachi_hnas_fan: New check for fans in Hitachi HNAS systems
---
.werks/318 | 8 +++
ChangeLog | 1 +
checkman/hitachi_hnas_fan | 25 +++++++
checks/hitachi_hnas_fan | 101 +++++++++++++++++++++++++++
pnp-templates/check_mk-hitachi_hnas_fan.php | 34 +++++++++
web/plugins/perfometer/check_mk.py | 6 ++
6 files changed, 175 insertions(+)
diff --git a/.werks/318 b/.werks/318
new file mode 100644
index 0000000..e138891
--- /dev/null
+++ b/.werks/318
@@ -0,0 +1,8 @@
+Title: hitachi_hnas_fan: New check for fans in Hitachi HNAS systems
+Level: 2
+Component: checks
+Version: 1.2.5i1
+Date: 1387381163
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 567a1aa..9860334 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
* 0395 cmctc.temp: also detect older CMC devices
* 0396 cmciii_access cmciii_io cmciii_psm_current cmciii_psm_plugs: Support other firmeware versions as well...
* 0111 kemp_loadmaster_ha, kemp_loadmaster_realserver, kemp_loadmaster_services: New Checks for Kemp Loadbalancer
+ * 0318 hitachi_hnas_fan: New check for fans in Hitachi HNAS systems
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/hitachi_hnas_fan b/checkman/hitachi_hnas_fan
new file mode 100644
index 0000000..3434c5e
--- /dev/null
+++ b/checkman/hitachi_hnas_fan
@@ -0,0 +1,25 @@
+title: Hitachi HNAS: Status and Speed of Fans
+agents: snmp
+catalog: hw/network/brocade
+license: GPL
+distribution: check_mk
+description:
+ Checks the fitted status and speed status of a fan in an Hitachi HNAS storage
+ system. Displays speed of the fan.
+
+ Returns {OK} if the fitted status is reported to be ok, {WARN} on status
+ okIdWrong, {CRIT} on status notFitted and {UNKN} on every other.
+
+ Returns {OK} if the speed status is reported to be ok, {WARN} on status
+ warning, {CRIT} on status severe and {UNKN} on every other.
+
+ The worst of both is the status returned by this Check.
+
+item:
+ The ID of the PNode plus the ID of the Fan, separated by a dot. E. g. 1.2
+
+perfdata:
+ One value: The speed of the fan (rpm).
+
+inventory:
+ Finds one item per fan
diff --git a/checks/hitachi_hnas_fan b/checks/hitachi_hnas_fan
new file mode 100644
index 0000000..dfe785d
--- /dev/null
+++ b/checks/hitachi_hnas_fan
@@ -0,0 +1,101 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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.
+
+def inventory_hitachi_hnas_fan(info):
+ inventory = []
+ for clusternode, id, fitted_status, speed_status, speed in info:
+ inventory.append( (clusternode + "." + id, None) )
+ return inventory
+
+def check_hitachi_hnas_fan(item, _no_params, info):
+ rc = 0
+
+ fan_fitted_status_map = ( ("", 3), # 0
+ ("ok", 0), # 1
+ ("okIdWrong", 1), # 2
+ ("notFitted", 2), # 3
+ ("unknown", 3), # 4
+ )
+
+ fan_speed_status_map = ( ("", 3), # 0
+ ("ok", 0), # 1
+ ("warning", 1), # 2
+ ("severe", 2), # 3
+ ("unknown", 3), # 4
+ )
+ errorstring = ( "", " (!)", " (!!)", "")
+
+ for clusternode, id, fitted_status, speed_status, speed in info:
+ if clusternode + "." + id == item:
+ fitted_status=int(fitted_status)
+ speed_status=int(speed_status)
+ speed=int(speed)
+ message = "PNode %s Fan %s" % (clusternode, id)
+
+ # check fitted status
+ if fitted_status == 0 or fitted_status >= len(fan_fitted_status_map):
+ message += " fitted status unidentified %s" % fitted_status
+ rc = 3
+ else:
+ message += " fitted status is %s%s" % ( fan_fitted_status_map[fitted_status][0], errorstring[fan_fitted_status_map[fitted_status][1]] )
+ rc = fan_fitted_status_map[fitted_status][1]
+
+ # check speed status
+ if speed_status == 0 or speed_status >= len(fan_speed_status_map):
+ message += ", speed status unidentified %s" % speed_status
+ if rc == 0:
+ rc = 3
+ # if rc is already warning or critical, keep it
+ else:
+ message += ", speed status is %s%s" % ( fan_speed_status_map[speed_status][0], errorstring[fan_speed_status_map[speed_status][1]] )
+ if fan_speed_status_map[speed_status][1] == 1:
+ if rc == 2:
+ rc = 2
+ else:
+ rc = 1
+ elif fan_speed_status_map[speed_status][1] == 2:
+ rc = 2
+ elif fan_speed_status_map[speed_status][1] == 3:
+ if rc == 0:
+ rc = 3
+
+ # report speed
+ message += ", speed is %s rpm" % speed
+ perfdata = [ ('fanspeed', str(speed) + 'rpm', '', '', 0, '') ]
+
+ return rc, message, perfdata
+
+ return 3, "No fan %s found" % item
+
+check_info["hitachi_hnas_fan"] = {
+ "check_function" : check_hitachi_hnas_fan,
+ "inventory_function" : inventory_hitachi_hnas_fan,
+ "service_description" : "Fan %s",
+ "has_perfdata" : True,
+ "snmp_info" : (".1.3.6.1.4.1.11096.6.1.1.1.2.1.11.1", [1, 2, 3, 4, 5]),
+ # fanClusterNode, fanIndex, fanFittedStatus, fanSpeedStatus, fanSpeed
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.11096.6"),
+}
diff --git a/pnp-templates/check_mk-hitachi_hnas_fan.php b/pnp-templates/check_mk-hitachi_hnas_fan.php
new file mode 100644
index 0000000..6feda78
--- /dev/null
+++ b/pnp-templates/check_mk-hitachi_hnas_fan.php
@@ -0,0 +1,34 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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.
+
+$opt[1] = "--vertical-label \"rpm\" --title \"$hostname / $servicedesc\" ";
+
+$def[1] = "DEF:var1=$RRDFILE[1]:$DS[1]:MAX ";
+$def[1] .= "AREA:var1#2080ff:\"Speed\:\" ";
+$def[1] .= "GPRINT:var1:LAST:\"%2.0lf rpm\" ";
+$def[1] .= "LINE1:var1#000080:\"\" ";
+$def[1] .= "GPRINT:var1:MAX:\"(Max\: %2.0lf rpm,\" ";
+$def[1] .= "GPRINT:var1:AVERAGE:\"Avg\: %2.0lf rpm)\" ";
+?>
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index dca0387..baa43c4 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -760,3 +760,9 @@ def perfometer_fanspeed(row, check_command, perf_data):
return "%.2f%%" % value, perfometer_linear(value, "silver")
perfometers["check_mk-apc_inrow_fanspeed"] = perfometer_fanspeed
+
+def perfometer_fanspeed_logarithmic(row, check_command, perf_data):
+ value = float(perf_data[0][1])
+ return "%d rpm" % value, perfometer_logarithmic(value, 5000, 2, "silver")
+
+perfometers["check_mk-hitachi_hnas_fan"] = perfometer_fanspeed_logarithmic
Module: check_mk
Branch: master
Commit: 3ca0536afe587cc71b113d7beaa489aca7b1dad1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3ca0536afe587c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 18 16:25:58 2013 +0100
check-spaces / healspaces now handles windows newlins correctly
---
Makefile | 4 +-
checks/moxa_iologik_register | 144 +++++++++++++++++++++---------------------
2 files changed, 74 insertions(+), 74 deletions(-)
diff --git a/Makefile b/Makefile
index 7a810ae..4ac633a 100644
--- a/Makefile
+++ b/Makefile
@@ -59,7 +59,7 @@ check-spaces:
@if grep -q '[[:space:]]$$' $(SOURCE_FILES) ; then echo $$? ; figlet "Space error" \
; echo "Aborting due to trailing spaces. Please use 'make healspaces' to repair." \
; echo "Affected files: " \
- ; grep -l '[ ]$$' $(SOURCE_FILES) \
+ ; grep -l '[[:space:]]$$' $(SOURCE_FILES) \
; exit 1 ; fi
@echo OK
@@ -234,7 +234,7 @@ SOURCE_FILES = checkman/* modules/* checks/* notifications/* $$(find -name Makef
healspaces:
@echo "Removing trailing spaces from code lines..."
- @sed -ri 's/[ ]+$$//g' $(SOURCE_FILES)
+ @sed -ri 's/[[:space:]]+$$//g' $(SOURCE_FILES)
setup:
diff --git a/checks/moxa_iologik_register b/checks/moxa_iologik_register
index 067cd30..7fa4d35 100644
--- a/checks/moxa_iologik_register
+++ b/checks/moxa_iologik_register
@@ -1,72 +1,72 @@
-#!/usr/bin/python
-# -*- encoding: utf-8; py-indent-offset: 4 -*-
-# +------------------------------------------------------------------+
-# | ____ _ _ __ __ _ __ |
-# | / ___| |__ ___ ___| | __ | \/ | |/ / |
-# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
-# | | |___| | | | __/ (__| < | | | | . \ |
-# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
-# | |
-# | Copyright Mathias Kettner 2013 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.
-
-# "0=Off, 1=On in DI/DO mode or N=Count in DO counter mode"
-
-def inventory_iologik_register(info):
- inventory = []
- for line in info:
- if line[2]:
- inventory.append((line[0], None ))
- return inventory
-
-
-def check_iologik_register(item, params, info):
- for line in info:
- if line[0] == item:
- if int(line[2]) in range(0, 2):
- return (int(line[2]), line[1])
- else:
- return (3, "Invalid value %s for register" % line[2])
-
- return (3, "Register not found")
-
-
-check_info['moxa_iologik_register'] = {
- "check_function" : check_iologik_register,
- "inventory_function" : inventory_iologik_register,
- "service_description" : "Moxa Register",
- "has_perfdata" : False,
- "group" : "iologik_register",
- "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.8691.10.2242.2.0").startswith("E2242-T"),
- "snmp_info" : (".1.3.6.1.4.1.8691.10.2242.10.4.1.1",
- [ "1", # index
- "2", # Name
- "3", # Value
- ])
-}
-
-# DIOEntry
-# dioIndex Integer32 (0..11) "The channel dio index."
-# dioType Integer32 (0..1) "The channel dio type. 0=DI, DO=1, AI=2"
-# dioMode Integer32 (0..1) "The channel dio mode. 0=DI, 1=Event Counter"
-# dioStatus Unsigned32 (0..4294967295) "The channel dio(di/do) status. 0=Off, 1=On in DI/DO mode or N=Count in DO counter mode
-# dioFilter Integer32 (1..65535) "The channel dio(di) counter filter. unit=0.5ms"
-# dioTrigger Integer32 (0..1) "The channel dio(di) counter trigger level. 0=L2H, 1=H2L"
-# dioCntStart Integer32 (0..1) "The channel dio(do) counter start/stop. 0=stop, 1=start"
-# dioPulseStart Integer32 (0..1) "The channel dio(do) pulse start/stop. 0=stop, 1=start"
-# dioPulseONWidth Unsigned32 (1..4294967295) "The channel dio(do) signal ON width. unit=0.5ms"
-# dioPulseOFFWidth Unsigned32 (1..4294967295) "The channel dio(do) signal OFF width. unit=0.5ms"
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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.
+
+# "0=Off, 1=On in DI/DO mode or N=Count in DO counter mode"
+
+def inventory_iologik_register(info):
+ inventory = []
+ for line in info:
+ if line[2]:
+ inventory.append((line[0], None ))
+ return inventory
+
+
+def check_iologik_register(item, params, info):
+ for line in info:
+ if line[0] == item:
+ if int(line[2]) in range(0, 2):
+ return (int(line[2]), line[1])
+ else:
+ return (3, "Invalid value %s for register" % line[2])
+
+ return (3, "Register not found")
+
+
+check_info['moxa_iologik_register'] = {
+ "check_function" : check_iologik_register,
+ "inventory_function" : inventory_iologik_register,
+ "service_description" : "Moxa Register",
+ "has_perfdata" : False,
+ "group" : "iologik_register",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.8691.10.2242.2.0").startswith("E2242-T"),
+ "snmp_info" : (".1.3.6.1.4.1.8691.10.2242.10.4.1.1",
+ [ "1", # index
+ "2", # Name
+ "3", # Value
+ ])
+}
+
+# DIOEntry
+# dioIndex Integer32 (0..11) "The channel dio index."
+# dioType Integer32 (0..1) "The channel dio type. 0=DI, DO=1, AI=2"
+# dioMode Integer32 (0..1) "The channel dio mode. 0=DI, 1=Event Counter"
+# dioStatus Unsigned32 (0..4294967295) "The channel dio(di/do) status. 0=Off, 1=On in DI/DO mode or N=Count in DO counter mode
+# dioFilter Integer32 (1..65535) "The channel dio(di) counter filter. unit=0.5ms"
+# dioTrigger Integer32 (0..1) "The channel dio(di) counter trigger level. 0=L2H, 1=H2L"
+# dioCntStart Integer32 (0..1) "The channel dio(do) counter start/stop. 0=stop, 1=start"
+# dioPulseStart Integer32 (0..1) "The channel dio(do) pulse start/stop. 0=stop, 1=start"
+# dioPulseONWidth Unsigned32 (1..4294967295) "The channel dio(do) signal ON width. unit=0.5ms"
+# dioPulseOFFWidth Unsigned32 (1..4294967295) "The channel dio(do) signal OFF width. unit=0.5ms"