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

import binascii;

def inventory_cisco_ipsla(info):
    return [ (binascii.hexlify(ip), None) for (index, ip, rtt, mos, jitter) in info ]

def check_cisco_ipsla(item, _no_params, info):
    for index, ip, rtt, mos, jitter in info:
      if binascii.hexlify(ip) == item:
        mos = float(mos) / 100.0
        perfdata = [ ( "MOS", mos,3,2 ), ( "RTT", rtt ), ( "Jitter", jitter ) ]
        return 0, "OK - Target: %s, MOS Score: %s, RTT min: %sms, Jitter: %sms" % (binascii.hexlify(ip), mos, rtt, jitter), perfdata

    return (3, "UNKNOWN - not yet implemented")

check_info['cisco_ipsla'] = {
    "check_function"        : check_cisco_ipsla,
    "service_description"   : "IP SLA monitor %s",
    "has_perfdata"          : True,
    "inventory_function"    : inventory_cisco_ipsla,
    "snmp_info"             : ( ".1.3.6.1.4.1.9.9.42.1", [
				"2.1.1.3",	# AdminTag
				"2.2.1.2",	# Target IP Address (hex coded)
				"5.2.1.4",	# Latest RTT min
				"5.2.1.42",	# Latest MOS score
				"5.2.1.46",	# Latest Jitter value
				]),
    "snmp_scan_functions"   : lambda oid: oid(".1.3.6.1.4.1.9.9.42.1.*") != None
}

54e50c6f76e1e0517182a95e45466dbad927a45f
<mask token>


def check_cisco_ipsla(item, _no_params, info):
    for index, ip, rtt, mos, jitter in info:
        if binascii.hexlify(ip) == item:
            mos = float(mos) / 100.0
            perfdata = [('MOS', mos, 3, 2), ('RTT', rtt), ('Jitter', jitter)]
            return (0, 
                'OK - Target: %s, MOS Score: %s, RTT min: %sms, Jitter: %sms' %
                (binascii.hexlify(ip), mos, rtt, jitter), perfdata)
    return 3, 'UNKNOWN - not yet implemented'


<mask token>

<mask token>


def inventory_cisco_ipsla(info):
    return [(binascii.hexlify(ip), None) for index, ip, rtt, mos, jitter in
        info]


def check_cisco_ipsla(item, _no_params, info):
    for index, ip, rtt, mos, jitter in info:
        if binascii.hexlify(ip) == item:
            mos = float(mos) / 100.0
            perfdata = [('MOS', mos, 3, 2), ('RTT', rtt), ('Jitter', jitter)]
            return (0, 
                'OK - Target: %s, MOS Score: %s, RTT min: %sms, Jitter: %sms' %
                (binascii.hexlify(ip), mos, rtt, jitter), perfdata)
    return 3, 'UNKNOWN - not yet implemented'


<mask token>

<mask token>


def inventory_cisco_ipsla(info):
    return [(binascii.hexlify(ip), None) for index, ip, rtt, mos, jitter in
        info]


def check_cisco_ipsla(item, _no_params, info):
    for index, ip, rtt, mos, jitter in info:
        if binascii.hexlify(ip) == item:
            mos = float(mos) / 100.0
            perfdata = [('MOS', mos, 3, 2), ('RTT', rtt), ('Jitter', jitter)]
            return (0, 
                'OK - Target: %s, MOS Score: %s, RTT min: %sms, Jitter: %sms' %
                (binascii.hexlify(ip), mos, rtt, jitter), perfdata)
    return 3, 'UNKNOWN - not yet implemented'


check_info['cisco_ipsla'] = {'check_function': check_cisco_ipsla,
    'service_description': 'IP SLA monitor %s', 'has_perfdata': True,
    'inventory_function': inventory_cisco_ipsla, 'snmp_info': (
    '.1.3.6.1.4.1.9.9.42.1', ['2.1.1.3', '2.2.1.2', '5.2.1.4', '5.2.1.42',
    '5.2.1.46']), 'snmp_scan_functions': lambda oid: oid(
    '.1.3.6.1.4.1.9.9.42.1.*') != None}

import binascii


def inventory_cisco_ipsla(info):
    return [(binascii.hexlify(ip), None) for index, ip, rtt, mos, jitter in
        info]


def check_cisco_ipsla(item, _no_params, info):
    for index, ip, rtt, mos, jitter in info:
        if binascii.hexlify(ip) == item:
            mos = float(mos) / 100.0
            perfdata = [('MOS', mos, 3, 2), ('RTT', rtt), ('Jitter', jitter)]
            return (0, 
                'OK - Target: %s, MOS Score: %s, RTT min: %sms, Jitter: %sms' %
                (binascii.hexlify(ip), mos, rtt, jitter), perfdata)
    return 3, 'UNKNOWN - not yet implemented'


check_info['cisco_ipsla'] = {'check_function': check_cisco_ipsla,
    'service_description': 'IP SLA monitor %s', 'has_perfdata': True,
    'inventory_function': inventory_cisco_ipsla, 'snmp_info': (
    '.1.3.6.1.4.1.9.9.42.1', ['2.1.1.3', '2.2.1.2', '5.2.1.4', '5.2.1.42',
    '5.2.1.46']), 'snmp_scan_functions': lambda oid: oid(
    '.1.3.6.1.4.1.9.9.42.1.*') != None}

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

import binascii;

def inventory_cisco_ipsla(info):
    return [ (binascii.hexlify(ip), None) for (index, ip, rtt, mos, jitter) in info ]

def check_cisco_ipsla(item, _no_params, info):
    for index, ip, rtt, mos, jitter in info:
      if binascii.hexlify(ip) == item:
        mos = float(mos) / 100.0
        perfdata = [ ( "MOS", mos,3,2 ), ( "RTT", rtt ), ( "Jitter", jitter ) ]
        return 0, "OK - Target: %s, MOS Score: %s, RTT min: %sms, Jitter: %sms" % (binascii.hexlify(ip), mos, rtt, jitter), perfdata

    return (3, "UNKNOWN - not yet implemented")

check_info['cisco_ipsla'] = {
    "check_function"        : check_cisco_ipsla,
    "service_description"   : "IP SLA monitor %s",
    "has_perfdata"          : True,
    "inventory_function"    : inventory_cisco_ipsla,
    "snmp_info"             : ( ".1.3.6.1.4.1.9.9.42.1", [
				"2.1.1.3",	# AdminTag
				"2.2.1.2",	# Target IP Address (hex coded)
				"5.2.1.4",	# Latest RTT min
				"5.2.1.42",	# Latest MOS score
				"5.2.1.46",	# Latest Jitter value
				]),
    "snmp_scan_functions"   : lambda oid: oid(".1.3.6.1.4.1.9.9.42.1.*") != None
}
