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

Update checkpoint_sxl_status

parent e230e177
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python #!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*- # -*- encoding: utf-8; py-indent-offset: 4 -*-
# #
# Monitor status of Check Point SecureXL # Monitor status of Check Point SecureXL
# #
# Author: Th.L. # Author: Th.L.
# Date : 2018-03-14 # Date : 2018-03-14
# #
# #
# snmpwalk sample # snmpwalk sample
# #
# CHECKPOINT-MIB::fwSXLStatus.0 = INTEGER: enabled(1) # CHECKPOINT-MIB::fwSXLStatus.0 = INTEGER: enabled(1)
# CHECKPOINT-MIB::fwSXLConnsExisting.0 = Wrong Type (should be INTEGER): Gauge32: 51 # CHECKPOINT-MIB::fwSXLConnsExisting.0 = Wrong Type (should be INTEGER): Gauge32: 51
# CHECKPOINT-MIB::fwSXLConnsAdded.0 = Wrong Type (should be INTEGER): Gauge32: 630 # CHECKPOINT-MIB::fwSXLConnsAdded.0 = Wrong Type (should be INTEGER): Gauge32: 630
# CHECKPOINT-MIB::fwSXLConnsDeleted.0 = Wrong Type (should be INTEGER): Gauge32: 578 # CHECKPOINT-MIB::fwSXLConnsDeleted.0 = Wrong Type (should be INTEGER): Gauge32: 578
# #
# .1.3.6.1.4.1.2620.1.36.1.1.0 = INTEGER: 1 # .1.3.6.1.4.1.2620.1.36.1.1.0 = INTEGER: 1
# .1.3.6.1.4.1.2620.1.36.1.2.0 = Gauge32: 40 # .1.3.6.1.4.1.2620.1.36.1.2.0 = Gauge32: 40
# .1.3.6.1.4.1.2620.1.36.1.3.0 = Gauge32: 645 # .1.3.6.1.4.1.2620.1.36.1.3.0 = Gauge32: 645
# .1.3.6.1.4.1.2620.1.36.1.4.0 = Gauge32: 604 # .1.3.6.1.4.1.2620.1.36.1.4.0 = Gauge32: 604
# #
# sample info # sample info
# #
# [[u'1', u'48', u'7932', u'7986']] # [[u'1', u'48', u'7932', u'7986']]
# #
factory_settings['checkpoint_sxl_status_defaults'] = { factory_settings['checkpoint_sxl_status_defaults'] = {
} }
def inventory_checkpoint_sxl_status(info): def inventory_checkpoint_sxl_status(info):
return [(None, None)] return [(None, None)]
def check_checkpoint_sxl_status(item, params, info): def check_checkpoint_sxl_status(item, params, info):
state = 3 state = 3
infotext = 'Item not found' infotext = 'Item not found'
longoutput = '' longoutput = ''
perfdata = [] perfdata = []
now_time = time.time() now_time = time.time()
fwSXLStatus, fwSXLConnsExisting, fwSXLConnsAdded, fwSXLConnsDeleted = info[0] fwSXLStatus, fwSXLConnsExisting, fwSXLConnsAdded, fwSXLConnsDeleted = info[0]
if int(fwSXLStatus) == 1:
fwSXLConnsExisting = int(fwSXLConnsExisting) # ToDo: in R80.30 status is allways zero :-(
fwSXLConnsAdded = get_rate('checkpoint_sxl_status.%s.%s' % ('fwSXLConnsAdded', item), now_time, int(fwSXLConnsAdded), onwrap=SKIP) if int(fwSXLStatus) == 1:
fwSXLConnsDeleted = get_rate('checkpoint_sxl_status.%s.%s' % ('fwSXLConnsDeleted', item), now_time, int(fwSXLConnsDeleted), onwrap=SKIP) fwSXLConnsExisting = int(fwSXLConnsExisting)
fwSXLConnsAdded = get_rate('checkpoint_sxl_status.%s.%s' % ('fwSXLConnsAdded', item), now_time, int(fwSXLConnsAdded), onwrap=SKIP)
# Counters fwSXLConnsDeleted = get_rate('checkpoint_sxl_status.%s.%s' % ('fwSXLConnsDeleted', item), now_time, int(fwSXLConnsDeleted), onwrap=SKIP)
infotext = 'Connections: Active %d, Added: %0.2f/s, Deleted: %0.2f/s' % (fwSXLConnsExisting, fwSXLConnsAdded, fwSXLConnsDeleted)
# Counters
perfdata = [('connections_active', fwSXLConnsExisting), infotext = 'Connections: Active %d, Added: %0.2f/s, Deleted: %0.2f/s' % (fwSXLConnsExisting, fwSXLConnsAdded, fwSXLConnsDeleted)
('connections_added', fwSXLConnsAdded),
('connections_deleted', fwSXLConnsDeleted), perfdata = [('connections_active', fwSXLConnsExisting),
] ('connections_added', fwSXLConnsAdded),
('connections_deleted', fwSXLConnsDeleted),
return 0, infotext + longoutput, perfdata ]
else: return 0, infotext + longoutput, perfdata
return 1, 'SXL not enabled'
else:
return 1, 'SXL not enabled'
check_info['checkpoint_sxl_status'] = {
'check_function' : check_checkpoint_sxl_status,
'inventory_function' : inventory_checkpoint_sxl_status, check_info['checkpoint_sxl_status'] = {
'service_description' : 'SecureXL', 'check_function' : check_checkpoint_sxl_status,
'has_perfdata' : True, 'inventory_function' : inventory_checkpoint_sxl_status,
#'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 'service_description' : 'SecureXL',
# '.1.3.6.1.4.1.2620.1.6.123.1.65', # Appliance 'has_perfdata' : True,
# '.1.3.6.1.4.1.2620.1.6.123.1.64', # VSX Gateway #'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.62', # 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.49', # R77.30 Gateway # '.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.48', # Mgmt # '.1.3.6.1.4.1.2620.1.6.123.1.62', # Gateway
# '.1.3.6.1.4.1.8072.3.2.10'] # Virtual System (Linux), # '.1.3.6.1.4.1.2620.1.6.123.1.49', # R77.30 Gateway
'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 # '.1.3.6.1.4.1.2620.1.6.123.1.48', # Mgmt
oid('.1.3.6.1.2.1.1.2.0') in ['.1.3.6.1.4.1.8072.3.2.10',]) # Virtual System (Linux) # '.1.3.6.1.4.1.8072.3.2.10'] # Virtual System (Linux),
and oid('.1.3.6.1.4.1.2620.1.36.1.1.0'), # CHECKPOINT-MIB::fwSXLStatus '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
'group' : 'checkpoint_sxl_status', oid('.1.3.6.1.2.1.1.2.0') in ['.1.3.6.1.4.1.8072.3.2.10',]) # Virtual System (Linux)
'default_levels_variable': 'checkpoint_sxl_status_defaults', and oid('.1.3.6.1.4.1.2620.1.36.1.1.0'), # CHECKPOINT-MIB::fwSXLStatus
'snmp_info' : ( '.1.3.6.1.4.1.2620.1.36.1', [ 'group' : 'checkpoint_sxl_status',
'1', # fwSXLStatus 'default_levels_variable': 'checkpoint_sxl_status_defaults',
'2', # fwSXLConnsExisting 'snmp_info' : ( '.1.3.6.1.4.1.2620.1.36.1', [
'3', # fwSXLConnsAdded '1', # fwSXLStatus
'4', # fwSXLConnsDeleted '2', # fwSXLConnsExisting
]), '3', # fwSXLConnsAdded
} '4', # fwSXLConnsDeleted
]),
}
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