Check_MK plugin to get firmware and service tag of a DELL Powerconnect switch

check_mk is a great monitoring application! I've been trying it for a couple of days first and I am convinced that check_mk has a big future due to its nice conception, super built-in capabilities and the ability to create own check plugins with less effort.

I also tried to create a new check plugin for DELL Powerconnect switches, because the check plugins for such switches provided by check_mk distribution cannot show the firmware version and the service tag of the switch. I copied a provided check plugin (to be more accurate: snmp_info)and modified it a little bit. I'd like to share my result below, please enjoy it!
Save this text right below as file dell_powerconnect_info in the appropriate directory for check plugins (for omd save it under /omd/versions/default/share/check_mk/checks/dell_powerconnect_info)


#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# |             ____ _               _        __  __ _  __           |
# |            / ___| |__   ___  ___| | __   |  \/  | |/ /           |
# |           | |   | '_ \ / _ \/ __| |/ /   | |\/| | ' /            |
# |           | |___| | | |  __/ (__|   <    | |  | | . \            |
# |            \____|_| |_|\___|\___|_|\_\___|_|  |_|_|\_\           |
# |                                                                  |
# | Copyright Mathias Kettner 2010             mk@mathias-kettner.de |
# +------------------------------------------------------------------+
#
# 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.
#
# Adopted by Hermann Maurer at Tue Apr 10 18:12:14 CEST 2012 from
# check_mk plugin snmp_info.
#
# This check_mk plugin checks for the firmware version and service tag
# of a DELL Powerconnect switch. The plugin was tested with DELL Powe-
# rconnect 5424 and 5448 switches
#

def inventory_dell_powerconnect_info(info):
    if len(info[0]) >= 2:
        return [ (None, None) ]

def check_dell_powerconnect_info(checktype, params, info):
    if len(info[0]) >= 2:
        return (0, "OK - Firmware: %s, ServiceTag: %s" % (info[0][0], info[0][1]))
    else:
        return (3, "UNKNOWN - No data retrieved")

check_info['dell_powerconnect_info'] = (check_dell_powerconnect_info, "Powerconnect Info", 0, inventory_dell_powerconnect_info)
snmp_info['dell_powerconnect_info']  = ( ".1.3.6.1.4.1.674.10895.3000.1.2.100", [ '4.0', '8.1.4.1', ] )

#
snmp_scan_functions['dell_powerconnect_info'] = lambda oid: oid(".1.3.6.1.4.1.674.10895.3000.1.2.100.4.0") != None

Save the text below in the directory for check plugin documentation files (for omd under /omd/versions/default/share/doc/check_mk/checks/dell_powerconnect_info):

title: Retrieves some information about a DELL Powerconnect switch
agents: dell_powerconnect_info
author: Hermann Maurer (http://hermannmaurer.blogspot.com)
license: GPL
distribution: check_mk
description:
 This check retrieves the firmware and service tag and displays them.
It is always OK.

inventory:
 One check per SNMP host will be created.

Please note: This check might not be found while an SNMP scan (which you do with
a simple {cmk -I}).  You need to explicitely specify the check, if you
want to inventorize it ({cmk --checks dell_powerconnect_info -I}).
Alternatively you can specify it as a manual check.

You can download a complete check_mk package from the official check_mk exchange site:

1 Kommentare :: Check_MK plugin to get firmware and service tag of a DELL Powerconnect switch

  1. Agilestorelocator.com is the professional in wordpress plugin and plugin is for WordPress. Here is also options available for the Location finder WordPress.

Post a Comment