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
Branches master
No related tags found
No related merge requests found
......@@ -19,7 +19,9 @@
# 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
# 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
#
# .1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.6 = Gauge32: 4987
......@@ -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 (
DiscoveryResult,
......@@ -54,11 +56,16 @@ class CiscoAsaFwConnections(NamedTuple):
peak: int
# [[['1102', '2290']]]
def parse_cisco_asa_connections(string_table: List[StringTable]) -> CiscoAsaFwConnections:
# [['1102', '2290']]
def parse_cisco_asa_connections(string_table: StringTable) -> Optional[CiscoAsaFwConnections]:
try:
current, peak = string_table[0]
except (IndexError, ValueError):
return
return CiscoAsaFwConnections(
current=int(string_table[0][0][0]),
peak=int(string_table[0][0][1])
current=int(current),
peak=int(peak)
)
......@@ -87,15 +94,13 @@ def check_cisco_asa_connections(params, section: CiscoAsaFwConnections) -> Check
register.snmp_section(
name='cisco_asa_connections',
parse_function=parse_cisco_asa_connections,
fetch=[
SNMPTree(
base='.1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40', # CISCO-FIREWALL-MIB::cfwConnectionStatValue.protoIp
oids=[
'6', # currentInUse
'7', # protoIp.high
]
),
],
fetch=SNMPTree(
base='.1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40', # CISCO-FIREWALL-MIB::cfwConnectionStatValue.protoIp
oids=[
'6', # currentInUse
'7', # protoIp.high
]
),
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 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 @@
'connections\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'agent_based': ['cisco_asa_connections.py'],
'checks': ['cisco_asa_connections'],
'web': ['plugins/metrics/cisco_asa_connections.py',
'plugins/wato/cisco_fw_connections.py']},
'name': 'cisco_asa_connections',
'num_files': 3,
'title': 'Monitor Cisco ASA connections',
'version': '20210324.v.0.4',
'version.min_required': '2.0.0',
'version.packaged': '2.0.0p1',
'version': '200607.v.0.5',
'version.min_required': '2.0.0b1',
'version.packaged': '2.1.0p21',
'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