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

update project

parent 90584cf4
No related branches found
No related tags found
No related merge requests found
File added
#!/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-19
#
# Monitor Check Point QoS interface statistics
#
# sample snmpwalk
#
# .1.3.6.1.4.1.2620.1.3.1.0 = STRING: QoS Software Blade
# .1.3.6.1.4.1.2620.1.3.2.0 = INTEGER: 6
# .1.3.6.1.4.1.2620.1.3.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.4.0 = STRING: R80.30
# .1.3.6.1.4.1.2620.1.3.5.0 = INTEGER: 135
# .1.3.6.1.4.1.2620.1.3.6.0 = STRING: R80.30_Zonen
# .1.3.6.1.4.1.2620.1.3.7.0 = STRING: Tue Mar 24 14:05:44 2020
# .1.3.6.1.4.1.2620.1.3.8.0 = Wrong Type (should be OCTET STRING): INTEGER: 3
# .1.3.6.1.4.1.2620.1.3.9.1.2.1.0 = STRING: eth3
# .1.3.6.1.4.1.2620.1.3.9.1.2.2.0 = STRING: eth4.16
# .1.3.6.1.4.1.2620.1.3.9.1.2.3.0 = STRING: eth1.4051
# .1.3.6.1.4.1.2620.1.3.9.1.3.1.0 = STRING: R80.30_Zonen
# .1.3.6.1.4.1.2620.1.3.9.1.3.2.0 = STRING: R80.30_Zonen
# .1.3.6.1.4.1.2620.1.3.9.1.3.3.0 = STRING: R80.30_Zonen
# .1.3.6.1.4.1.2620.1.3.9.1.4.1.0 = INTEGER: 25000000
# .1.3.6.1.4.1.2620.1.3.9.1.4.2.0 = INTEGER: 25000000
# .1.3.6.1.4.1.2620.1.3.9.1.4.3.0 = INTEGER: 25000000
# .1.3.6.1.4.1.2620.1.3.9.1.5.1.0 = INTEGER: 25000000
# .1.3.6.1.4.1.2620.1.3.9.1.5.2.0 = INTEGER: 25000000
# .1.3.6.1.4.1.2620.1.3.9.1.5.3.0 = INTEGER: 25000000
# .1.3.6.1.4.1.2620.1.3.9.1.6.1.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.6.2.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.6.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.7.1.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.7.2.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.7.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.8.1.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.8.2.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.8.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.9.1.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.9.2.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.9.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.10.1.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.10.2.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.10.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.11.1.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.11.2.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.11.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.12.1.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.12.2.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.12.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.13.1.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.13.2.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.13.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.14.1.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.14.2.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.14.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.15.1.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.15.2.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.9.1.15.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.3.10.0 = Gauge32: 1
#
# sample info
# [
#
# ,
# [u'eth4.16', u'R80.30_Zonen', u'25000000', u'25000000', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0'],
# [u'eth1.4051', u'R80.30_Zonen', u'25000000', u'25000000', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0', u'0']
# ]
#
#
def parse_checkpoint_qos_if(info):
items = {}
for entry in info:
item = entry[0]
policy = entry[1]
fgRateLimitIn, fgRateLimitOut, fgAvrRateIn, fgAvrRateOut, fgRetransPcktsIn, fgRetransPcktsOut, fgPendPcktsIn, \
fgPendPcktsOut, fgPendBytesIn, fgPendBytesOut, fgNumConnIn, fgNumConnOut = map(int, entry[2:])
interface = {
'policy': policy,
'fgRateLimitIn': fgRateLimitIn,
'fgRateLimitOut': fgRateLimitOut,
'couters': {
'fgAvrRateIn': fgAvrRateIn,
'fgAvrRateOut': fgAvrRateOut,
'fgRetransPcktsIn': fgRetransPcktsIn,
'fgRetransPcktsOut': fgRetransPcktsOut,
'fgPendPcktsIn': fgPendPcktsIn,
'fgPendPcktsOut': fgPendPcktsOut,
'fgPendBytesIn': fgPendBytesIn,
'fgPendBytesOut': fgPendBytesOut,
'fgNumConnIn': fgNumConnIn,
'fgNumConnOut': fgNumConnOut,
},
}
items.update({item: interface})
return items
def inventory_checkpoint_qos_if(parsed):
# sample parsed
# {
# u'eth4.16': {'policy': u'R80.30_Zonen', 'fgRateLimitOut': 25000000, 'fgRateLimitIn': 25000000,
# 'couters': {
# 'fgAvrRateIn': 0, 'fgAvrRateOut': 0,
# 'fgPendPcktsIn': 0, 'fgPendPcktsOut': 0,
# 'fgRetransPcktsIn': 0, 'fgRetransPcktsOut': 0,
# 'fgNumConnIn': 0, 'fgNumConnOut': 0,
# 'fgPendBytesIn': 0, 'fgPendBytesOut': 0,
# }
# },
# u'eth1.4051': {'policy': u'R80.30_Zonen', 'fgRateLimitOut': 25000000, 'fgRateLimitIn': 25000000,
# 'couters': {
# 'fgAvrRateIn': 0, 'fgAvrRateOut': 0,
# 'fgPendPcktsIn': 0, 'fgPendPcktsOut': 0,
# 'fgRetransPcktsIn': 0, 'fgRetransPcktsOut': 0,
# 'fgNumConnIn': 0, 'fgNumConnOut': 0,
# 'fgPendBytesIn': 0, 'fgPendBytesOut': 0,
# }
# },
# u'eth3': {'policy': u'R80.30_Zonen', 'fgRateLimitOut': 25000000, 'fgRateLimitIn': 25000000,
# 'couters': {
# 'fgAvrRateIn': 0, 'fgAvrRateOut': 0,
# 'fgPendPcktsIn': 0, 'fgPendPcktsOut': 0,
# 'fgRetransPcktsIn': 0, 'fgRetransPcktsOut': 0,
# 'fgNumConnIn': 0, 'fgNumConnOut': 0,
# 'fgPendBytesIn': 0, 'fgPendBytesOut': 0,
# }
# },
# }
#
for item in parsed.keys():
yield item, {'inv_state': parsed[item]}
def check_checkpoint_qos_if(item, params, parsed):
try:
interface = parsed[item]
counters = interface['couters']
if params:
pass
infotext = ''
longoutput = ''
perfdata = []
state = 0
longoutput += '\nPolicy name: R80.30_Zonen %s' % interface['policy']
for key in counters.keys():
# value = get_rate('checkpoint_fw_connections.%s' % counter, now_time, int(value), onwrap=SKIP)
perfdata.append((key, counters[key]))
infotext += 'Rate limit in/out: %d/%d, ' % (interface['fgRateLimitIn'], interface['fgRateLimitOut'])
infotext += 'Average Rate in/out: %d/%d, ' % (counters['fgAvrRateIn'], counters['fgAvrRateOut'])
infotext += 'Pending packets in/out: %d/%d, ' % (counters['fgPendPcktsIn'], counters['fgPendPcktsOut'])
infotext += 'Retransmitted packets in/out: %d/%d, ' % (counters['fgRetransPcktsIn'], counters['fgRetransPcktsOut'])
infotext += 'Connections in/out: %d/%d, ' % (counters['fgNumConnIn'], counters['fgNumConnOut'])
infotext += 'Pending bytes in/out: %d/%d' % (counters['fgPendBytesIn'], counters['fgPendBytesOut'])
yield state, infotext + longoutput , perfdata
except IndexError:
pass
check_info['checkpoint_qos_if'] = {
'check_function': check_checkpoint_qos_if,
'inventory_function': inventory_checkpoint_qos_if,
'service_description': "QoS %s",
'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').startswith('.1.3.6.1.4.1.8072.3.2.10')) and
oid('.1.3.6.1.4.1.2620.1.6.1.0', '').lower().startswith('svn foundation'),
'parse_function': parse_checkpoint_qos_if,
'group': 'checkpoint_qos_if',
'snmp_info': (
'.1.3.6.1.4.1.2620.1.3.9.1', # CHECKPOINT-MIB::asgChassisInfo
[
'2', # fgIfName
'3', # fgPolicyName
'4', # fgRateLimitIn
'5', # fgRateLimitOut
'6', # fgAvrRateIn
'7', # fgAvrRateOut
'8', # fgRetransPcktsIn
'9', # fgRetransPcktsOut
'10', # fgPendPcktsIn
'11', # fgPendPcktsOut
'12', # fgPendBytesIn
'13', # fgPendBytesOut
'14', # fgNumConnIn
'15', # fgNumConnOut
]),
}
{'author': u'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': u'Monitor Check Point QoS interface statistics',
'download_url': 'http://thl-cmk.hopto.org/',
'files': {'checks': ['checkpoint_qos_if']},
'name': 'checkpoint_qos_if',
'num_files': 1,
'title': u'Check Point QoS interface',
'version': '20201119.v0.1',
'version.min_required': '1.4.0p38',
'version.packaged': '1.6.0p15',
'version.usable_until': None}
\ No newline at end of file
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