Collection of CheckMK checks (see https://checkmk.com/). All checks and plugins are provided as is. Absolutely no warranty. Send any comments to thl-cmk[at]outlook[dot]com

Skip to content
Snippets Groups Projects
Commit 9c3cfc9d authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

update project

parent 711e7431
No related branches found
No related tags found
No related merge requests found
......@@ -9,17 +9,110 @@
#
# Monitor Cisco ASA temperature sensors
#
# this check is based on the cmk 2.0 checkpoint_temp check
#
# 2021-02-25: rewrite for CMK 2.x
#
# sample snmpwalk
# .1.3.6.1.2.1.47.1.1.1.1.7.1 = STRING: "Chassis"
# .1.3.6.1.2.1.47.1.1.1.1.7.2 = STRING: "Processor 0/0"
# .1.3.6.1.2.1.47.1.1.1.1.7.3 = STRING: "Processor 0/1"
# .1.3.6.1.2.1.47.1.1.1.1.7.4 = STRING: "Processor 0/2"
# .1.3.6.1.2.1.47.1.1.1.1.7.5 = STRING: "ASA5515 Slot for Removable Drive 0"
# .1.3.6.1.2.1.47.1.1.1.1.7.6 = STRING: "Micron_M550_MTFDDAK128MAY Removable Drive in Slot 0"
# .1.3.6.1.2.1.47.1.1.1.1.7.7 = STRING: "Chassis Cooling Fan 1"
# .1.3.6.1.2.1.47.1.1.1.1.7.8 = STRING: "Chassis Fan Sensor 1"
# .1.3.6.1.2.1.47.1.1.1.1.7.9 = STRING: "Chassis Cooling Fan 2"
# .1.3.6.1.2.1.47.1.1.1.1.7.10 = STRING: "Chassis Fan Sensor 2"
# .1.3.6.1.2.1.47.1.1.1.1.7.11 = STRING: "Chassis Cooling Fan 3"
# .1.3.6.1.2.1.47.1.1.1.1.7.12 = STRING: "Chassis Fan Sensor 3"
# .1.3.6.1.2.1.47.1.1.1.1.7.13 = STRING: "CPU Temperature Sensor 0/0"
# .1.3.6.1.2.1.47.1.1.1.1.7.14 = STRING: "Chassis Ambient Temperature Sensor 1"
# .1.3.6.1.2.1.47.1.1.1.1.7.15 = STRING: "Chassis Ambient Temperature Sensor 2"
# .1.3.6.1.2.1.47.1.1.1.1.7.16 = STRING: "Chassis Ambient Temperature Sensor 3"
# .1.3.6.1.2.1.47.1.1.1.1.7.17 = STRING: "Gi0/0"
# .1.3.6.1.2.1.47.1.1.1.1.7.18 = STRING: "Gi0/1"
# .1.3.6.1.2.1.47.1.1.1.1.7.19 = STRING: "Gi0/2"
# .1.3.6.1.2.1.47.1.1.1.1.7.20 = STRING: "Gi0/3"
# .1.3.6.1.2.1.47.1.1.1.1.7.21 = STRING: "Gi0/4"
# .1.3.6.1.2.1.47.1.1.1.1.7.22 = STRING: "Gi0/5"
# .1.3.6.1.2.1.47.1.1.1.1.7.23 = STRING: "In0/0"
# .1.3.6.1.2.1.47.1.1.1.1.7.24 = STRING: "In0/1"
# .1.3.6.1.2.1.47.1.1.1.1.7.25 = STRING: "Ma0/0"
# .1.3.6.1.2.1.47.1.1.1.1.7.26 = STRING: "Po1"
#
# .1.3.6.1.2.1.99.1.1.1.1.8 = INTEGER: 10
# .1.3.6.1.2.1.99.1.1.1.1.10 = INTEGER: 10
# .1.3.6.1.2.1.99.1.1.1.1.12 = INTEGER: 10
# .1.3.6.1.2.1.99.1.1.1.1.13 = INTEGER: 8
# .1.3.6.1.2.1.99.1.1.1.1.14 = INTEGER: 8
# .1.3.6.1.2.1.99.1.1.1.1.15 = INTEGER: 8
# .1.3.6.1.2.1.99.1.1.1.1.16 = INTEGER: 8
# .1.3.6.1.2.1.99.1.1.1.4.8 = INTEGER: 7680
# .1.3.6.1.2.1.99.1.1.1.4.10 = INTEGER: 7936
# .1.3.6.1.2.1.99.1.1.1.4.12 = INTEGER: 7680
# .1.3.6.1.2.1.99.1.1.1.4.13 = INTEGER: 34
# .1.3.6.1.2.1.99.1.1.1.4.14 = INTEGER: 32
# .1.3.6.1.2.1.99.1.1.1.4.15 = INTEGER: 30
# .1.3.6.1.2.1.99.1.1.1.4.16 = INTEGER: 33
# .1.3.6.1.2.1.99.1.1.1.5.8 = INTEGER: 1
# .1.3.6.1.2.1.99.1.1.1.5.10 = INTEGER: 1
# .1.3.6.1.2.1.99.1.1.1.5.12 = INTEGER: 1
# .1.3.6.1.2.1.99.1.1.1.5.13 = INTEGER: 1
# .1.3.6.1.2.1.99.1.1.1.5.14 = INTEGER: 1
# .1.3.6.1.2.1.99.1.1.1.5.15 = INTEGER: 1
# .1.3.6.1.2.1.99.1.1.1.5.16 = INTEGER: 1
# .1.3.6.1.2.1.99.1.1.1.6.8 = STRING: "rpm"
# .1.3.6.1.2.1.99.1.1.1.6.10 = STRING: "rpm"
# .1.3.6.1.2.1.99.1.1.1.6.12 = STRING: "rpm"
# .1.3.6.1.2.1.99.1.1.1.6.13 = STRING: "celsius"
# .1.3.6.1.2.1.99.1.1.1.6.14 = STRING: "celsius"
# .1.3.6.1.2.1.99.1.1.1.6.15 = STRING: "celsius"
# .1.3.6.1.2.1.99.1.1.1.6.16 = STRING: "celsius"
#
# sample string_table
# [
# [
# ['Chassis', '', '', '', ''],
# ['Processor 0/0', '', '', '', ''],
# ['Processor 0/1', '', '', '', ''],
# ['Processor 0/2', '', '', '', ''],
# ['ASA5515 Slot for Removable Drive 0', '', '', '', ''],
# ['Micron_M550_MTFDDAK128MAY Removable Drive in Slot 0', '', '', '', ''],
# ['Chassis Cooling Fan 1', '', '', '', ''],
# ['Chassis Fan Sensor 1', '10', '7680', '1', 'rpm'],
# ['Chassis Cooling Fan 2', '', '', '', ''],
# ['Chassis Fan Sensor 2', '10', '7936', '1', 'rpm'],
# ['Chassis Cooling Fan 3', '', '', '', ''],
# ['Chassis Fan Sensor 3', '10', '7680', '1', 'rpm'],
# ['CPU Temperature Sensor 0/0', '8', '34', '1', 'celsius'],
# ['Chassis Ambient Temperature Sensor 1', '8', '32', '1', 'celsius'],
# ['Chassis Ambient Temperature Sensor 2', '8', '30', '1', 'celsius'],
# ['Chassis Ambient Temperature Sensor 3', '8', '33', '1', 'celsius'],
# ['Gi0/0', '', '', '', ''],
# ['Gi0/1', '', '', '', ''],
# ['Gi0/2', '', '', '', ''],
# ['Gi0/3', '', '', '', ''],
# ['Gi0/4', '', '', '', ''],
# ['Gi0/5', '', '', '', ''],
# ['In0/0', '', '', '', ''],
# ['In0/1', '', '', '', ''],
# ['Ma0/0', '', '', '', ''],
# ['Po1', '', '', '', '']
# ]
# ]
#
# sample section
#
# {'fan': {'Chassis Sensor 1': CiscoAsaSensor(value=7680, status=<State.OK: 0>, state_readable='Ok', unit='rpm'),
# 'Chassis Sensor 2': CiscoAsaSensor(value=7936, status=<State.OK: 0>, state_readable='Ok', unit='rpm'),
# 'Chassis Sensor 3': CiscoAsaSensor(value=7680, status=<State.OK: 0>, state_readable='Ok', unit='rpm')},
# 'temp': {'CPU Sensor 0/0': CiscoAsaSensor(value=34.0, status=<State.OK: 0>, state_readable='Ok', unit='celsius'),
# 'Chassis Ambient Sensor 1': CiscoAsaSensor(value=32.0, status=<State.OK: 0>, state_readable='Ok', unit='celsius'),
# 'Chassis Ambient Sensor 2': CiscoAsaSensor(value=30.0, status=<State.OK: 0>, state_readable='Ok', unit='celsius'),
# 'Chassis Ambient Sensor 3': CiscoAsaSensor(value=33.0, status=<State.OK: 0>, state_readable='Ok', unit='celsius')},
# 'power': {}}
#
from typing import Mapping, Dict, List, Tuple, NamedTuple
from typing import Dict, List, NamedTuple
from .agent_based_api.v1.type_defs import (
DiscoveryResult,
......@@ -30,14 +123,11 @@ from .agent_based_api.v1.type_defs import (
from .agent_based_api.v1 import (
register,
Service,
equals,
Result,
check_levels,
State,
SNMPTree,
startswith,
all_of,
any_of,
)
......@@ -147,7 +237,7 @@ from .utils.temperature import (
def discovery_cisco_asa_temp(section: Dict) -> DiscoveryResult:
for key in section['temp']:
yield Service(item=key) # , parameters={'asgNetIfSpeed': section[item].asgNetIfSpeed})
yield Service(item=key)
def check_cisco_asa_temp(item, params: TempParamType, section) -> CheckResult:
......@@ -191,7 +281,7 @@ def render_rpm(value) -> str:
def discovery_cisco_asa_fan(section: Dict) -> DiscoveryResult:
for key in section['fan']:
yield Service(item=key) # , parameters={'asgNetIfSpeed': section[item].asgNetIfSpeed})
yield Service(item=key)
def check_cisco_asa_fan(item, params: TempParamType, section) -> CheckResult:
......@@ -232,7 +322,7 @@ register.check_plugin(
def discovery_cisco_asa_power(section: Dict) -> DiscoveryResult:
for key in section['power']:
yield Service(item=key) # , parameters={'asgNetIfSpeed': section[item].asgNetIfSpeed})
yield Service(item=key)
def check_cisco_asa_power(item, params: TempParamType, section) -> CheckResult:
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment