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

update project

parent 079a87f3
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Author: thl-cmk[at]outlook[dot]com / thl-cmk.hopto.org
#
# Check Point inventory
#
# 2016-06-29 : inventory Check Point Appliance
# 2018-03-05 : added Patches, Deployment Agent Build
# 2018-03-07 : added Licenses
# 2020-06-01 : cleanup, prepared for cmk1.7x, rename from inv_checkpoint_svn to checkpoint_inv_base
# 2020-11-27 : rewrite for CMK check API 1.0 (CMK 2.0)
# 2020-11-28 : added available updates
# 2021-02-08 : transfered license/support info to seperate plugin
# 2021-02-22 : code cleanup
#
# sample string_table
# [
# [
# ['0008262230', 'Smart-1 5150 NGSM', 'E4:43:4B:AA:BB:CC', 'a5rYfxLngVSZtHjK2sfghhp6noVfzuTvSEbt', 'CPAP-NGSM5150', 'Collaborative Enterprise Support - StandardPro Add-on for Products', '1751500800', '2']
# ]
# ]
#
import time
from typing import List, NamedTuple
from .agent_based_api.v1.type_defs import (
StringTable,
InventoryResult,
)
from .agent_based_api.v1 import (
register,
SNMPTree,
TableRow,
startswith,
all_of,
any_of,
equals,
)
class CheckpointLicensing(NamedTuple):
accountid: str
packagedescription: str
containerck: str
signaturekey: str
containersku: str
supportlevel: str
supportexpiration: str
activationstatus: str
def parse_checkpoint_inv_licensing(string_table: List[StringTable]) -> List:
section = []
for license in string_table[0]:
license = CheckpointLicensing(*license)
if not license.containerck == '':
section.append(license)
return section
def inventory_checkpoint_licensing(section: List) -> InventoryResult:
path = ['software', 'check_point', 'support']
lic_state = {
'1': 'trial period',
'2': 'activated'
}
for license in section:
license = CheckpointLicensing(*license)
supportexpiration = 'N/A'
if not license.supportexpiration == '':
supportexpiration = time.strftime("%Y-%m-%d %H:%M", time.localtime(int(license.supportexpiration)))
yield TableRow(
path=path,
key_columns={'certificate_key': license.containerck},
inventory_columns={
'account_id': license.accountid,
'description': license.packagedescription,
'signatur_key': license.signaturekey,
'container': license.containersku,
'support_type': license.supportlevel,
'support_renewal': supportexpiration,
'state': lic_state.get(license.activationstatus, license.activationstatus)
},
)
register.snmp_section(
name='checkpoint_inv_licensing',
parse_function=parse_checkpoint_inv_licensing,
fetch=[
SNMPTree(
base='.1.3.6.1.4.1.2620.1.6.18.2', # CHECKPOINT-MIB::licensingAssetInfo
oids=[
'1', # licensingAssetAccountId
'2', # licensingAssetPackageDescription
'3', # licensingAssetContainerCK
'4', # Signature key
'5', # licensingAssetContainerSKU
'6', # licensingAssetSupportLevel
'7', # licensingAssetSupportExpiration
'8', # licensingAssetActivationStatus
]
),
],
detect=any_of(
startswith('.1.3.6.1.2.1.1.2.0', '.1.3.6.1.4.1.2620'), # sysObjectID == CheckPoint
all_of(
equals('.1.3.6.1.2.1.1.2.0', '.1.3.6.1.4.1.8072.3.2.10'), # sysObjectID == Linux
equals('.1.3.6.1.4.1.2620.1.6.1.0', 'SVN Foundation'), # CheckPoint software installed
)
)
)
register.inventory_plugin(
name='checkpoint_inv_licensing',
inventory_function=inventory_checkpoint_licensing,
)
File added
{'author': 'Th.L. (thl-cmk[at]outlook[dot]com)',
'description': 'SNMP inventory of Check Point Appliances for license/support '
'status\n',
'download_url': 'https://thl-cmk.hopto.org',
'files': {'agent_based': ['checkpoint_inv_support.py'],
'web': ['plugins/views/checkpoint_support.py']},
'name': 'inv_checkpoint_support',
'num_files': 2,
'title': 'Check Point appliance support inventory plugin',
'version': '20210208.v.0.1',
'version.min_required': '2.0.0i1',
'version.packaged': '2020.11.27',
'version.usable_until': None}
\ No newline at end of file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import cmk.gui.utils
from cmk.gui.plugins.views import (
inventory_displayhints,)
from cmk.gui.i18n import _
inventory_displayhints.update({
'.software.check_point.support:': {
'title': _('Support'),
'keyorder': [
'account_id',
'certificate_key',
'container',
'description',
'state',
'support_renewal',
'support_type',
],
'view': 'invcheckpointsupport_of_host',
},
})
from cmk.gui.plugins.views.inventory import declare_invtable_view
declare_invtable_view(
'invcheckpointsupport',
'.software.check_point.support:',
_('Check Point support'),
_('Check Point support'),
)
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