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

Delete checkpoint_asg_path_distribution

parent 0f1e3a68
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
#
# License: GNU General Public License v2
#
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2020-11-09
#
# Monitor Check Point Maestro SMO SGM Path distribution like Accel Path, Medium Path, Firewall Path and dropped
#
# sample snmpwalk (for one existing SGM)
# .1.3.6.1.4.1.2620.1.48.20.24.1.1.1.0 = Gauge32: 1
# .1.3.6.1.4.1.2620.1.48.20.24.1.1.2.0 = Gauge32: 2
# .1.3.6.1.4.1.2620.1.48.20.24.1.1.3.0 = Gauge32: 3
# .1.3.6.1.4.1.2620.1.48.20.24.1.1.4.0 = Gauge32: 4
# .1.3.6.1.4.1.2620.1.48.20.24.1.2.1.0 = STRING: "Packet rate"
# .1.3.6.1.4.1.2620.1.48.20.24.1.2.2.0 = STRING: "Throughput"
# .1.3.6.1.4.1.2620.1.48.20.24.1.2.3.0 = STRING: "Connection rate"
# .1.3.6.1.4.1.2620.1.48.20.24.1.2.4.0 = STRING: "Concurrent connections"
# .1.3.6.1.4.1.2620.1.48.20.24.1.3.1.0 = STRING: "50"
# .1.3.6.1.4.1.2620.1.48.20.24.1.3.2.0 = STRING: "94555"
# .1.3.6.1.4.1.2620.1.48.20.24.1.3.3.0 = STRING: "0"
# .1.3.6.1.4.1.2620.1.48.20.24.1.3.4.0 = STRING: "9"
# .1.3.6.1.4.1.2620.1.48.20.24.1.4.1.0 = STRING: "34"
# .1.3.6.1.4.1.2620.1.48.20.24.1.4.2.0 = STRING: "17247"
# .1.3.6.1.4.1.2620.1.48.20.24.1.4.3.0 = STRING: "0"
# .1.3.6.1.4.1.2620.1.48.20.24.1.4.4.0 = STRING: "3"
# .1.3.6.1.4.1.2620.1.48.20.24.1.5.1.0 = STRING: "0"
# .1.3.6.1.4.1.2620.1.48.20.24.1.5.2.0 = STRING: "0"
# .1.3.6.1.4.1.2620.1.48.20.24.1.5.3.0 = STRING: "0"
# .1.3.6.1.4.1.2620.1.48.20.24.1.5.4.0 = STRING: "79"
# .1.3.6.1.4.1.2620.1.48.20.24.1.6.1.0 = STRING: "0"
# .1.3.6.1.4.1.2620.1.48.20.24.1.6.2.0 = STRING: "0"
# .1.3.6.1.4.1.2620.1.48.20.24.1.6.3.0 = STRING: "0"
# .1.3.6.1.4.1.2620.1.48.20.24.1.6.4.0 = STRING: "0"
#
# sample info
# [
# [u'Packet rate', u'50', u'34', u'0', u'0'],
# [u'Throughput', u'94555', u'17247', u'0', u'0'],
# [u'Connection rate', u'0', u'0', u'0', u'0'],
# [u'Concurrent connections', u'9', u'3', u'79', u'0']
# ]
#
def parse_checkpoint_asg_path_distribution(info):
items = {}
for entry in info:
asgStatName, asgAccelPath, asgMediumPath, asgFirewallPath, asgDropped = entry
item = '%s' % (asgStatName)
items.update({item: {
'asgAccelPath': int(asgAccelPath),
'asgMediumPath': int(asgMediumPath),
'asgFirewallPath': int(asgFirewallPath),
'asgDropped': int(asgDropped),
}
})
return items
def inventory_checkpoint_asg_path_distribution(parsed):
# sample parsed
# {
# u'Connection rate': {'asgAccelPath': 0, 'asgFirewallPath': u'0', 'asgMediumPath': u'0', 'asgDropped': u'0'},
# u'Throughput': {'asgAccelPath': 94555, 'asgFirewallPath': u'0', 'asgMediumPath': u'17247', 'asgDropped': u'0'},
# u'Packet rate': {'asgAccelPath': 50, 'asgFirewallPath': u'0', 'asgMediumPath': u'34', 'asgDropped': u'0'},
# u'Concurrent connections': {'asgAccelPath': 9, 'asgFirewallPath': u'79', 'asgMediumPath': u'3', 'asgDropped': u'0'}
# }
for item in parsed.keys():
yield item, None
def check_checkpoint_asg_path_distribution(item, params, parsed):
try:
entry = parsed[item]
asgAccelPath = entry['asgAccelPath']
asgMediumPath = entry['asgMediumPath']
asgFirewallPath = entry['asgFirewallPath']
asgDropped = entry['asgDropped']
if params:
pass
now_time = time.time()
rate_item = item.lower().replace(' ', '_').replace(':', '_')
# rx_bits = get_rate('checkpoint_asg_path_distribution.%s.%s' % ('asgNetIfRx', rate_item), now_time, asg_interface['asgNetIfRx'] * 8, onwrap=SKIP)
perfdata = []
perfdata.append(('asg_path_accel', asgAccelPath, None, None, None, None))
perfdata.append(('asg_path_medium', asgMediumPath, None, None, None, None))
perfdata.append(('asg_path_firewall', asgFirewallPath, None, None, None, None))
perfdata.append(('asg_path_drop', asgDropped, None, None, None, None))
longoutput = ''
infotext = 'Acceleration/Medium/Firewall/Dropped: %d/%d/%d/%d' %(asgAccelPath, asgMediumPath, asgFirewallPath,asgDropped)
yield 0, infotext + longoutput, perfdata
except KeyError:
pass
check_info['checkpoint_asg_path_distribution'] = {
'check_function': check_checkpoint_asg_path_distribution,
'inventory_function': inventory_checkpoint_asg_path_distribution,
'service_description': "ASG dist %s",
'snmp_scan_function': scan_checkpoint,
'parse_function': parse_checkpoint_asg_path_distribution,
'group': 'checkpoint_asg_path_distribution',
'has_perfdata': True,
'snmp_info': (
'.1.3.6.1.4.1.2620.1.48.20.24.1', # CHECKPOINT-MIB::asgPathDistEntry
[
'2', # asgStatName
'3', # asgAccelPath
'4', # asgMediumPath
'5', # asgFirewallPath
'6', # asgDropped
]),
'includes': ['checkpoint.include'],
}
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