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

update project

parent ea955473
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# License: GNU General Public License v2
#
# Author: thl-cmk[at]outlook[dot]com
# URL : https://thl-cmk.hopto.org
# Date : 2016-07-31
#
# Monitor Check Point management server
#
# 2017-03-08: changed snmp scan and inventory function
# 2018-03-15: code cleanup
# 2020-07-08: changed snm-scan function
#
# sample snmpwalk (client table missing)
#
# .1.3.6.1.4.1.2620.1.7.1.0 = STRING: Check Point Security Management Server
# .1.3.6.1.4.1.2620.1.7.2.0 = INTEGER: 6
# .1.3.6.1.4.1.2620.1.7.3.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.7.4.0 = Wrong Type (should be INTEGER): Gauge32: 991140003
# .1.3.6.1.4.1.2620.1.7.5.0 = STRING: active
# .1.3.6.1.4.1.2620.1.7.6.0 = INTEGER: 1
# .1.3.6.1.4.1.2620.1.7.9.0 = STRING: MgmtHAJournals is too long.
# .1.3.6.1.4.1.2620.1.7.10.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.7.11.0 = STRING: License violation detected:
# .1.3.6.1.4.1.2620.1.7.101.0 = INTEGER: 0
# .1.3.6.1.4.1.2620.1.7.102.0 = STRING: OK
# .1.3.6.1.4.1.2620.1.7.103.0 = STRING: OK
#
#
# sample info
#
# [[[u'Check Point Security Management Server', u'6', u'0', u'991140003', u'active', u'1',
# u'MgmtHAJournals is too long.', u'0', u'License violation detected: ', u'0', u'OK', u'OK']],
# []]
#
# no MGMT Server
# [[], []]
#
from typing import List
from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import (
DiscoveryResult,
CheckResult,
StringTable,
)
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
register,
Service,
equals,
Result,
State,
SNMPTree,
startswith,
all_of,
any_of,
)
def parse_checkpoint_mgmt(string_table: List[StringTable]):
try:
if string_table[0][0][0] == 'Check Point Security Management Server':
return string_table
except IndexError:
pass
def discovery_checkpoint_mgmt(section) -> DiscoveryResult:
yield Service()
def check_checkpoint_mgmt(section) -> CheckResult:
mngmt, mgConnectedClientsTable = section
prodname, vermajor, verminor, buildnumber, activestatus, fwmisalive, mgmthajournals, \
islicenseviolation, licenseviolationmsg, statcode, statshortdescr, statlongdescr = mngmt[0]
yield Result(state=State.OK, summary=f'{prodname} version: {vermajor}.{verminor}, build: {buildnumber}')
yield Result(state=State.OK, notice=f'Client table: {mgConnectedClientsTable}')
if int(islicenseviolation) != 0:
if len(licenseviolationmsg) != 0:
yield Result(state=State.WARN, notice=licenseviolationmsg)
else:
yield Result(state=State.WARN, notice='license violation')
if int(fwmisalive) != 1:
yield Result(state=State.CRIT, notice='is not alive')
if int(statcode) != 0:
yield Result(state=State.CRIT, notice=f'Status : {statshortdescr}, {statlongdescr}')
register.snmp_section(
name='checkpoint_mgmt',
parse_function=parse_checkpoint_mgmt,
fetch=[
SNMPTree(
base='.1.3.6.1.4.1.2620.1.7', # CHECKPOINT-MIB::mngmt
oids=[
'1', # mgProdName
'2', # mgVerMajor
'3', # mgVerMinor
'4', # mgBuildNumber
'5', # mgActiveStatus
'6', # mgFwmIsAlive
'9', # mgMgmtHAJournals
'10', # mgIsLicenseViolation
'11', # mgLicenseViolationMsg
'101', # mgStatCode
'102', # mgStatShortDescr
'103', # mgStatLongDescr
]),
SNMPTree(
base='.1.3.6.1.4.1.2620.1.7.7', # # CHECKPOINT-MIB::mgConnectedClientsTable
oids=[
'1', # mgClientName
'2', # mgClientName
'3', # mgClientHost
'4', # mgClientDbLock
'5', # mgApplicationType
]),
],
detect=any_of(
startswith('.1.3.6.1.2.1.1.2.0', '.1.3.6.1.4.1.2620'),
all_of(
equals('.1.3.6.1.2.1.1.2.0', '.1.3.6.1.4.1.8072.3.2.10'),
equals('.1.3.6.1.4.1.2620.1.6.1.0', 'SVN Foundation'),
)
)
)
register.check_plugin(
name='checkpoint_mgmt',
service_name='Management server',
discovery_function=discovery_checkpoint_mgmt,
check_function=check_checkpoint_mgmt,
)
No preview for this file type
{'author': u'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': u'monitor Check Point management server\n',
{'author': 'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': 'monitor Check Point management server\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'checks': ['checkpoint_mgmt']},
'files': {'agent_based': ['checkpoint_mgmt.py']},
'name': 'checkpoint_mgmt',
'num_files': 1,
'title': u'monitor Check Point management server',
'version': '20200608.v0.1b',
'version.min_required': '1.2.8b8',
'version.packaged': '1.4.0p38'}
\ No newline at end of file
'title': 'monitor Check Point management server',
'version': '20210810.v0.2',
'version.min_required': '2.0.0',
'version.packaged': '2021.07.14',
'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