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 84edae96 authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

update project

parent b9a3a44f
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
# 2020-02-24: added support for Cisco Firepower Threat Defense # 2020-02-24: added support for Cisco Firepower Threat Defense
# 2020-04-28: changed item from Cisco ASA connections to Firewall connections --> more clear, with cisco_asa_conn check # 2020-04-28: changed item from Cisco ASA connections to Firewall connections --> more clear, with cisco_asa_conn check
# 2021-03-24: rewrite for CMK 2.0 Check API, added lower levels # 2021-03-24: rewrite for CMK 2.0 Check API, added lower levels
# 2023-06-07: fixed IndexError (list index out of range) in parse function
# #
# sample snmp walk # sample snmp walk
# #
# .1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.6 = Gauge32: 4987 # .1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.6 = Gauge32: 4987
...@@ -30,7 +32,7 @@ ...@@ -30,7 +32,7 @@
# #
# #
from typing import List, NamedTuple from typing import NamedTuple, Optional
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import ( from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import (
DiscoveryResult, DiscoveryResult,
...@@ -54,11 +56,16 @@ class CiscoAsaFwConnections(NamedTuple): ...@@ -54,11 +56,16 @@ class CiscoAsaFwConnections(NamedTuple):
peak: int peak: int
# [[['1102', '2290']]] # [['1102', '2290']]
def parse_cisco_asa_connections(string_table: List[StringTable]) -> CiscoAsaFwConnections: def parse_cisco_asa_connections(string_table: StringTable) -> Optional[CiscoAsaFwConnections]:
try:
current, peak = string_table[0]
except (IndexError, ValueError):
return
return CiscoAsaFwConnections( return CiscoAsaFwConnections(
current=int(string_table[0][0][0]), current=int(current),
peak=int(string_table[0][0][1]) peak=int(peak)
) )
...@@ -87,15 +94,13 @@ def check_cisco_asa_connections(params, section: CiscoAsaFwConnections) -> Check ...@@ -87,15 +94,13 @@ def check_cisco_asa_connections(params, section: CiscoAsaFwConnections) -> Check
register.snmp_section( register.snmp_section(
name='cisco_asa_connections', name='cisco_asa_connections',
parse_function=parse_cisco_asa_connections, parse_function=parse_cisco_asa_connections,
fetch=[ fetch=SNMPTree(
SNMPTree( base='.1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40', # CISCO-FIREWALL-MIB::cfwConnectionStatValue.protoIp
base='.1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40', # CISCO-FIREWALL-MIB::cfwConnectionStatValue.protoIp oids=[
oids=[ '6', # currentInUse
'6', # currentInUse '7', # protoIp.high
'7', # protoIp.high ]
] ),
),
],
detect=any_of( detect=any_of(
startswith('.1.3.6.1.2.1.1.1.0', 'cisco adaptive security'), startswith('.1.3.6.1.2.1.1.1.0', 'cisco adaptive security'),
startswith('.1.3.6.1.2.1.1.1.0', 'cisco firepower threat defense'), startswith('.1.3.6.1.2.1.1.1.0', 'cisco firepower threat defense'),
......
#
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2023-06-07
#
# dummy for new cisco_asa_connections plugin
# ~/local/lib/check_mk/base/plugins/cisco_asa_connections.py
#
\ No newline at end of file
File added
No preview for this file type
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
'connections\n', 'connections\n',
'download_url': 'https://thl-cmk.hopto.org', 'download_url': 'https://thl-cmk.hopto.org',
'files': {'agent_based': ['cisco_asa_connections.py'], 'files': {'agent_based': ['cisco_asa_connections.py'],
'checks': ['cisco_asa_connections'],
'web': ['plugins/metrics/cisco_asa_connections.py', 'web': ['plugins/metrics/cisco_asa_connections.py',
'plugins/wato/cisco_fw_connections.py']}, 'plugins/wato/cisco_fw_connections.py']},
'name': 'cisco_asa_connections', 'name': 'cisco_asa_connections',
'num_files': 3,
'title': 'Monitor Cisco ASA connections', 'title': 'Monitor Cisco ASA connections',
'version': '20210324.v.0.4', 'version': '200607.v.0.5',
'version.min_required': '2.0.0', 'version.min_required': '2.0.0b1',
'version.packaged': '2.0.0p1', 'version.packaged': '2.1.0p21',
'version.usable_until': None} 'version.usable_until': None}
\ No newline at end of file
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