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

def parse_emcvnxe_bat(info):
    parsed = [dict(zip([t.replace('"', '') for t in info[0]], [s.replace('"', '') for s in c])) for c in info[1:]]
    return parsed

def inventory_emcvnxe_bat(parsed):
    for element in parsed:
        yield ( element.get('ID'), {})

def check_emcvnxe_bat(item, params, parsed):
    for element in parsed:
        if element.get('ID') == item:
            health = element.get('Health state')
            health_state = health.split(' ')[:1]
            if health_state[0] == "OK":
                state = 0
            else:
                state = 1
            return state, ("BBU Health State is %s" % health_state[0])

    return 3, ("BBU not found in agent output")

check_info["emcvnxe_bat"] = {
    "parse_function"        : parse_emcvnxe_bat,
    "check_function"        : check_emcvnxe_bat,
    "inventory_function"    : inventory_emcvnxe_bat,
    "service_description"   : "EMC BBU %s",
    "has_perfdata"          : False,
}


914f13ab50de034ca796275fb31edfbdd38a62d1
<mask token>


def inventory_emcvnxe_bat(parsed):
    for element in parsed:
        yield element.get('ID'), {}


<mask token>

<mask token>


def inventory_emcvnxe_bat(parsed):
    for element in parsed:
        yield element.get('ID'), {}


def check_emcvnxe_bat(item, params, parsed):
    for element in parsed:
        if element.get('ID') == item:
            health = element.get('Health state')
            health_state = health.split(' ')[:1]
            if health_state[0] == 'OK':
                state = 0
            else:
                state = 1
            return state, 'BBU Health State is %s' % health_state[0]
    return 3, 'BBU not found in agent output'


<mask token>

def parse_emcvnxe_bat(info):
    parsed = [dict(zip([t.replace('"', '') for t in info[0]], [s.replace(
        '"', '') for s in c])) for c in info[1:]]
    return parsed


def inventory_emcvnxe_bat(parsed):
    for element in parsed:
        yield element.get('ID'), {}


def check_emcvnxe_bat(item, params, parsed):
    for element in parsed:
        if element.get('ID') == item:
            health = element.get('Health state')
            health_state = health.split(' ')[:1]
            if health_state[0] == 'OK':
                state = 0
            else:
                state = 1
            return state, 'BBU Health State is %s' % health_state[0]
    return 3, 'BBU not found in agent output'


<mask token>

def parse_emcvnxe_bat(info):
    parsed = [dict(zip([t.replace('"', '') for t in info[0]], [s.replace(
        '"', '') for s in c])) for c in info[1:]]
    return parsed


def inventory_emcvnxe_bat(parsed):
    for element in parsed:
        yield element.get('ID'), {}


def check_emcvnxe_bat(item, params, parsed):
    for element in parsed:
        if element.get('ID') == item:
            health = element.get('Health state')
            health_state = health.split(' ')[:1]
            if health_state[0] == 'OK':
                state = 0
            else:
                state = 1
            return state, 'BBU Health State is %s' % health_state[0]
    return 3, 'BBU not found in agent output'


check_info['emcvnxe_bat'] = {'parse_function': parse_emcvnxe_bat,
    'check_function': check_emcvnxe_bat, 'inventory_function':
    inventory_emcvnxe_bat, 'service_description': 'EMC BBU %s',
    'has_perfdata': False}

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

def parse_emcvnxe_bat(info):
    parsed = [dict(zip([t.replace('"', '') for t in info[0]], [s.replace('"', '') for s in c])) for c in info[1:]]
    return parsed

def inventory_emcvnxe_bat(parsed):
    for element in parsed:
        yield ( element.get('ID'), {})

def check_emcvnxe_bat(item, params, parsed):
    for element in parsed:
        if element.get('ID') == item:
            health = element.get('Health state')
            health_state = health.split(' ')[:1]
            if health_state[0] == "OK":
                state = 0
            else:
                state = 1
            return state, ("BBU Health State is %s" % health_state[0])

    return 3, ("BBU not found in agent output")

check_info["emcvnxe_bat"] = {
    "parse_function"        : parse_emcvnxe_bat,
    "check_function"        : check_emcvnxe_bat,
    "inventory_function"    : inventory_emcvnxe_bat,
    "service_description"   : "EMC BBU %s",
    "has_perfdata"          : False,
}

