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

Delete checkpoint_ia_adquery

parent 7eb44e5d
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 : 2017-17-05
#
# Check Point Identity Awareness status
#
# 2020.06.08: changed snmp-scan function
#
# snmpwalk sample
# .1.3.6.1.4.1.2620.1.38.25.1.1.1.0 = Counter32: 1
# .1.3.6.1.4.1.2620.1.38.25.1.1.2.0 = Counter32: 2
# .1.3.6.1.4.1.2620.1.38.25.1.1.3.0 = Counter32: 3
# .1.3.6.1.4.1.2620.1.38.25.1.1.4.0 = Counter32: 4
# .1.3.6.1.4.1.2620.1.38.25.1.1.5.0 = Counter32: 5
# .1.3.6.1.4.1.2620.1.38.25.1.2.1.0 = Counter32: 0
# .1.3.6.1.4.1.2620.1.38.25.1.2.2.0 = Counter32: 0
# .1.3.6.1.4.1.2620.1.38.25.1.2.3.0 = Counter32: 0
# .1.3.6.1.4.1.2620.1.38.25.1.2.4.0 = Counter32: 0
# .1.3.6.1.4.1.2620.1.38.25.1.2.5.0 = Counter32: 0
# .1.3.6.1.4.1.2620.1.38.25.1.3.1.0 = STRING: "doamin1.de"
# .1.3.6.1.4.1.2620.1.38.25.1.3.2.0 = STRING: "doamin1.de"
# .1.3.6.1.4.1.2620.1.38.25.1.3.3.0 = STRING: "domain1.de"
# .1.3.6.1.4.1.2620.1.38.25.1.3.4.0 = STRING: "domain2.de"
# .1.3.6.1.4.1.2620.1.38.25.1.3.5.0 = STRING: "domain2.de"
# .1.3.6.1.4.1.2620.1.38.25.1.4.1.0 = IpAddress: 10.1.1.13
# .1.3.6.1.4.1.2620.1.38.25.1.4.2.0 = IpAddress: 10.1.1.14
# .1.3.6.1.4.1.2620.1.38.25.1.4.3.0 = IpAddress: 10.1.1.31
# .1.3.6.1.4.1.2620.1.38.25.1.4.4.0 = IpAddress: 10.1.1.16
# .1.3.6.1.4.1.2620.1.38.25.1.4.5.0 = IpAddress: 10.1.1.17
# .1.3.6.1.4.1.2620.1.38.25.1.5.1.0 = Counter32: 77462
# .1.3.6.1.4.1.2620.1.38.25.1.5.2.0 = Counter32: 85917
# .1.3.6.1.4.1.2620.1.38.25.1.5.3.0 = Counter32: 58378
# .1.3.6.1.4.1.2620.1.38.25.1.5.4.0 = Counter32: 4810
# .1.3.6.1.4.1.2620.1.38.25.1.5.5.0 = Counter32: 6256
#
# sample info
# [[u'1', u'0', u'domain1.de', u'10.1.1.13', u'77462'],
# [u'2', u'0', u'domain1.de', u'10.1.1.14', u'85917'],
# [u'3', u'0', u'domain1.de', u'10.1.1.31', u'58378'],
# [u'4', u'0', u'domain2.de', u'10.1.1.16', u'4810'],
# [u'5', u'0', u'domain2.de', u'10.1.1.17', u'6256']]
#
factory_settings['checkpoint_ia_adquery_defaults'] = {
}
def inventory_checkpoint_ia_adquery(info):
domains = []
for dc in info:
domain = dc[2]
dc_ip_address = dc[3]
if not domain in domains and not domain == '' and len(dc_ip_address.split('.')) == 4:
domains.append(domain)
yield domain, None
def check_checkpoint_ia_adquery(item, params, info):
dcstatus = {0: 'Ok',
1: 'Bad Credentials',
2: 'Connectivity Error',
3: 'Internal Error',
4: 'Connection Time Out'}
infotext = ''
longoutput = ''
perfdata = []
dcs = []
events_sum = 0
adconnstatus = 0
now_time = time.time()
for dc in info:
ADQueryStatusDomainName = dc[2]
if item == ADQueryStatusDomainName:
dcs.append(dc)
if len(dcs) > 0:
for dc in dcs:
ADQueryStatusCurrStatus = int(dc[1])
ADQueryStatusDomainIP = dc[3]
ADQueryStatusEvents = int(dc[4])
events_sum += ADQueryStatusEvents
dc_ip_address = 'dc_%s' % '_'.join(ADQueryStatusDomainIP.split('.'))
# convert events per hour to events per second
events_per_sec = get_rate('checkpoint_ia_adquery.%s.%s' % (dc_ip_address, item), now_time, ADQueryStatusEvents, onwrap=SKIP)
if not ADQueryStatusCurrStatus == 0:
if adconnstatus == 0:
adconnstatus = 1
yield 2, 'Connection error (see long output)'
longoutput += '\nDC IP-address: %s, Events: %.2f/s, Connection status: %s' % (ADQueryStatusDomainIP, events_per_sec, dcstatus.get(ADQueryStatusCurrStatus))
perfdata.append((dc_ip_address, events_per_sec))
events_sum = get_rate('checkpoint_ia_adquery.%s.%s' % ('events_sum', item), now_time, events_sum, onwrap=SKIP)
perfdata.append(('events_sum', events_sum))
infotext += "# of DCs %s, Events: %.2f/s" % (len(dcs), events_sum)
yield 0, infotext + longoutput, perfdata
check_info['checkpoint_ia_adquery'] = {
'check_function' : check_checkpoint_ia_adquery,
'inventory_function' : inventory_checkpoint_ia_adquery,
'service_description' : 'Identity Awareness AD Domain %s',
'has_perfdata' : True,
'group': 'checkpoint_ia_adquery',
'default_levels_variable': 'checkpoint_ia_adquery_defaults',
'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.38.25.1', [ # CHECKPOINT-MIB::identityAwarenessADQueryStatusEntry
'1', # identityAwarenessADQueryStatusTableIndex
'2', # identityAwarenessADQueryStatusCurrStatus
'3', # identityAwarenessADQueryStatusDomainName
'4', # identityAwarenessADQueryStatusDomainIP
'5', # identityAwarenessADQueryStatusEvents
]),
}
\ 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