diff --git a/checks/checkpoint_sxl_status b/checks/checkpoint_sxl_status index 85dd1039eb2ba46f173207b1d925fa72afbf508d..7c404adba44b6dd42b2456a9af9b7edc74528152 100644 --- a/checks/checkpoint_sxl_status +++ b/checks/checkpoint_sxl_status @@ -1,87 +1,89 @@ -#!/usr/bin/python -# -*- encoding: utf-8; py-indent-offset: 4 -*- -# -# Monitor status of Check Point SecureXL -# -# Author: Th.L. -# Date : 2018-03-14 -# - -# -# snmpwalk sample -# -# CHECKPOINT-MIB::fwSXLStatus.0 = INTEGER: enabled(1) -# CHECKPOINT-MIB::fwSXLConnsExisting.0 = Wrong Type (should be INTEGER): Gauge32: 51 -# CHECKPOINT-MIB::fwSXLConnsAdded.0 = Wrong Type (should be INTEGER): Gauge32: 630 -# 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.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.4.0 = Gauge32: 604 -# -# sample info -# -# [[u'1', u'48', u'7932', u'7986']] -# - -factory_settings['checkpoint_sxl_status_defaults'] = { -} - - -def inventory_checkpoint_sxl_status(info): - return [(None, None)] - - -def check_checkpoint_sxl_status(item, params, info): - state = 3 - infotext = 'Item not found' - longoutput = '' - perfdata = [] - - now_time = time.time() - fwSXLStatus, fwSXLConnsExisting, fwSXLConnsAdded, fwSXLConnsDeleted = info[0] - - if int(fwSXLStatus) == 1: - fwSXLConnsExisting = int(fwSXLConnsExisting) - fwSXLConnsAdded = get_rate('checkpoint_sxl_status.%s.%s' % ('fwSXLConnsAdded', item), now_time, int(fwSXLConnsAdded), onwrap=SKIP) - fwSXLConnsDeleted = get_rate('checkpoint_sxl_status.%s.%s' % ('fwSXLConnsDeleted', item), now_time, int(fwSXLConnsDeleted), onwrap=SKIP) - - # Counters - infotext = 'Connections: Active %d, Added: %0.2f/s, Deleted: %0.2f/s' % (fwSXLConnsExisting, fwSXLConnsAdded, fwSXLConnsDeleted) - - perfdata = [('connections_active', fwSXLConnsExisting), - ('connections_added', fwSXLConnsAdded), - ('connections_deleted', fwSXLConnsDeleted), - ] - - return 0, infotext + longoutput, perfdata - - else: - return 1, 'SXL not enabled' - - -check_info['checkpoint_sxl_status'] = { - 'check_function' : check_checkpoint_sxl_status, - 'inventory_function' : inventory_checkpoint_sxl_status, - 'service_description' : 'SecureXL', - 'has_perfdata' : True, - #'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.36.1.1.0'), # CHECKPOINT-MIB::fwSXLStatus - 'group' : 'checkpoint_sxl_status', - 'default_levels_variable': 'checkpoint_sxl_status_defaults', - 'snmp_info' : ( '.1.3.6.1.4.1.2620.1.36.1', [ - '1', # fwSXLStatus - '2', # fwSXLConnsExisting - '3', # fwSXLConnsAdded - '4', # fwSXLConnsDeleted - ]), -} +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +# Monitor status of Check Point SecureXL +# +# Author: Th.L. +# Date : 2018-03-14 +# + +# +# snmpwalk sample +# +# CHECKPOINT-MIB::fwSXLStatus.0 = INTEGER: enabled(1) +# CHECKPOINT-MIB::fwSXLConnsExisting.0 = Wrong Type (should be INTEGER): Gauge32: 51 +# CHECKPOINT-MIB::fwSXLConnsAdded.0 = Wrong Type (should be INTEGER): Gauge32: 630 +# 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.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.4.0 = Gauge32: 604 +# +# sample info +# +# [[u'1', u'48', u'7932', u'7986']] +# + +factory_settings['checkpoint_sxl_status_defaults'] = { +} + + +def inventory_checkpoint_sxl_status(info): + return [(None, None)] + + +def check_checkpoint_sxl_status(item, params, info): + state = 3 + infotext = 'Item not found' + longoutput = '' + perfdata = [] + + now_time = time.time() + fwSXLStatus, fwSXLConnsExisting, fwSXLConnsAdded, fwSXLConnsDeleted = info[0] + + + # ToDo: in R80.30 status is allways zero :-( + if int(fwSXLStatus) == 1: + fwSXLConnsExisting = int(fwSXLConnsExisting) + fwSXLConnsAdded = get_rate('checkpoint_sxl_status.%s.%s' % ('fwSXLConnsAdded', item), now_time, int(fwSXLConnsAdded), onwrap=SKIP) + fwSXLConnsDeleted = get_rate('checkpoint_sxl_status.%s.%s' % ('fwSXLConnsDeleted', item), now_time, int(fwSXLConnsDeleted), onwrap=SKIP) + + # Counters + infotext = 'Connections: Active %d, Added: %0.2f/s, Deleted: %0.2f/s' % (fwSXLConnsExisting, fwSXLConnsAdded, fwSXLConnsDeleted) + + perfdata = [('connections_active', fwSXLConnsExisting), + ('connections_added', fwSXLConnsAdded), + ('connections_deleted', fwSXLConnsDeleted), + ] + + return 0, infotext + longoutput, perfdata + + else: + return 1, 'SXL not enabled' + + +check_info['checkpoint_sxl_status'] = { + 'check_function' : check_checkpoint_sxl_status, + 'inventory_function' : inventory_checkpoint_sxl_status, + 'service_description' : 'SecureXL', + 'has_perfdata' : True, + #'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.36.1.1.0'), # CHECKPOINT-MIB::fwSXLStatus + 'group' : 'checkpoint_sxl_status', + 'default_levels_variable': 'checkpoint_sxl_status_defaults', + 'snmp_info' : ( '.1.3.6.1.4.1.2620.1.36.1', [ + '1', # fwSXLStatus + '2', # fwSXLConnsExisting + '3', # fwSXLConnsAdded + '4', # fwSXLConnsDeleted + ]), +}