Пример #1
0

def parse_cisco_fp_entity_sensors(
        string_table: List[StringTable]) -> EntitySensorSection:
    # do not add undefined and temperature (duplicate with cisco_temperature) sensors
    return utils.parse_entity_sensors(
        string_table,
        sensor_types_ignore={"0", "8"},
    )


register.snmp_section(
    name="cisco_fp_entity_sensors",
    supersedes=["entity_sensors"],
    detect=all_of(
        startswith(OIDSysDescr, "Cisco Firepower"),
        contains(OIDSysDescr, "security appliance"),
    ),
    parsed_section_name="entity_sensors",
    parse_function=parse_cisco_fp_entity_sensors,
    fetch=[
        SNMPTree(
            base=".1.3.6.1.2.1.47.1.1.1.1",  # ENTITY-MIB
            oids=[
                OIDEnd(),
                "7",  # ENTITY-MIB::entPhysicalName
            ],
        ),
        SNMPTree(
            base=".1.3.6.1.4.1.9.9.91.1.1.1.1",  # CISCO-ENTITY-SENSOR-MIB
            oids=[
Пример #2
0

register.snmp_section(
    name='cisco_asa_failover',
    parse_function=parse_cisco_asa_failover,
    fetch=SNMPTree(
        base=
        '.1.3.6.1.4.1.9.9.147.1.2.1.1.1',  # CISCO-FIREWALL-MIB::cfwHardwareStatusEntry
        oids=[
            '2',  # CISCO-FIREWALL-MIB::cfwHardwareInformation
            '3',  # CISCO-FIREWALL-MIB::cfwHardwareStatusValue
            '4',  # CISCO-FIREWALL-MIB::cfwHardwareStatusDetail
        ],
    ),
    detect=any_of(
        startswith('.1.3.6.1.2.1.1.1.0', 'cisco adaptive security'),
        contains('.1.3.6.1.2.1.1.1.0', 'cisco pix security'),
    ),
)

register.check_plugin(
    name='cisco_asa_failover',
    service_name='Cluster Status',
    discovery_function=discovery_cisco_asa_failover,
    check_function=check_cisco_asa_failover,
    check_default_parameters={
        'primary': 'active',
        'secondary': 'standby',
        'failover_state': 1,
    },
    check_ruleset_name='cisco_asa_failover',
Пример #3
0

def parse_cisco_fp_entity_sensors(
        string_table: List[StringTable]) -> EntitySensorSection:
    # do not add undefined and temperature (duplicate with cisco_temperature) sensors
    return utils.parse_entity_sensors(
        string_table,
        sensor_types_ignore={'0', '8'},
    )


register.snmp_section(
    name='cisco_fp_entity_sensors',
    supersedes=['entity_sensors'],
    detect=all_of(
        startswith(OIDSysDescr, 'Cisco Firepower'),
        contains(OIDSysDescr, 'security appliance'),
    ),
    parsed_section_name='entity_sensors',
    parse_function=parse_cisco_fp_entity_sensors,
    fetch=[
        SNMPTree(
            base='.1.3.6.1.2.1.47.1.1.1.1',  # ENTITY-MIB
            oids=[
                OIDEnd(),
                '7',  # ENTITY-MIB::entPhysicalName
            ],
        ),
        SNMPTree(
            base='.1.3.6.1.4.1.9.9.91.1.1.1.1',  # CISCO-ENTITY-SENSOR-MIB
            oids=[
Пример #4
0

register.snmp_section(
    name="cisco_asa_failover",
    parse_function=parse_cisco_asa_failover,
    fetch=SNMPTree(
        base=
        ".1.3.6.1.4.1.9.9.147.1.2.1.1.1",  # CISCO-FIREWALL-MIB::cfwHardwareStatusEntry
        oids=[
            "2",  # CISCO-FIREWALL-MIB::cfwHardwareInformation
            "3",  # CISCO-FIREWALL-MIB::cfwHardwareStatusValue
            "4",  # CISCO-FIREWALL-MIB::cfwHardwareStatusDetail
        ],
    ),
    detect=any_of(
        startswith(".1.3.6.1.2.1.1.1.0", "cisco adaptive security"),
        contains(".1.3.6.1.2.1.1.1.0", "cisco pix security"),
        startswith(".1.3.6.1.2.1.1.1.0", "cisco firepower threat defense"),
    ),
)

register.check_plugin(
    name="cisco_asa_failover",
    service_name="Failover state",
    discovery_function=discovery_cisco_asa_failover,
    check_function=check_cisco_asa_failover,
    check_default_parameters={
        "primary": "active",
        "secondary": "standby",
        "failover_state": 1,
        "failover_link_state": 2,
Пример #5
0

register.snmp_section(
    name='cisco_asa_failover',
    parse_function=parse_cisco_asa_failover,
    fetch=SNMPTree(
        base=
        '.1.3.6.1.4.1.9.9.147.1.2.1.1.1',  # CISCO-FIREWALL-MIB::cfwHardwareStatusEntry
        oids=[
            '2',  # CISCO-FIREWALL-MIB::cfwHardwareInformation
            '3',  # CISCO-FIREWALL-MIB::cfwHardwareStatusValue
            '4',  # CISCO-FIREWALL-MIB::cfwHardwareStatusDetail
        ],
    ),
    detect=any_of(
        startswith('.1.3.6.1.2.1.1.1.0', 'cisco adaptive security'),
        contains('.1.3.6.1.2.1.1.1.0', 'cisco pix security'),
        startswith('.1.3.6.1.2.1.1.1.0', 'cisco firepower threat defense'),
    ),
)

register.check_plugin(
    name='cisco_asa_failover',
    service_name='Failover state',
    discovery_function=discovery_cisco_asa_failover,
    check_function=check_cisco_asa_failover,
    check_default_parameters={
        'primary': 'active',
        'secondary': 'standby',
        'failover_state': 1,
        'failover_link_state': 2,
Пример #6
0
def detect():
    return all_of(
        startswith(".1.3.6.1.2.1.1.1.0", "Linux"),
        exists(".1.3.6.1.4.1.6574.*"),
    )
Пример #7
0
    StringTable,
)
from cmk.base.plugins.agent_based.utils import entity_sensors as utils
from cmk.base.plugins.agent_based.utils.entity_sensors import EntitySensorSection, OIDSysDescr
from cmk.base.plugins.agent_based.utils.temperature import check_temperature, TempParamType


def parse_entity_sensors(
        string_table: List[StringTable]) -> EntitySensorSection:
    return utils.parse_entity_sensors(string_table)


register.snmp_section(
    name='entity_sensors',
    detect=any_of(
        startswith(OIDSysDescr, "palo alto networks"),
        startswith(OIDSysDescr, "cisco adaptive security appliance"),
    ),
    parse_function=parse_entity_sensors,
    fetch=[
        SNMPTree(
            base=".1.3.6.1.2.1.47.1.1.1.1",
            oids=[
                OIDEnd(),
                "7",  # ENTITY-MIB::entPhysicalName
            ],
        ),
        SNMPTree(
            base=".1.3.6.1.2.1.99.1.1.1",
            oids=[
                OIDEnd(),
Пример #8
0
def cluster_check_juniper_trpz_aps_sessions(
    item: str,
    section: Mapping[str, Section],
) -> CheckGenerator:
    yield from _check_common_juniper_trpz_aps_sessions(
        get_value_store(),
        time.time(),
        item,
        section,
    )


register.snmp_section(
    name="juniper_trpz_aps_sessions",
    detect=any_of(startswith(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.14525.3.1"),
                  startswith(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.14525.3.3")),
    parse_function=parse_juniper_trpz_aps_sessions,
    trees=[
        SNMPTree(
            base=".1.3.6.1.4.1.14525.4.5.1.1.2.1",
            oids=[
                OIDEnd(),
                "5",  #  trpzApStatApStatusMacApState         -> status of access point
                "8",  #  trpzApStatApStatusMacApName          -> name of access point
            ]),
        SNMPTree(
            base=".1.3.6.1.4.1.14525.4.5.1.1.10.1",
            oids=[
                OIDEnd(),
                "3",  #  trpzApStatRadioOpStatsTxUniPkt       -> unicast packets transmitted
Пример #9
0
    yield from check_temperature(
        reading=temperature,
        params=params,
        unique_name=item,
        value_store=get_value_store(),
    )


register.snmp_section(
    name="cisco_ie_temp",
    parse_function=parse,
    fetch=SNMPTree(
        base=".1.3.6.1.4.1.9.9.832.1.24.1.3.6.1",  #  cie1000SysutilStatusTemperatureMonitorEntry
        oids=[
            OIDEnd(),
            "5",  # cie1000SysutilStatusTemperatureMonitorTemperature
        ],
    ),
    detect=startswith(".1.3.6.1.2.1.1.1.0", "IE1000"),
)

register.check_plugin(
    name="cisco_ie_temp",
    service_name="Temperature %s",
    discovery_function=discover,
    check_default_parameters={},
    check_function=check,
    check_ruleset_name="temperature",
)

def check_huawei_storage_hwcache(item, params, section) -> CheckResult:
    for id, ru, wu, mwu, hr in section:
        if item == id:
            yield Result(state=State.OK, summary="HWCache %s: ok" % item)
            yield Metric("read_utilization", int(ru))
            yield Metric("write_utilization", int(wu))
            yield Metric("mirror_write_utilization", int(mwu))
            yield Metric("hit_ratio", int(hr))


register.snmp_section(
    name="huawei_storage_hwcache",
    #parse_function = parse_huawei_storage_hwcache,
    detect=startswith(".1.3.6.1.2.1.1.1.0", "ISM SNMP Agent"),
    fetch=SNMPTree(
        base='.1.3.6.1.4.1.34774.4.1.21.7.1',
        oids=[
            '1',  # hwPerfCacheID
            '2',  # hwPerfCacheReadUtilization
            '3',  # hwPerfCacheWriteUtilization
            '4',  # hwPerfCacheMirrorWriteUtilization
            '5',  # hwPerfCacheHitRatio
        ],
    ),
)

register.check_plugin(
    name="huawei_storage_hwcache",
    service_name="HWCache %s",