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

cleanup

parents
Branches master
No related tags found
No related merge requests found
# Cisco ASA connections
Monitors the number of connections on as Cisco ASA firewall
Check Info:
* *service*: the check creates the service *Cisco ASA connections*
* *state*: **critical**/**warning** if the number of concurrent connections is outsode the configured levels
* *wato*: you can configure the warn/crit level vor the number of connections, also you can configure a minimum number of conections
* *perfdata*:
* maximum connections (count)
* current connections (count)
Sample output
![sample output](/doc/sample.png?raw=true "sample [SHORT TITLE]")
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# created by Th.L.:
# Monitors Cisco ASA connection count
# works with Cisco ASA 55xx and later
# tested witch 5506W and 5512-X, 5585-SSP2
# 24.03.2016: changed "snmp_scan_function" from ".1.3.6.1.2.1.1.2.0" to ".1.3.6.1.2.1.1.1.0"
# 02.07.2016: fixed crit/warn to >=
# 09.01.2018: some fine tuning (changed infotext)
#
# sample snmp walk
#
# .1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.6 = Gauge32: 16684
# .1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.7 = Gauge32: 46797
#
# sample info
#
# [[u'16684'], [u'46797']]
#
# connection levels (war,crit,minimum)
cisco_asa_connections_default_levels = (3000, 5000,100)
def inventory_cisco_asa_connections(info):
current_connections = info[0]
max_connections = info[1]
return [(None, cisco_asa_connections_default_levels)]
def check_cisco_asa_connections(item, params, info):
warn, crit, minimum = params
current_connections = int(info[0][0])
max_connections = int(info[1][0])
perfdata = [('current_connections', current_connections, warn, crit, '', ''), ('max_connections', max_connections)]
infotext = 'item not found'
if current_connections >= crit:
infotext = '%d (>=%d)(!!)/%d current/max connections' % (current_connections, crit, max_connections)
return 2, infotext, perfdata
elif current_connections >= warn:
infotext = '%d (>=%d)(!)/%d current/max connections' % (current_connections, warn, max_connections)
return 1, infotext, perfdata
elif current_connections < minimum:
infotext = '%d (<%d)(!!)/%d current/max connections' % (current_connections, minimum, max_connections)
return 2, infotext, perfdata
else:
infotext = '%d/%d current/max connections' % (current_connections, max_connections)
return 0, infotext, perfdata
check_info['cisco_asa_connections'] = {
'check_function' : check_cisco_asa_connections,
'inventory_function' : inventory_cisco_asa_connections,
'service_description': 'Cisco ASA connections',
'has_perfdata' : True,
'group' : 'cisco_asa_connections',
'snmp_scan_function' : lambda oid: oid('.1.3.6.1.2.1.1.1.0').lower().startswith('cisco adaptive security appliance'),
'snmp_info' : ('.1.3.6.1.4.1.9.9.147.1.2.2.2.1', [
'5' # CISCO-FIREWALL-MIB::cfwConnectionStatValue
]),
}
File added
doc/sample.png

44.3 KiB

{'author': u'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': u'monitors Cisco ASA number of connetions\nMinimum/Warning/Critical temperature level can be configured via wato.\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'checks': ['cisco_asa_connections'],
'web': ['plugins/wato/cisco_asa_connections.py',
'plugins/metrics/cisco_asa_connections.py']},
'name': 'cisco_asa_connections',
'num_files': 3,
'title': u'Monitor Cisco ASA connections',
'version': '20180326.v.0.3',
'version.min_required': '1.2.6p12',
'version.packaged': '1.4.0p35'}
\ No newline at end of file
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Cisco ASA connections metrics plugin
#
# Author: Th.L.
# Date : 2018-01-09
#
#####################################################################################################################
#
# define units for cisco_asa_connections perfdata
#
#####################################################################################################################
#####################################################################################################################
#
# define metrics for cisco_asa_connections perfdata
#
#####################################################################################################################
metric_info['cisco_asa_connections_current_connections'] = {
'title': _('current conections'),
'unit': 'count',
'color': '11/a',
}
metric_info['cisco_asa_connections_max_connections'] = {
'title': _('max conections'),
'unit': 'count',
'color': '21/a',
}
######################################################################################################################
#
# map cisco_asa_connections perfdata to metric, not really necessary but makes sure to use the right metrics
#
######################################################################################################################
check_metrics['check_mk-cisco_asa_connections'] = {
'current_connections': {'name': 'cisco_asa_connections_current_connections', },
'max_connections': {'name': 'cisco_asa_connections_max_connections',}
}
######################################################################################################################
#
# how to graph perdata for cisco_asa_connections
#
######################################################################################################################
graph_info.append({
'title': _('connections'),
'metrics': [
('cisco_asa_connections_current_connections', 'line'),
('cisco_asa_connections_max_connections', 'line'),
],
'scalars': [
('cisco_asa_connections_current_connections:crit', _('crit level')),
('cisco_asa_connections_current_connections:warn', _('warn level')),
],
})
######################################################################################################################
#
# define perf-o-meter for cisco_asa_connections rpm
#
######################################################################################################################
perfometer_info.append({
'type': 'logarithmic',
'metric': 'cisco_asa_connections_current_connections',
'half_value': 50000.0,
'exponent': 2,
})
\ No newline at end of file
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# Author : Th.L.
# Content: wato plugin for snmp check 'cisco_asa_connections'
# to configure waring/critical levels
#
#
register_check_parameters(
subgroup_networking,
'cisco_asa_connections',
_('Cisco ASA current connections'),
Tuple(
title=_('Cisco ASA current connections'),
elements=[
Integer(title=_('warning at'), unit=_(' connections'), default_value=3000),
Integer(title=_('critical at'), unit=_(' connections'), default_value=5000),
Integer(title=_('minimum'), unit=_(' connections'), default_value=100),
]
),
None, None
)
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