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

changed form checkpoint_connections to checkpoint_fw_connections

parent a33decfe
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation in version 2. check_mk is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
# tails. You should have received a copy of the GNU General Public
# License along with GNU Make; see the file COPYING. If not, write
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
#
# rewrite of the original checkpoint_connections check from check_mk
#
# Author: Th.L.
# Date : 2018-03-17
#
# added connection statistic details for tcp/udp/icmp/other .....
#
# 29.05.208 : added connection limit (fwConnTableLimit)
#
checkpoint_connections_default_levels = (40000, 50000)
def inventory_checkpoint_connections(info):
return [(None, 'checkpoint_connections_default_levels')]
def check_checkpoint_connections(item, params, info):
fwConnectionsStat, fwpolicystat = info
fwConnectionsTcp, fwConnectionsUdp, fwConnectionsIcmp, fwConnectionsOther, fwConnections, fwConnectionRate = fwConnectionsStat[0]
fwNumConn, fwPeakNumConn, fwConnTableLimit = fwpolicystat[0]
now_time = time.time()
fwConnectionsTcp = get_rate('checkpoint_connections.%s.%s' % ('fwConnectionsTcp', item), now_time, int(fwConnectionsTcp), onwrap=SKIP)
fwConnectionsUdp = get_rate('checkpoint_connections.%s.%s' % ('fwConnectionsUdp', item), now_time, int(fwConnectionsUdp), onwrap=SKIP)
fwConnectionsIcmp = get_rate('checkpoint_connections.%s.%s' % ('fwConnectionsIcmp', item), now_time, int(fwConnectionsIcmp), onwrap=SKIP)
fwConnectionsOther = get_rate('checkpoint_connections.%s.%s' % ('fwConnectionsOther', item), now_time, int(fwConnectionsOther), onwrap=SKIP)
fwConnections = get_rate('checkpoint_connections.%s.%s' % ('fwConnections', item), now_time, int(fwConnections), onwrap=SKIP)
fwConnectionRate = int(fwConnectionRate)
fwNumConn = int(fwNumConn)
fwPeakNumConn = int(fwPeakNumConn)
fwConnTableLimit = int (fwConnTableLimit)
warn, crit = params
perfdata = [('fwconnectionstcp', fwConnectionsTcp),
('fwconnectionsudp', fwConnectionsUdp),
('fwconnectionsicmp', fwConnectionsIcmp),
('fwconnectionsother', fwConnectionsOther),
('fwconnections', fwConnections),
('connections', fwNumConn, warn, crit, 0, fwConnTableLimit),
('fwpeaknumconn', fwPeakNumConn)
]
state = 0
infotext = ''
infotext += '%d current' % fwNumConn
infotext += ', %d peak' % fwPeakNumConn
infotext += ', %d table limit' % fwConnTableLimit
infotext += ', %d rate' % fwConnectionRate
if fwConnections >= crit:
state = 2
elif fwConnections >= warn:
state = 1
if state > 0:
infotext += ' (warn/crit at %d/%d)' % (warn, crit)
return state, infotext, perfdata
check_info['checkpoint_connections'] = {
'check_function' : check_checkpoint_connections,
'inventory_function' : inventory_checkpoint_connections,
'service_description': 'Connections',
'has_perfdata' : True,
'group' : 'checkpoint_connections',
#'snmp_scan_function': lambda oid: oid('.1.3.6.1.2.1.1.2.0') in ['.1.3.6.1.4.1.2620.1.6.123.1.67', # ClusterXL Gateway
# '.1.3.6.1.4.1.2620.1.6.123.1.65', # Appliance
# '.1.3.6.1.4.1.2620.1.6.123.1.64', # VSX Gateway
# '.1.3.6.1.4.1.2620.1.6.123.1.62', # Gateway
# '.1.3.6.1.4.1.2620.1.6.123.1.49', # R77.30 Gateway
# '.1.3.6.1.4.1.2620.1.6.123.1.48', # Mgmt
# '.1.3.6.1.4.1.8072.3.2.10'] # Virtual System (Linux),
'snmp_scan_function': lambda oid: (oid('.1.3.6.1.2.1.1.2.0').startswith('.1.3.6.1.4.1.2620.1.6.123.1') or
oid('.1.3.6.1.2.1.1.2.0') in ['.1.3.6.1.4.1.8072.3.2.10',]) # Virtual System (Linux)
and oid('.1.3.6.1.4.1.2620.1.1.26.11.1.0'), # CHECKPOINT-MIB::fwConnectionsStatConnectionsTcp.0
'snmp_info' : [('.1.3.6.1.4.1.2620.1.1.26.11', [
'1', # fwConnectionsStatConnectionsTcp
'2', # fwConnectionsStatConnectionsUdp
'3', # fwConnectionsStatConnectionsIcmp
'4', # fwConnectionsStatConnectionsOther
'5', # fwConnectionsStatConnections
'6', # fwConnectionsStatConnectionRate
]),
('.1.3.6.1.4.1.2620.1.1.25', [ # CHECKPOINT-MIB::fwPolicyStat
'3', # fwNumConn
'4', # fwPeakNumConn
'10', # fwConnTableLimit
])
]
}
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