示例#1
0
        return int(components[0]) * factor

    parsed = {}  # type: Dict[str, List[Tuple[str, int, int]]]
    for hrtype, hrdescr, hrunits, hrsize, hrused in info:
        units = to_bytes(hrunits)
        size = int(hrsize) * units
        used = int(hrused) * units
        parsed.setdefault(map_types[hrtype], []).append(
            (hrdescr.lower(), size, used))

    return parsed


register.snmp_section(
    name="hr_mem",
    parse_function=parse_hr_mem,
    trees=[
        SNMPTree(
            base=".1.3.6.1.2.1.25.2.3.1",
            oids=[
                '2',  # hrStorageType
                '3',  # hrStorageDescr
                '4',  # hrStorageAllocationUnits
                '5',  # hrStorageSize
                '6',  # hrStorageUsed
            ],
        ),
    ],
    detect=ucd_hr_detection.USE_HR_MEM,
)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.base.plugins.agent_based.agent_based_api.v0 import (
    exists,
    parse_string_table,
    register,
    SNMPTree,
)

register.snmp_section(
    name="snmp_quantum_storage_info",
    parse_function=parse_string_table,
    trees=[
        SNMPTree(
            base=".1.3.6.1.4.1.2036.2.1.1",  # qSystemInfo
            oids=[
                "4",  # 0 1 qVendorID
                "5",  # 0 2 qProdId
                "6",  # 0 3 qProdRev
                "12",  # 0 4 qSerialNumber
            ],
        ),
    ],
    detect=exists(".1.3.6.1.4.1.2036.2.1.1.4.0"),
)
register.snmp_section(
    name="cisco_vpn_sessions",
    parse_function=parse_cisco_vpn_sessions,
    detect=any_of(
        contains('.1.3.6.1.2.1.1.1.0', 'cisco pix security'),
        contains('.1.3.6.1.2.1.1.1.0', 'cisco adaptive security'),
        contains('.1.3.6.1.2.1.1.1.0', 'cisco firepower threat defense'),
    ),
    trees=[
        SNMPTree(
            base='.1.3.6.1.4.1.9.9.392.1',
            oids=[
                '3.26',  # crasIPSecNumSessions
                '3.27',  # crasIPSecCumulateSessions
                '3.28',  # crasIPSecPeakConcurrentSessions
                '3.29',  # crasL2LNumSessions
                '3.30',  # crasL2LCumulateSessions
                '3.31',  # crasL2LPeakConcurrentSessions
                '3.35',  # crasSVCNumSessions
                '3.36',  # crasSVCCumulateSessions
                '3.37',  # crasSVCPeakConcurrentSessions
                '3.38',  # crasWebvpnNumSessions
                '3.39',  # crasWebvpnCumulateSessions
                '3.40',  # crasWebvpnPeakConcurrentSessions
                '1.1',  # crasMaxSessionsSupportable
            ],
        ),
    ],
)
示例#4
0
        except KeyError:
            pass

    return parsed


register.snmp_section(
    name="ucd_mem",
    parse_function=parse_ucd_mem,
    trees=[
        SNMPTree(
            base=".1.3.6.1.4.1.2021.4",
            oids=[
                "5",  # memTotalReal
                "6",  # memAvailReal
                "3",  # memTotalSwap
                "4",  # memAvailSwap
                "11",  # MemTotalFree
                "12",  # memMinimumSwap
                "13",  # memShared
                "14",  # memBuffer
                "15",  # memCached
                "100",  # memSwapError
                "2",  # memErrorName
                "101",  # smemSwapErrorMsg
            ],
        ),
    ],
    detect=ucd_hr_detection.USE_UCD_MEM,
)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.base.plugins.agent_based.agent_based_api.v0 import (
    contains,
    parse_string_table,
    register,
    SNMPTree,
)

register.snmp_section(
    name="infoblox_systeminfo",
    parse_function=parse_string_table,
    trees=[
        SNMPTree(
            base=".1.3.6.1.4.1.7779.3.1.1.2.1",
            oids=[
                "4",  # IB-PLATFORMONE-MIB::ibHardwareType
                "5",  # IB-PLATFORMONE-MIB::ibHardwareId
                "6",  # IB-PLATFORMONE-MIB::ibSerialNumber
                "7",  # IB-PLATFORMONE-MIB::ibSerialVersion
            ],
        ),
    ],
    detect=contains(".1.3.6.1.2.1.1.1.0", "infoblox"),
)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

# .1.3.6.1.2.1.1.1.0 Linux gateway1 2.6.18-92cp #1 SMP Tue Dec 4 21:44:22 IST 2012 i686
# .1.3.6.1.4.1.2620.1.1.25.3.0 19190

from cmk.base.plugins.agent_based.agent_based_api.v0 import register, SNMPTree
from cmk.base.plugins.agent_based.utils import checkpoint


def parse_checkpoint_connections(string_table):
    raw_value = string_table[0][0][0]
    return {"count": int(raw_value)}


register.snmp_section(
    name="checkpoint_connections",
    parse_function=parse_checkpoint_connections,
    detect=checkpoint.DETECT,
    trees=[SNMPTree(base=".1.3.6.1.4.1.2620.1.1.25", oids=['3'])],
)
示例#7
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.base.plugins.agent_based.agent_based_api.v0 import (
    contains,
    OIDEnd,
    parse_string_table,
    register,
    SNMPTree,
)

