Module: check_mk
Branch: master
Commit: e16dab2b911d9f3e9cceca45e937a0d143bf4d7f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e16dab2b911d9f…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Jan 17 10:12:14 2014 +0100
hitachi_hnas_fc_if: New check for FibreChannel Interfaces in Hitachi HNAS storage systems
---
.werks/458 | 8 ++
ChangeLog | 1 +
checkman/hitachi_hnas_fc_if | 36 +++++++++
checks/hitachi_hnas_fc_if | 100 +++++++++++++++++++++++++
checks/if.include | 2 +-
pnp-templates/check_mk-hitachi_hnas_fc_if.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
7 files changed, 148 insertions(+), 1 deletion(-)
diff --git a/.werks/458 b/.werks/458
new file mode 100644
index 0000000..fe81e71
--- /dev/null
+++ b/.werks/458
@@ -0,0 +1,8 @@
+Title: hitachi_hnas_fc_if: New check for FibreChannel Interfaces in Hitachi HNAS storage
systems
+Level: 2
+Component: checks
+Version: 1.2.5i1
+Date: 1389949907
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 199368b..41e6649 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -46,6 +46,7 @@
* 0568 f5_big_ip_conns: check now supports predictive monitoring and both connections
types are merged in one check
* 0257 windows_agent: now reports extended process information (obsoletes psperf.bat
plugin)...
* 0457 hitachi_hnas_volume: New check for Usage and Status of Volumes in Hitachi HNAS
storage systems
+ * 0458 hitachi_hnas_fc_if: New check for FibreChannel Interfaces in 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
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/hitachi_hnas_fc_if b/checkman/hitachi_hnas_fc_if
new file mode 100644
index 0000000..19dd8f2
--- /dev/null
+++ b/checkman/hitachi_hnas_fc_if
@@ -0,0 +1,36 @@
+title: Hitachi HNAS: FibreChannel Interfaces
+agents: snmp
+catalog: hw/storagehw/hitachi
+license: GPL
+distribution: check_mk
+description:
+ Checks FibreChannel Interfaces in Hitachi HNAS storage systems.
+
+ It uses the check logic of the {if64} check, so for configuration parameters
+ and examples please refer to the man page of {if64}.
+
+ Values for ifHCInUcastPkts, ifHCInMulticastPkts, ifHCInBroadcastPkts,
+ ifHCOutUcastPkts, ifHCOutMulticastPkts, ifHCOutBroadcastPkts, ifOutDiscards,
+ ifOutErrors and ifOutQLen are always 0 and ifPhysAddress is empty, because
+ they do not exist in this case.
+
+item:
+ If configured to use the interface ID as item, it is build from
+ the ID of the interface as a three digit number, prefixed with the ID
+ of the ClusterNode. For Interface 2 on ClusterNode 1 e. g. 1002
+
+ If configured to use the Alias or Description of an interface as item,
+ it is build from the ID of the ClusterNode plus the ID of the interface
+ separated by a dot. For Interface 2 on ClusterNode 1 e. g. 1.2
+
+perfdata:
+ See man page of {if64}
+
+inventory:
+ Finds one item per FibreChannel Interface.
+
+[parameters]
+parameters (dict): See man page of {if64}.
+
+[configuration]
+All: See man page of {if64}.
diff --git a/checks/hitachi_hnas_fc_if b/checks/hitachi_hnas_fc_if
new file mode 100644
index 0000000..b8a1821
--- /dev/null
+++ b/checks/hitachi_hnas_fc_if
@@ -0,0 +1,100 @@
+#!/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 hitachi_hnas_fc_if_convert_info(info):
+ converted = []
+ for line in info:
+ convertedline = []
+ convertedline.append("%d%03d" % (int(line[0]), int(line[1]))) #
ifIndex
+ # use ClusterNode.InterfaceIndex as description too, because
+ # we have no explicit Descr
+ convertedline.append(line[0] + "." + line[1]) # ifDescr
+ # ifType 56 fibreChannel
+ convertedline.append("56") # ifType
+ convertedline.append(str(int(line[3]) * 1000000000)) # ifHighSpeed
+ if line[2] == "1": # ifOperStatus
+ convertedline.append("1")
+ else:
+ convertedline.append("2")
+ convertedline.append(line[4]) # ifHCInOctets
+ convertedline.append("0") # ifHCInUcastPkts
+ convertedline.append("0") #
ifHCInMulticastPkts
+ convertedline.append("0") # ifHCInBroadcastPkts
+ convertedline.append(line[11]) # ifInDiscards
+ convertedline.append(str(int(line[6]) + int(line[7]) + int(line[8]) \
+ + int(line[9]) + int(line[10]) + int(line[12]) + int(line[13])))
+ # ifInErrors
+ convertedline.append(line[5]) # ifHCOutOctets
+ convertedline.append("0") # ifHCOutUcastPkts
+ convertedline.append("0") #
ifHCOutMulticastPkts
+ convertedline.append("0") #
ifHCOutBroadcastPkts
+ convertedline.append("0") # ifOutDiscards
+ convertedline.append("0") # ifOutErrors
+ convertedline.append("0") # ifOutQLen
+ # use ClusterNode.InterfaceIndex as alias too, because
+ # we have no explicit alias
+ convertedline.append(line[0] + "." + line[1]) # ifAlias
+ convertedline.append("") # ifPhysAddress
+
+ converted.append(convertedline)
+ return converted
+
+def inventory_hitachi_hnas_fc_if(info):
+ converted = hitachi_hnas_fc_if_convert_info(info)
+ return inventory_if_common(converted)
+
+def check_hitachi_hnas_fc_if(item, params, info):
+ converted = hitachi_hnas_fc_if_convert_info(info)
+ return check_if_common(item, params, converted)
+
+
+check_info["hitachi_hnas_fc_if"] = {
+ "check_function" : check_hitachi_hnas_fc_if,
+ "inventory_function" : inventory_hitachi_hnas_fc_if,
+ "includes": [ "if.include" ],
+ "service_description" : "Interface FC %s",
+ "has_perfdata" : True,
+ "snmp_info" :
(".1.3.6.1.4.1.11096.6.1.1.1.3.6.25.1", [
+ 1, # fcStatsClusterNode 0
+ 2, # fcStatsInterfaceIndex 1
+ 4, # fcStatsInterfaceStatus 2
+ 5, # fcStatsInterfaceLinkSpeed 3
+ 7, # fcStatsInstantaneousInRate 4
+ 8, # fcStatsInstantaneousOutRate 5
+ 13, # fcStatsSignalLossErrors 6
+ 14, # fcStatsBadRXCharErrors 7
+ 15, # fcStatsLossSyncErrors 8
+ 16, # fcStatsLinkFailErrors 9
+ 17, # fcStatsRXEOFErrors 10
+ 18, # fcStatsDiscardedFrameErrors 11
+ 19, # fcStatsBadCRCErrors 12
+ 20, # fcStatsProtocolErrors 13
+ ]),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.11096.6"),
+ "group": "if",
+ "default_levels_variable": "if_default_levels",
+}
+
diff --git a/checks/if.include b/checks/if.include
index 54938e4..ba6f37c 100644
--- a/checks/if.include
+++ b/checks/if.include
@@ -26,7 +26,7 @@
# Functions and definitions used by if and if64
-if_inventory_porttypes = [ '6', '32', '62', '117' ]
+if_inventory_porttypes = [ '6', '32', '56', '62',
'117' ]
if_inventory_portstates = [ '1' ]
if_inventory_uses_description = False
if_inventory_uses_alias = False
diff --git a/pnp-templates/check_mk-hitachi_hnas_fc_if.php
b/pnp-templates/check_mk-hitachi_hnas_fc_if.php
new file mode 120000
index 0000000..9a34dce
--- /dev/null
+++ b/pnp-templates/check_mk-hitachi_hnas_fc_if.php
@@ -0,0 +1 @@
+check_mk-if.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index b3a9933..0592495 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -376,6 +376,7 @@ perfometers["check_mk-lnx_if"] = perfometer_check_mk_if
perfometers["check_mk-hpux_if"] = perfometer_check_mk_if
perfometers["check_mk-mcdata_fcport"] = perfometer_check_mk_if
perfometers["check_mk-esx_vsphere_counters.if"] = perfometer_check_mk_if
+perfometers["check_mk-hitachi_hnas_fc_if"] = perfometer_check_mk_if
def perfometer_check_mk_brocade_fcport(row, check_command, perf_data):