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

update project

parent 43773916
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -18,8 +18,15 @@
# 07.06.2020 : code cleanup
# added wato
# wadded warn/crit for connection rate
# 08.06.2020: changed snmp-scan function
# code cleanup
#
# sample info
# [[[u'559684419', u'203840211', u'51093794', u'786231', u'815404655', u'0']], [[u'11172', u'27598', u'0']]]
#
# no firewall
# [[], []]
#
factory_settings['checkpoint_fw_connections_defaults'] = {
# 'warncritcurrent': (1000, 2000),
# 'warncritnew': (100, 200)
......@@ -27,7 +34,8 @@ factory_settings['checkpoint_fw_connections_defaults'] = {
def inventory_checkpoint_fw_connections(info):
return [(None, {})]
if info != [[], []]:
return [(None, None)]
def check_checkpoint_fw_connections(item, params, info):
......@@ -36,15 +44,7 @@ def check_checkpoint_fw_connections(item, params, info):
fwConnectionsTcp, fwConnectionsUdp, fwConnectionsIcmp, fwConnectionsOther, fwConnectionsSum, fwConnectionRate = fwConnectionsStat[0]
fwCurrnetNumConn, fwPeakNumConn, fwConnTableLimit = fwpolicystat[0]
now_time = time.time()
fwConnectionsTcp = get_rate('checkpoint_fw_connections.%s.%s' % ('fwConnectionsTcp', item), now_time, int(fwConnectionsTcp), onwrap=SKIP)
fwConnectionsUdp = get_rate('checkpoint_fw_connections.%s.%s' % ('fwConnectionsUdp', item), now_time, int(fwConnectionsUdp), onwrap=SKIP)
fwConnectionsIcmp = get_rate('checkpoint_fw_connections.%s.%s' % ('fwConnectionsIcmp', item), now_time, int(fwConnectionsIcmp), onwrap=SKIP)
fwConnectionsOther = get_rate('checkpoint_fw_connections.%s.%s' % ('fwConnectionsOther', item), now_time, int(fwConnectionsOther), onwrap=SKIP)
fwConnectionsSum = get_rate('checkpoint_fw_connections.%s.%s' % ('fwConnectionsSum', item), now_time, int(fwConnectionsSum), onwrap=SKIP)
fwConnectionRate = int(fwConnectionRate)
fwCurrnetNumConn = int(fwCurrnetNumConn)
fwPeakNumConn = int(fwPeakNumConn)
fwConnTableLimit = int (fwConnTableLimit)
......@@ -72,13 +72,18 @@ def check_checkpoint_fw_connections(item, params, info):
infotext = 'peak: %d, table limit: %s' % (fwPeakNumConn, fwConnTableLimit)
perfdata = [('fwconnectionstcp', fwConnectionsTcp),
('fwconnectionsudp', fwConnectionsUdp),
('fwconnectionsicmp', fwConnectionsIcmp),
('fwconnectionsother', fwConnectionsOther),
('fwconnectionssum', fwConnectionsSum),
('fwpeaknumconn', fwPeakNumConn)
]
perfdata = [('fwpeaknumconn', fwPeakNumConn)]
now_time = time.time()
for counter, value in [
('fwconnectionstcp', fwConnectionsTcp),
('fwconnectionsudp', fwConnectionsUdp),
('fwconnectionsicmp', fwConnectionsIcmp),
('fwconnectionsother', fwConnectionsOther),
('fwconnectionssum', fwConnectionsSum),
]:
value = get_rate('checkpoint_fw_connections.%s' % counter, now_time, int(value), onwrap=SKIP)
perfdata.append((counter, value))
yield 0, infotext , perfdata
......@@ -90,10 +95,9 @@ check_info['checkpoint_fw_connections'] = {
'has_perfdata': True,
'group': 'checkpoint_fw_connections',
'default_levels_variable': 'checkpoint_fw_connections_defaults',
'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 # CheckPoint System
oid('.1.3.6.1.2.1.1.2.0') in ['.1.3.6.1.4.1.8072.3.2.10', ]) and # Virtual System (Linux)
oid('.1.3.6.1.4.1.2620.1.1.26.11.1.0')), # CHECKPOINT-MIB::fwConnectionsStatConnectionsTcp.0
'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').startswith('.1.3.6.1.4.1.8072.3.2.10')) and
oid('.1.3.6.1.4.1.2620.1.6.1.0', '').lower().startswith('svn foundation'),
'snmp_info': [('.1.3.6.1.4.1.2620.1.1.26.11', [ # CHECKPOINT-MIB::fwConnectionsStat
'1', # fwConnectionsStatConnectionsTcp
'2', # fwConnectionsStatConnectionsUdp
......
......@@ -7,6 +7,6 @@
'name': 'checkpoint_fw_connections',
'num_files': 3,
'title': u'Check Point Connections',
'version': '20200607.v.0.0.2',
'version': '20200608.v.0.0.2a',
'version.min_required': '1.2.8b8',
'version.packaged': '1.4.0p38'}
\ No newline at end of file
......@@ -46,7 +46,7 @@ metric_info['checkpoint_fw_connections_fwconnectionsother'] = {
metric_info['checkpoint_fw_connections_fwconnectionssum'] = {
'title': _('Total connections'),
'unit': '1/s',
'color': '26/a',
'color': '15/a',
}
metric_info['checkpoint_fw_connections_fwconnectionrate'] = {
'title': _('Connections rate'),
......@@ -62,7 +62,7 @@ metric_info['checkpoint_fw_connections_fwcurrentnumconn'] = {
metric_info['checkpoint_fw_connections_fwpeaknumconn'] = {
'title': _('Peak Connections'),
'unit': 'count',
'color': '15/a',
'color': '16/a',
}
......
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