lsi_controller

LSI Controller-Check

Benötigt 'mpt-status'

Client-Check

#!/bin/sh
 
# check_mk check f. LSI Controller
#
# 10/2010 Matthias Henze
# Lizenz: GPL v2
 
 
if which mpt-status >/dev/null ; then
    echo '<<<lsi_phys>>>'
    for i in $(mpt-status -p | grep Found | cut -d " " -f 3 | cut -d "=" -f 2 | cut -d "," -f 1)
    do
        mpt-status -i $i -n | grep phys_id
    done

    echo '<<<lsi_vols>>>'
    for i in $(mpt-status -p | grep Found | cut -d " " -f 3 | cut -d "=" -f 2 | cut -d "," -f 1)
    do
        mpt-status -i $i -n | grep vol_id
    done
fi

Plugins

#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
 
# check_mk check f. LSI Controller
#
# 10/2010 Matthias Henze
# Lizenz: GPL v2
 
 
# Example output from agent:
# <<<lsi_phys>>>
# ioc:0 phys_id:1 scsi_id:10 vendor:ATA      product_id:ST31500341AS     revision:CC1H size(GB):1397 state: ONLINE flags: NONE sync_state: 100 ASC/ASCQ:0xff/0xff SMART ASC/ASCQ:0xff/0xff
# ioc:0 phys_id:0 scsi_id:1 vendor:ATA      product_id:ST31500341AS     revision:CC1H size(GB):1397 state: ONLINE flags: NONE sync_state: 100 ASC/ASCQ:0xff/0xff SMART ASC/ASCQ:0xff/0xff

# ioc:0 phys_id:1 scsi_id:8 vendor:ATA      product_id:TOSHIBA DT01ACA2 revision:ABB0 size(GB):1863 state: ONLINE flags: NONE sync_state: 100 ASC/ASCQ:0xff/0xff SMART ASC/ASCQ:0xff/0xff
# ioc:0 phys_id:0 scsi_id:7 vendor:ATA      product_id:TOSHIBA DT01ACA2 revision:ABB0 size(GB):1863 state: ONLINE flags: NONE sync_state: 100 ASC/ASCQ:0xff/0xff SMART ASC/ASCQ:0xff/0xff
 
 
 
# inventory
def inventory_lsi_phys(checkname, info):
    inventory = []
    for line in info:
       x = line[1].split(":")
       unit = x[1]
       inventory.append( (unit, None) )
    return inventory
 
# check
def check_lsi_phys(item, param, info):
    for line in info:
        x = line[1].split(":")
        if x[1] == item:
            offset = 0
            x = line[4].split(":")
            unit_type = x[1]
            if len(line) > 16:
                offset = len(line) - 16
                for i in range(0,offset):
                    unit_type="%s %s" % (unit_type,line[4+i+1])
            status = line[8+offset]
            x = line[6+offset].split(":")
            size = x[1]
            sync = line[12+offset]
            infotext = "%s  (type: %s, size: %s GB, sync: %s)" % (status, unit_type, size, sync)
            if status == "ONLINE":
                return (0, "OK - unit status is " + infotext)
            else:
                return (2, "CRITICAL - unit status is " + infotext)
    return (3, "UNKNOWN - unit %s not found in agent output" % item) 
 
# declare the check to Check_MK
check_info['lsi_phys'] = \
    (check_lsi_phys, "RAID LSI phys %s", 0, inventory_lsi_phys)

#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
 
# check_mk check f. LSI Controller
#
# 10/2010 Matthias Henze
# Lizenz: GPL v2
 
 
# Example output from agent:
# <<<lsi_vols>>>
# ioc:0 vol_id:0 type:IM raidlevel:RAID-1 num_disks:2 size(GB):1396 state: OPTIMAL flags: ENABLED

# ioc:0 vol_id:6 type:IM raidlevel:RAID-1 num_disks:2 size(GB):1862 state: OPTIMAL flags: ENABLED
 
 
# inventory
def inventory_lsi_vols(checkname, info):
    inventory = []
    for line in info:
        x = line[1].split(":")
        unit = x[1]
        inventory.append( (unit, None) )
    return inventory
 
# check
def check_lsi_vols(item, param, info):
    for line in info:
            status = line[7]
            x = line[3].split(":")
            unit_type = x[1]
            x = line[5].split(":")
            size = x[1]
            infotext = "%s  (type: %s, size: %s GB)" % (status, unit_type, size)
            if status == "OPTIMAL":
                return (0, "OK - volume status is " + infotext)
            else:
                return (2, "CRITICAL - volume status is " + infotext)
    return (3, "UNKNOWN - volume %s not found in agent output" % item) 
 
# declare the check to Check_MK
check_info['lsi_vols'] = \
    (check_lsi_vols, "RAID LSI unit %s", 0, inventory_lsi_vols)

  • lsi_controller.txt
  • Zuletzt geändert: 2017/03/17 11:37
  • (Externe Bearbeitung)