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

Delete checkpoint_eva_cu

parent 15ec6a57
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 : 2016-07-30
#
# monitor Check Point Eventia analyzer correlation unit
#
# 2016-08-04: changed invetory from index to ip address (index was changing ??)
# 2018-01-05: fixed inventory function
# 2018-03-12: code cleanup
# 2020-06-07: added parse function
# code cleanup
# 2020-06-08: changed snmp-scan function
#
# sample info
# [[u'1', u'192.167.10.10', u'1469790660', u'898864', u'189144']]
#
import time
def parse_checkpoint_eva_cu(info):
parsed = {}
for cu in info:
if len(cu) == 5:
cuindex, cuip, culastrcvdtime, cunumeventsrcvd, cuconnectionduration = cu
cuconnectionduration = int(cuconnectionduration)
since = time.strftime('%Y-%m-%d %H:%M', time.localtime(time.time() - cuconnectionduration))
last = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(culastrcvdtime)))
# last = time.strftime('%c', time.localtime(int(culastrcvdtime)))
# since = time.strftime('%c', time.localtime(time.time() - cuconnectionduration))
now_time = time.time()
cunumeventsrcvd = get_rate('checkpoint_eva_cu_cunumeventsrcvd.%s' % cuip, now_time, int(cunumeventsrcvd), onwrap=SKIP)
parsed.update({cuip: {
'cunumeventsrcvd': cunumeventsrcvd,
'cuconnectionduration':cuconnectionduration,
'last': last,
'since': since,
}
})
return parsed
def inventory_checkpoint_eva_cu(parsed):
for cu in parsed.keys():
yield cu, None
def check_checkpoint_eva_cu(item, _no_params, parsed):
if parsed.get(item):
cu = parsed[item]
cunumeventsrcvd = cu['cunumeventsrcvd']
cuconnectionduration = cu['cuconnectionduration']
last = cu['last']
since = cu['since']
seconds = cuconnectionduration % 60
rem = cuconnectionduration / 60
minutes = rem % 60
hours = (rem % 1440) / 60
days = rem / 1440
infotext = ''
infotext += 'Up since %s (%dd %02d:%02d:%02d), ' % (since, days, hours, minutes, seconds)
infotext += 'Last event at: %s, ' % last
infotext += 'Events: %s/s' % cunumeventsrcvd
perfdata = [('events', cunumeventsrcvd),
('uptime', cuconnectionduration),
]
return 0, infotext, perfdata
check_info['checkpoint_eva_cu'] = {
'parse_function' : parse_checkpoint_eva_cu,
'check_function' : check_checkpoint_eva_cu,
'inventory_function' : inventory_checkpoint_eva_cu,
'service_description' : 'Correlation unit %s',
'group' : 'checkpoint_eva_cu',
'has_perfdata' : True,
'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'),
'snmp_info' : ('.1.3.6.1.4.1.2620.1.25.1.9.1', [ # CHECKPOINT-MIB::cpsemdCorrelationUnitEntry
'1', # cpsemdCorrelationUnitIndex
'2', # cpsemdCorrelationUnitIP
'3', # cpsemdCorrelationUnitLastRcvdTime
'4', # cpsemdCorrelationUnitNumEventsRcvd
'5', # cpsemdConnectionDuration
]),
}
\ 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