diff --git a/checkpoint_asg_smo_counters.mkp b/checkpoint_asg_smo_counters.mkp new file mode 100644 index 0000000000000000000000000000000000000000..8da2e24319a8daf55b64a9d9934c86bdf0132650 Binary files /dev/null and b/checkpoint_asg_smo_counters.mkp differ diff --git a/checks/checkpoint_asg_smo_counters b/checks/checkpoint_asg_smo_counters new file mode 100644 index 0000000000000000000000000000000000000000..142919c6a56a4d673b79064d6d23e7f58cef88a3 --- /dev/null +++ b/checks/checkpoint_asg_smo_counters @@ -0,0 +1,175 @@ +#!/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 Counters +# +# sample snmpwalk +# .1.3.6.1.4.1.2620.1.48.20.1.0 = STRING: "111802" +# .1.3.6.1.4.1.2620.1.48.20.2.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.3.0 = STRING: "84" +# .1.3.6.1.4.1.2620.1.48.20.4.0 = STRING: "91" +# .1.3.6.1.4.1.2620.1.48.20.5.0 = STRING: "N/A" +# .1.3.6.1.4.1.2620.1.48.20.6.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.7.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.8.0 = STRING: "9" +# .1.3.6.1.4.1.2620.1.48.20.9.0 = STRING: "79" +# .1.3.6.1.4.1.2620.1.48.20.10.0 = STRING: "1" +# .1.3.6.1.4.1.2620.1.48.20.11.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.12.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.13.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.14.0 = STRING: "1" +# .1.3.6.1.4.1.2620.1.48.20.15.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.16.0 = STRING: "7" +# .1.3.6.1.4.1.2620.1.48.20.17.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.18.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.19.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.20.0 = STRING: "0" +# .1.3.6.1.4.1.2620.1.48.20.21.0 = STRING: "N/A" +# +# sample info +# [[u'111802', u'0', u'84', u'91', u'N/A', u'0', u'0', u'9', u'79', u'1', u'0', u'0', u'0', u'1', u'0', u'7', u'0', u'0', u'0', u'0', u'N/A']] +# + +def parse_checkpoint_asg_smo_counters(info): + items = {} + for entry in info: + asgThroughput, asgConnectionRate, asgPacketRate, asgConcurrConn, asgClearConn, asgAccelConnectionRate, \ + asgNonAccelConnectionRate, asgAccelConcurrConn, asgNonAccelConcurrConn, asgLoad, asgAccelLoadAvg, \ + asgAccelLoadMin, asgAccelLoadMax, asgInstancesLoadAvg, asgInstancesLoadMin, asgInstancesLoadMax, \ + asgVpnThroughput, asgVpnConn, asgNatConnRate, asgNatConn, asgVsxCpu1MinAvg = entry + + items.update({'Concurrent connections': { + 'asgConcurrConn': int(asgConcurrConn), + 'asgAccelConcurrConn': int(asgAccelConcurrConn), + 'asgNonAccelConcurrConn': int(asgNonAccelConcurrConn), + } + }) + items.update({'Connection rate': {'asgConnectionRate': int(asgConnectionRate), + 'asgAccelConnectionRate': int(asgAccelConnectionRate), + 'asgNonAccelConnectionRate': int(asgNonAccelConnectionRate), + } + }) + items.update({'Load': {'asgLoad': int(asgLoad), + 'asgAccelLoadAvg': int(asgAccelLoadAvg), + 'asgAccelLoadMin': int(asgAccelLoadMin), + 'asgAccelLoadMax': int(asgAccelLoadMax), + }}) + items.update({'Instances load': {'asgInstancesLoadAvg': int(asgInstancesLoadAvg), + 'asgInstancesLoadMin': int(asgInstancesLoadMin), + 'asgInstancesLoadMax': int(asgInstancesLoadMax), + }}) + items.update({'NAT': {'asgNatConnRate': int(asgNatConnRate), + 'asgNatConn': int(asgNatConn), + }}) + items.update({'VPN': {'asgVpnThroughput': int(asgVpnThroughput), + 'asgVpnConn': int(asgVpnConn), + }}) + items.update({'Throughput': {'asgThroughput': int(asgThroughput), + }}) + items.update({'Packet rate': {'asgPacketRate': int(asgPacketRate), + }}) + return items + + +def inventory_checkpoint_asg_smo_counters(parsed): + # sample parsed + # { + # 'Load': {'asgAccelLoadAvg': 0, 'asgAccelLoadMin': 0, 'asgLoad': 1, 'asgAccelLoadMax': 0}, + # 'Connection rate': {'asgConnectionRate': 0, 'asgNonAccelConnectionRate': 0, 'asgAccelConnectionRate': 0}, + # 'Instances load': {'asgInstancesLoadMin': 0, 'asgInstancesLoadMax': 7, 'asgInstancesLoadAvg': 1}, + # 'Throughput': {'asgThroughput': 111802}, + # 'Concurrent connections': {'asgAccelConcurrConn': 9, 'asgNonAccelConcurrConn': 79, 'asgConcurrConn': 91}, + # 'NAT': {'asgNatConn': 0, 'asgNatConnRate': 0}, + # 'VPN': {'asgVpnConn': 0, 'asgVpnThroughput': 0}, + # 'Packet rate': {'asgPacketRate': 84}} + # + + for item in parsed.keys(): + yield item, None + + +def check_checkpoint_asg_smo_counters(item, params, parsed): + try: + entry = parsed[item] + + perfdata = [] + infotext = '' + longoutput = '' + + if params: + pass + + for key in entry.keys(): + perfdata.append((key, entry[key], None, None, None, None)) + + if item.lower() == 'concurrent connections': + infotext = 'all/accelerated/non accelerated: %d/%d/%d' % (entry['asgConcurrConn'], entry['asgAccelConcurrConn'], entry['asgNonAccelConcurrConn'], ) + + elif item.lower() == 'load': + infotext = 'current/average/min/max: %d/%d/%d/%d' % (entry['asgLoad'], entry['asgAccelLoadAvg'], entry['asgAccelLoadMin'], entry['asgAccelLoadMax'],) + + elif item.lower() == 'connection rate': + infotext = 'all/accelerated/non accelerated: %d/%d/%d' % (entry['asgConnectionRate'], entry['asgAccelConnectionRate'], entry['asgNonAccelConnectionRate'],) + + elif item.lower() == 'instances load': + infotext = 'average/min/max: %d/%d/%d' % (entry['asgInstancesLoadAvg'], entry['asgInstancesLoadMin'], entry['asgInstancesLoadMax'],) + + elif item.lower() == 'throughput': + infotext = 'Throughput: %d' % (entry['asgThroughput']) + + elif item.lower() == 'packet rate': + infotext = 'Packet Rate: %d' % (entry['asgPacketRate'],) + + elif item.lower() == 'nat': + infotext = 'NAT Connections/NAT connection rate: %d/%d' % (entry['asgNatConn'], entry['asgNatConn'],) + + elif item.lower() == 'vpn': + infotext = 'VPN Connections/VPN Throughput: %d/%d' % (entry['asgVpnConn'], entry['asgVpnThroughput'],) + + yield 0, infotext + longoutput, perfdata + + except KeyError: + pass + + +check_info['checkpoint_asg_smo_counters'] = { + 'check_function': check_checkpoint_asg_smo_counters, + 'inventory_function': inventory_checkpoint_asg_smo_counters, + 'service_description': "ASG SMO counters %s", + 'snmp_scan_function': scan_checkpoint, + 'parse_function': parse_checkpoint_asg_smo_counters, + 'group': 'checkpoint_asg_smo_counters', + 'has_perfdata': True, + 'snmp_info': ( + '.1.3.6.1.4.1.2620.1.48.20', # CHECKPOINT-MIB::asgIPv4PerformanceCounters + [ + '1', # asgThroughput + '2', # asgConnectionRate + '3', # asgPacketRate + '4', # asgConcurrConn + '5', # asgClearConn + '6', # asgAccelConnectionRate + '7', # asgNonAccelConnectionRate + '8', # asgAccelConcurrConn + '9', # asgNonAccelConcurrConn + '10', # asgLoad + '11', # asgAccelLoadAvg + '12', # asgAccelLoadMin + '13', # asgAccelLoadMax + '14', # asgInstancesLoadAvg + '15', # asgInstancesLoadMin + '16', # asgInstancesLoadMax + '17', # asgVpnThroughput + '18', # asgVpnConn + '19', # asgNatConnRate + '20', # asgNatConn + '21', # asgVsxCpu1MinAvg + ]), + 'includes': ['checkpoint.include'], +} diff --git a/packages/checkpoint_asg_smo_counters b/packages/checkpoint_asg_smo_counters new file mode 100644 index 0000000000000000000000000000000000000000..eb3414bdf9523f0839e6d471a7aeeccb5082ee5a --- /dev/null +++ b/packages/checkpoint_asg_smo_counters @@ -0,0 +1,11 @@ +{'author': u'Th.L. (thl-cmk[at]outlook[dot]com)', + 'description': u'Monitor Check Point Maestro SMO performance counters', + 'download_url': 'http://thl-cmk.hopto.org/', + 'files': {'checks': ['checkpoint_asg_smo_counters']}, + 'name': 'checkpoint_asg_smo_counters', + 'num_files': 1, + 'title': u'Check Point Maestro SMO performance counters', + 'version': '20201110.v0.1', + 'version.min_required': '1.4.0p38', + 'version.packaged': '1.6.0p15', + 'version.usable_until': None} \ No newline at end of file