ImTheLucKyOne / check_mk_emcunity

Check_MK Extensions for Dell EMC Unity Storages
GNU General Public License v3.0
5 stars 8 forks source link

EMC UNITY 400VL #8

Closed kazatelm closed 5 years ago

kazatelm commented 5 years ago

Hi, many thanks for your good work with chekc_mk and applicable check for EMC UNITY. I can confirm conpatibility for Emc Unity 400VL. I did a small update in the check emcunity_disk, where I have to shift disk by the name, the slot selection was not applicable, because the returned value was not unique.

def inventory_emcunity_disk(info):

parse info, no key needed for inventory

"Name" is automatically added

keys = [ "Name", "Serial number" ]
disks = emcunity_parse_info(info, keys)
for disk in disks:
    if disks[disk]["Serial number"] != "":
        item = disks[disk]["Name"]
        yield item, None

def check_emcunity_disk(item, params, info):

parse info, just get data we want for this check by defining the keys

keys = [ "Name", "Health state", "Health details", "Type", "Model"]
disks = emcunity_parse_info(info, keys)
for disk in disks:
    name = disks[disk]["Name"]
    if name == item:
        hstate = disks[disk]["Health state"]
        hdetail = disks[disk]["Health details"]
        model = disks[disk]["Model"]
        hddtype = disks[disk]["Type"]
return parse_emcstate(hstate), "%s, %s, Model: %s, Type: %s" % (hstate, hdetail, model, hddtype)

check_info["emcunity_disk"] = { 'check_function' : check_emcunity_disk, 'inventory_function' : inventory_emcunity_disk, 'service_description' : 'HW Disk %s', 'includes' : [ 'emcunity.include' ], }

ImTheLucKyOne commented 5 years ago

Hi,

thanks for pointing that out. I am totally going to change emcunity_disk as you suggested.

Thank you very much!

ImTheLucKyOne commented 5 years ago