From 70309892eab262fd7e38c337eb8a2b1a975b5c2f Mon Sep 17 00:00:00 2001
From: Thl CMK <thl-cmk@outlook.com>
Date: Tue, 10 Nov 2020 19:19:39 +0100
Subject: [PATCH] update project

---
 checkpoint_asg_smo_counters.mkp      | Bin 0 -> 2227 bytes
 checks/checkpoint_asg_smo_counters   | 175 +++++++++++++++++++++++++++
 packages/checkpoint_asg_smo_counters |  11 ++
 3 files changed, 186 insertions(+)
 create mode 100644 checkpoint_asg_smo_counters.mkp
 create mode 100644 checks/checkpoint_asg_smo_counters
 create mode 100644 packages/checkpoint_asg_smo_counters

diff --git a/checkpoint_asg_smo_counters.mkp b/checkpoint_asg_smo_counters.mkp
new file mode 100644
index 0000000000000000000000000000000000000000..8da2e24319a8daf55b64a9d9934c86bdf0132650
GIT binary patch
literal 2227
zcmV;k2u$}MiwFp<*{WXx|6^!nV{344X>N31VRL6+b8T;5V{dhCbY*gLEiy1NFflPP
zFfMj5E-@}`Yj6PVTI+AyI1<li{}ntJh3q?9mi&$n{gBNqa>X{;pv~?VpJAvnlV~GT
zIz8M3f&cd#QZJI0WUIUF-U6H!wlw_BgEO2VrPv|&-q|-M186!Pvu_~z+n5a}XXa=&
z8BQkS>11+dnDB3QhK#fCKyesZ0YZPsB>BnxMd($t;^@%}v;~T_yGQ+ljyln!+qbt*
zODkG=apZd5({kfQE8E+4wO$Kp8ywn!<42B1nAo*PoX88%<s-JA(5>f?2wht^i~<jR
zy8apYIJozMtwn5%Y%eAe4#Gr{_l3BgwOPl33!1dYDDoGBL26%r^!&)vz2ITM(D#mu
zLx8<%HZ?>qm&v71O|Gr*VI6M0b#7v{r((p~Vye6j$#C&@otZExBXS}avk5ky*bXj|
z=x9S@XqcvH=sQC<`9Xc_kad9n8#@8sP^77kb;BRc1(0vqPu4>Qm;%6@2!J@WKD&4g
z#vK~N8;{_9gZw*C|N3vCNB+$EHw~%&O=DuJ`u{HV-)3vR4Q16%$_g%*?V4g~Ls_AA
z*&+tXcD9JyfT5K~d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D?dFP}9h<w6RNrrf4wTHYCvS5Cpr21R9lqtY-;S1Yh2%B;ceRcxZN70X#5W
zBtqzF5^Bz)N`lD+zIcF;7OEj*r12u=!pr3xwd&@b%68)omVY{@r+jG0t$piEks?Kk
z6e&`qNRc8%iWDhQq)3q>MT!(DQlv<cB1MW6DN>|Jks?Kk6#f6x{{SNVZn*$Z007p0
BT08&%

literal 0
HcmV?d00001

diff --git a/checks/checkpoint_asg_smo_counters b/checks/checkpoint_asg_smo_counters
new file mode 100644
index 0000000..142919c
--- /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 0000000..eb3414b
--- /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
-- 
GitLab