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

Delete checkpoint_eva_jobs

parent e7a2565e
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 job status
#
# 2018-03-12: code cleanup
# 2020-06-07: code cleanup
# added parse function
# 2020-06-08: changed snmp-scan function
#
# sample info
# [
# [u'1', u'{42DC9EE4-1529-4cb4-B4D9-E850AA328EDA}', u'All online jobs', u'running', u'1', u'217.119.213.21', u'Log', u'1', u'3680009', u'fw.log', u'7569586', u'eJobRunningAllOK', u'All OK.'],
# [u'2', u'{42DC9EE4-1529-4cb4-B4D9-E850AA328EDA}', u'All online jobs', u'running', u'1', u'217.119.213.21', u'Log', u'1', u'30289702', u'fw.log', u'7020406', u'eJobRunningAllOK', u'All OK.'],
# [u'3', u'{42DC9EE4-1529-4cb4-B4D9-E850AA328EDA}', u'All online jobs', u'running', u'1', u'217.119.213.20', u'Log', u'1', u'3526', u'fw.log', u'4294967295', u'eJobRunningAllOK', u'All OK.'],
# [u'4', u'{42DC9EE4-1529-4cb4-B4D9-E850AA328EDA}', u'All online jobs', u'running', u'1', u'217.119.213.20', u'Log', u'1', u'247314', u'fw.log', u'49435', u'eJobRunningAllOK', u'All OK.'],
# [u'5', u'{42DC9EE4-1529-4cb4-B4D9-E850AA328EDA}', u'All online jobs', u'running', u'1', u'217.119.213.21', u'Audit', u'1', u'36', u'fw.adtlog', u'619', u'eJobRunningAllOK', u'All OK.'],
# [u'6', u'{42DC9EE4-1529-4cb4-B4D9-E850AA328EDA}', u'All online jobs', u'running', u'1', u'217.119.213.20', u'Audit', u'1', u'748', u'fw.adtlog', u'13769', u'eJobRunningAllOK', u'All OK.']
# ]
#
def parse_checkpoint_eva_jobs(info):
parsed = {}
for job_entry in info:
jobindex, jobid, jobname, jobstate, jobisonline, joblogserver, jobdatatype, connectedtologserver, \
numanalyzedlogs, filename, filecurrentposition, statedescriptioncode, statedescription = job_entry
now_time = time.time()
numanalyzedlogs_per_second = get_rate('checkpoint_eva_jobs_analyzed_logs.%s' % jobindex, now_time, int(numanalyzedlogs), onwrap=SKIP)
if ',' in filename:
filename, recent_log_time = filename.split(',')
else:
recent_log_time = 'unknown'
parsed.update({jobindex: {'jobid' : jobid,
'jobname': jobname,
'jobstate': jobstate,
'jobisonline': int(jobisonline),
'joblogserver': joblogserver,
'jobdatatype': jobdatatype,
'connectedtologserver': int(connectedtologserver),
'numanalyzedlogs_per_second': numanalyzedlogs_per_second,
'filename': filename,
'filecurrentposition': filecurrentposition,
'statedescriptioncode': statedescriptioncode,
'statedescription': statedescription,
'recent_log_time': recent_log_time,
}})
return parsed
def inventory_checkpoint_eva_jobs(parsed):
# check per job
for job_entry in parsed.keys():
yield job_entry, None
def check_checkpoint_eva_jobs(item, _no_params, parsed):
if parsed.get(item):
job_entry = parsed[item]
jobstate = job_entry['jobstate']
numanalyzedlogs_per_second = job_entry['numanalyzedlogs_per_second']
filename = job_entry['filename']
filecurrentposition = job_entry['filecurrentposition']
infotext = ''
infotext += 'Server: %s, ' % job_entry['joblogserver']
infotext += 'Analyzed logs: %0.2f/s, ' % numanalyzedlogs_per_second
infotext += 'Position in file: %s, ' % filecurrentposition
infotext += 'File: %s' % filename
longoutput = ''
longoutput += '\nJob id: %s' % job_entry['jobid']
longoutput += '\nJob name: %s' % job_entry['jobname']
longoutput += '\nJob state: %s' % jobstate
longoutput += '\nJob type: %s' % job_entry['jobdatatype']
longoutput += '\nJob file: %s' % filename
longoutput += '\nRecent log time: %s' % job_entry['recent_log_time']
longoutput += '\nState description code: %s' % job_entry['statedescriptioncode']
longoutput += '\nState description: %s' % job_entry['statedescription']
perfdata = [('position_in_file', filecurrentposition),
('analyzed_logs', numanalyzedlogs_per_second),
]
if job_entry['jobisonline'] != 1:
yield 2, 'State: %s' % jobstate
if job_entry['connectedtologserver'] != 1:
yield 2, 'Not connected to log server'
yield 0, infotext + longoutput, perfdata
check_info['checkpoint_eva_jobs'] = {
'parse_function' : parse_checkpoint_eva_jobs,
'check_function' : check_checkpoint_eva_jobs,
'inventory_function' : inventory_checkpoint_eva_jobs,
'service_description' : 'Eventia job %s',
'group' : 'checkpoint_eva_jobs',
'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.2.4.1', [ # CHECKPOINT-MIB::cpseadJobsEntry
'1', # cpseadJobIndex
'2', # cpseadJobID
'3', # cpseadJobName
'4', # cpseadJobState
'5', # cpseadJobIsOnline
'6', # cpseadJobLogServer
'7', # cpseadJobDataType
'8', # cpseadConnectedToLogServer
'9', # cpseadNumAnalyzedLogs
'10', # cpseadFileName
'11', # cpseadFileCurrentPosition
'12', # cpseadStateDescriptionCode
'13', # cpseadStateDescription
]),
}
\ 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