Archives mensuelles : mai 2015

Check_mk check for generic OID

A while ago, I wrote a simple check_mk check to monitor a single SNMP OID. I can simply be customized to quickly monitor any value, with alert levels and perfdata. Here it is :

#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-

# Cyril - 28/01/2014
# Check_snmp_template for a single OID, for example .1.3.6.1.2.1.4.5.0
# How to customize :
# Break the OID in 2 parts, for instance ".1.3.6.1.2.1.4.5" and "0". Adapt baseoid and suboid.
# Adjust crit and warn values
# Replace "snmp_oid_test1" in all strings and function names
# Remplace "valeur" with a description

# OID to check
baseoid = ".1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.13"
suboid = "0"
# Warn if above this value
warn = 70
# Critical if above this value
crit = 90
# OID description (for example: CPU Utilization)
valeur = "Valeur"

def inventory_snmp_oid_test1(info):
    if len(info) > 0:
        return [ (None, (warn, crit) ) ]

def check_snmp_oid_test1(item, _no_params, info):
   value = int(info[0][0])
   perfdata = [ ("valeur", value, warn, crit) ]
   if value > crit:
           return (2, "Valeur: %i" % value, perfdata)
   elif value > warn:
           return (1, "Valeur: %i" % value, perfdata)
   else:
           return (0, "Valeur: %i" % value, perfdata)

check_info["snmp_oid_test1"] = {
        "check_function"        : check_snmp_oid_test1,
        "service_description"   : "Alcatel Switch CPU",
        "snmp_info"             : ( baseoid, [ suboid ] ),
        "has_perfdata"          : True,
        "inventory_function"    : inventory_snmp_oid_test1,
        }

# Quick and dirty scan function, testing against sysObjectID would be more efficient
snmp_scan_functions["snmp_oid_test1"] = \
        lambda oid: oid( baseoid + "." + suboid ) != None

Download it here : check_mk_generic_snmp_oid

Dell Storage Compellent SC plugin for check_mk

I wrote a check_mk check for Dell « Compellent » Storage Arrays.

It was developped for the SC4020 model, and works also for SCv2000/SCv2020 (thanks Emmanuel) and SC7020. It should work with other models (SC5020, SC8000, SC9000).

The following items can be monitored:

  • Global status, as reported by the system
  • Controllers status
  • I/O modules status
  • Disk status
  • Hardware sensors status
  • Temperatures (with performance data)
  • Power supplies status
  • Volume status
  • Servers status

sc4020_check_mk

Download from Check-MK Exchange

Have fun !

Update 27/06/2017 : Since SCOS 7.x, temperature values are not correctly reported through SNMP. This caused a crash of the temperature checks.This is a known bug which will be addressed with SCOS 7.2.10. Meanwhile, I’ll release version 1.1, containing workarounds to avoid crashes.