register.snmp_section(
    name="inv_cisco_vlans",
    parse_function=parse_string_table,
    trees=[
        SNMPTree(
            base=".1.3.6.1.4.1.9.9.68.1.2.2.1",
            oids=[
                OIDEnd(),
                "1",  # vmVlanType
                "2",  # vmVlan
                "4",  # vmVlans
            ],
        ),
    ],
    detect=contains(".1.3.6.1.2.1.1.1.0", "cisco"),
)
示例#8
0
    register,
    SNMPTree,
)

register.snmp_section(
    name="inv_if",
    parse_function=parse_string_table,
    trees=[
        SNMPTree(
            base=".1.3.6.1.2.1",
            oids=[
                "2.2.1.1",  # ifIndex
                "2.2.1.2",  # ifDescr
                "31.1.1.1.18",  # ifAlias
                "2.2.1.3",  # ifType
                "2.2.1.5",  # ifSpeed
                "31.1.1.1.15",  # ifHighSpeed   .. 1000 means 1Gbit
                "2.2.1.8",  # ifOperStatus
                "2.2.1.7",  # ifAdminStatus
                OIDBytes("2.2.1.6"),  # ifPhysAddress
                "2.2.1.9",  # ifLastChange
            ],
        ),
        SNMPTree(
            base=".1.3.6.1.2.1.1",
            oids=[
                "3.0",  # uptime
            ],
        ),
    ],
    # match all cont/version strings >= 2
示例#9
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.base.plugins.agent_based.agent_based_api.v0 import (
    contains,
    parse_string_table,
    register,
    SNMPTree,
)

register.snmp_section(
    name="hp_proliant_systeminfo",
    parse_function=parse_string_table,
    trees=[
        SNMPTree(
            base=".1.3.6.1.4.1.232.2.2.2",
            oids=[
                "1",
            ],
        ),
    ],
    detect=contains(".1.3.6.1.4.1.232.2.2.4.2.0", "proliant"),
)
示例#10
0
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.base.plugins.agent_based.agent_based_api.v0 import (
    exists,
    OIDEnd,
    parse_string_table,
    register,
    SNMPTree,
)

register.snmp_section(
    name="snmp_extended_info",
    parse_function=parse_string_table,
    trees=[
        SNMPTree(
            base=".1.3.6.1.2.1.47.1.1.1.1",
            oids=[
                OIDEnd(),
                "2",  # entPhysicalDescr
                "4",  # entPhysicalContainedIn
                "5",  # entPhysicalClass
                "7",  # entPhysicalName
                "10",  # entPhysicalSoftwareRev (NEW)
                "11",  # entPhysicalSerialNum
                "12",  # entPhysicalMfgName (NEW)
                "13",  # entPhysicalModelName
            ],
        ),
    ],
    detect=exists(".1.3.6.1.2.1.47.1.1.1.1.*"),
)
示例#11
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.base.plugins.agent_based.agent_based_api.v0 import (
    all_of,
    contains,
    exists,
    parse_string_table,
    register,
    SNMPTree,
)

register.snmp_section(
    name="infoblox_osinfo",
    parse_function=parse_string_table,
    trees=[
        SNMPTree(
            base=".1.3.6.1.4.1.2021.100",
            oids=[
                '6.0',  # versionConfigureOptions
            ],
        ),
    ],
    detect=all_of(
        exists(".1.3.6.1.4.1.2021.4.1.*"),
        contains(".1.3.6.1.2.1.1.1.0", "infoblox"),
    ),
)
示例#12
0
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.base.plugins.agent_based.agent_based_api.v0 import (
    exists,
    parse_string_table,
    register,
    SNMPTree,
)

register.snmp_section(
    name="dell_hw_info",
    parse_function=parse_string_table,
    trees=[
        SNMPTree(
            base=".1.3.6.1.4.1.674.10892.5",
            oids=[
                "1.3.2.0",  # IDRAC-MIB::systemServiceTag
                "1.3.3.0",  # IDRAC-MIB::systemExpressServiceCode
                "4.300.50.1.7.1.1",  # IDRAC-MIB::systemBIOSReleaseDateName
                "4.300.50.1.8.1.1",  # IDRAC-MIB::systemBIOSVersionName
                "4.300.50.1.11.1.1",  # IDRAC-MIB::systemBIOSManufacturerName
                "5.1.20.130.1.1.2.1",  # IDRAC-MIB::controllerName
                "5.1.20.130.1.1.8.1",  # IDRAC-MIB::controllerFWVersion
            ],
        ),
    ],
    detect=exists(".1.3.6.1.4.1.674.10892.5.1.1.1.0"),
)
示例#13
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.base.plugins.agent_based.agent_based_api.v0 import (
    startswith,
    parse_string_table,
    register,
    SNMPTree,
)

register.snmp_section(
    name="juniper_info",
    parse_function=parse_string_table,
    trees=[
        SNMPTree(
            base=".1.3.6.1.4.1.2636.3.1",
            oids=[
                "2",  # jnxBoxDescr
                "3",  # jnxBoxSerialNo
            ],
        ),
    ],
    detect=startswith(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.2636.1.1.1.2"),
)
示例#14
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.base.plugins.agent_based.agent_based_api.v0 import (
    exists,
    parse_string_table,
    register,
    SNMPTree,
)

register.snmp_section(
    name="snmp_os",
    parse_function=parse_string_table,
    trees=[
        SNMPTree(
            base=".1.3.6.1.2.1.1",
            oids=[
                '1.0',  # sysDescr
                '2.0',  # sysObjectID
                '3.0',  # sysUpTime
                '5.0',  # sysName
            ],
        ),
    ],
    detect=exists(".1.3.6.1.2.1.1.1.0"),
)