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

update project

parent 6baabb64
No related branches found
No related tags found
No related merge requests found
...@@ -16,20 +16,20 @@ ...@@ -16,20 +16,20 @@
# sample string_table # sample string_table
# [ # [
# [ # [
# ['1', 'Check_Point_SmartConsole_R80_40_jumbo_HF_B411_Win.tgz', 'HFA', 'Installed'], # ['Check_Point_SmartConsole_R80_40_jumbo_HF_B411_Win.tgz', 'HFA', 'Installed'],
# ['2', 'Check_Point_R80_40_JUMBO_HF_Bundle_T78_sk165456_FULL.tgz', 'Wrapper', 'Installed'], # ['Check_Point_R80_40_JUMBO_HF_Bundle_T78_sk165456_FULL.tgz', 'Wrapper', 'Installed'],
# ['3', 'Check_Point_CPinfo_Bundle_R80_40_T53.tgz', 'HFA', 'Installed'] # ['Check_Point_CPinfo_Bundle_R80_40_T53.tgz', 'HFA', 'Installed']
# ], # ],
# [ # [
# ['1', 'Check_Point_SmartConsole_R80_40_jumbo_HF_B411_Win.tgz', 'R80.40 SmartConsole Build 411', 'capability', 'Installed', '2020-09-30T00:00:00Z', 'Recommended', '2020-10-12T15:19:51Z'], # ['Check_Point_SmartConsole_R80_40_jumbo_HF_B411_Win.tgz', 'R80.40 SmartConsole Build 411', 'capability', 'Installed', '2020-09-30T00:00:00Z', 'Recommended', '2020-10-12T15:19:51Z'],
# ['2', 'Check_Point_R80_40_JUMBO_HF_Bundle_T78_sk165456_FULL.tgz', 'R80.40 Jumbo Hotfix Accumulator General Availability (Take 78)', 'jumbo', 'Installed', '2020-08-24T00:00:00Z', 'Recommended', '2020-10-12T15:36:58Z'], # ['Check_Point_R80_40_JUMBO_HF_Bundle_T78_sk165456_FULL.tgz', 'R80.40 Jumbo Hotfix Accumulator General Availability (Take 78)', 'jumbo', 'Installed', '2020-08-24T00:00:00Z', 'Recommended', '2020-10-12T15:36:58Z'],
# ['3', 'Check_Point_CPinfo_Bundle_R80_40_T53.tgz', 'Check Point CPinfo build 202 for R80.40', 'capability', 'Installed', '2020-01-26T00:00:00Z', 'Recommended', '2020-10-12T15:19:16Z'], # ['Check_Point_CPinfo_Bundle_R80_40_T53.tgz', 'Check Point CPinfo build 202 for R80.40', 'capability', 'Installed', '2020-01-26T00:00:00Z', 'Recommended', '2020-10-12T15:19:16Z'],
# ['4', 'Check_Point_SmartConsole_R80_40_jumbo_HF_B410_Win.tgz', 'Check Point SmartConsole R80.40 Jumbo Hotfix B410', 'capability', 'Available for Install', '2020-08-24T00:00:00Z', 'Not Recommended', '2020-09-08T16:33:07Z'], # ['Check_Point_SmartConsole_R80_40_jumbo_HF_B410_Win.tgz', 'Check Point SmartConsole R80.40 Jumbo Hotfix B410', 'capability', 'Available for Install', '2020-08-24T00:00:00Z', 'Not Recommended', '2020-09-08T16:33:07Z'],
# ['5', 'Check_Point_R80_40_JUMBO_HF_Bundle_T77_sk165456_FULL.tgz', 'Check_Point_R80_40_JUMBO_HF_Bundle_T77_sk165456_FULL.tgz', 'jumbo', 'Installed as part of', '1970-01-01T00:00:00Z', 'Not Recommended', '2020-09-07T19:06:50Z'], # ['Check_Point_R80_40_JUMBO_HF_Bundle_T77_sk165456_FULL.tgz', 'Check_Point_R80_40_JUMBO_HF_Bundle_T77_sk165456_FULL.tgz', 'jumbo', 'Installed as part of', '1970-01-01T00:00:00Z', 'Not Recommended', '2020-09-07T19:06:50Z'],
# ['6', 'Check_Point_R81_T392_Fresh_Install_and_Upgrade.tgz', 'R81 Gaia Fresh Install and upgrade', 'major', 'Available for Download', '2020-10-22T00:00:00Z', 'Not Recommended', '1970-01-01T00:00:00Z'], # ['Check_Point_R81_T392_Fresh_Install_and_Upgrade.tgz', 'R81 Gaia Fresh Install and upgrade', 'major', 'Available for Download', '2020-10-22T00:00:00Z', 'Not Recommended', '1970-01-01T00:00:00Z'],
# ['7', 'Blink_image_1.1_Check_Point_R81_T392_SecurityManagement.tgz', '<b>[Latest] R81 Security Management for appliances </b>', 'major', 'Available for Download', '2020-10-22T00:00:00Z', 'Not Recommended', '1970-01-01T00:00:00Z'], # ['Blink_image_1.1_Check_Point_R81_T392_SecurityManagement.tgz', '<b>[Latest] R81 Security Management for appliances </b>', 'major', 'Available for Download', '2020-10-22T00:00:00Z', 'Not Recommended', '1970-01-01T00:00:00Z'],
# ['8', 'Blink_image_1.1_Check_Point_R80.40_T294_JHF_T78_SecurityManagement.tgz', '<b>[Latest] R80.40 Security Management + JHF T78 for Appliances and Open Servers</b>', 'major', 'Available for Download', '2020-08-24T00:00:00Z', 'Not Recommended', '1970-01-01T00:00:00Z'], # ['Blink_image_1.1_Check_Point_R80.40_T294_JHF_T78_SecurityManagement.tgz', '<b>[Latest] R80.40 Security Management + JHF T78 for Appliances and Open Servers</b>', 'major', 'Available for Download', '2020-08-24T00:00:00Z', 'Not Recommended', '1970-01-01T00:00:00Z'],
# ['9', 'Check_Point_R80.40_T294_Fresh_Install_and_Upgrade.tgz', 'Check Point R80.40 Gaia Fresh Install and upgrade', 'major', 'Available for Download', '2020-01-27T00:00:00Z', 'Not Recommended', '1970-01-01T00:00:00Z'] # ['Check_Point_R80.40_T294_Fresh_Install_and_Upgrade.tgz', 'Check Point R80.40 Gaia Fresh Install and upgrade', 'major', 'Available for Download', '2020-01-27T00:00:00Z', 'Not Recommended', '1970-01-01T00:00:00Z']
# ], # ],
# ] # ]
# #
...@@ -37,11 +37,10 @@ ...@@ -37,11 +37,10 @@
from typing import List, NamedTuple from typing import List, NamedTuple
from .agent_based_api.v1.type_defs import ( from .agent_based_api.v1.type_defs import (
StringTable, StringTable,
InventoryResult, InventoryResult,
) )
from .agent_based_api.v1 import ( from .agent_based_api.v1 import (
Attributes,
register, register,
SNMPTree, SNMPTree,
TableRow, TableRow,
...@@ -51,11 +50,13 @@ from .agent_based_api.v1 import ( ...@@ -51,11 +50,13 @@ from .agent_based_api.v1 import (
equals, equals,
) )
class CheckpointUpdatesRecommended(NamedTuple): class CheckpointUpdatesRecommended(NamedTuple):
name: str name: str
type: str type: str
status: list status: list
class CheckpointUpdatesAvailable(NamedTuple): class CheckpointUpdatesAvailable(NamedTuple):
filename: str filename: str
description: str description: str
...@@ -65,10 +66,12 @@ class CheckpointUpdatesAvailable(NamedTuple): ...@@ -65,10 +66,12 @@ class CheckpointUpdatesAvailable(NamedTuple):
recommended: str recommended: str
installedat: str installedat: str
class CheckpointUpdates(NamedTuple): class CheckpointUpdates(NamedTuple):
updatesrecommended: list updatesrecommended: list
updatesavailable: list updatesavailable: list
def parse_checkpoint_updates(string_table: List[StringTable]) -> CheckpointUpdates: def parse_checkpoint_updates(string_table: List[StringTable]) -> CheckpointUpdates:
section = CheckpointUpdates section = CheckpointUpdates
section.updatesrecommended = string_table[0] section.updatesrecommended = string_table[0]
...@@ -76,59 +79,20 @@ def parse_checkpoint_updates(string_table: List[StringTable]) -> CheckpointUpdat ...@@ -76,59 +79,20 @@ def parse_checkpoint_updates(string_table: List[StringTable]) -> CheckpointUpdat
return section return section
register.snmp_section(
name='checkpoint_inv_updates',
parse_function=parse_checkpoint_updates,
fetch=[
SNMPTree(
base='.1.3.6.1.4.1.2620.1.6.20.8.1', # CHECKPOINT-MIB::updatesRecommendedEntry
oids=[
'2', # updatesRecommendedName
'3', # updatesRecommendedType
'4', # updatesRecommendedStatus
]
),
SNMPTree(
base='.1.3.6.1.4.1.2620.1.6.20.10.1', # CHECKPOINT-MIB::availableUpdates
oids=[
'2', # filename
'3', # description
'4', # type
'5', # status
'6', # available_since
'7', # recommended
'8', # installed_at
]
),
],
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' ),
)
)
)
def inventory_checkpoint_updates(section: CheckpointUpdates) -> InventoryResult: def inventory_checkpoint_updates(section: CheckpointUpdates) -> InventoryResult:
path = ['software', 'check_point', 'updates']
path = ['software', 'check_point', 'updates']
for update in section.updatesrecommended: for update in section.updatesrecommended:
update = CheckpointUpdatesRecommended(*update) update = CheckpointUpdatesRecommended(*update)
yield TableRow( yield TableRow(
path=path, path=path,
key_columns={'file_name':update.name}, key_columns={'file_name': update.name},
inventory_columns={ inventory_columns={
# 'index': update.index, 'type': update.type,
'type': update.type, 'status': update.status,
'status': update.status, 'recommended': 'Recommended',
'recommended': 'Recommended', },
}, )
)
path = ['software', 'check_point', 'updates']
for update in section.updatesavailable: for update in section.updatesavailable:
update = CheckpointUpdatesAvailable(*update) update = CheckpointUpdatesAvailable(*update)
...@@ -136,24 +100,57 @@ def inventory_checkpoint_updates(section: CheckpointUpdates) -> InventoryResult: ...@@ -136,24 +100,57 @@ def inventory_checkpoint_updates(section: CheckpointUpdates) -> InventoryResult:
if not 'installed' in update.status.lower(): if not 'installed' in update.status.lower():
installedat = 'N/A' installedat = 'N/A'
else: else:
installedat = update.installedat.replace('T', ' ').replace('Z','') installedat = update.installedat.replace('T', ' ').replace('Z', '')
yield TableRow( yield TableRow(
path=path, path=path,
key_columns={'file_name':update.filename}, key_columns={'file_name': update.filename},
inventory_columns={ inventory_columns={
# 'index': update.index, 'description': update.description,
'description': update.description, 'type': update.type,
'type': update.type, 'status': update.status,
'status': update.status, 'recommended': update.recommended,
'recommended': update.recommended, 'available_since': update.availablesince[:10],
'available_since': update.availablesince[:10], 'installed_at': installedat,
'installed_at': installedat, },
}, )
)
register.snmp_section(
name='checkpoint_inv_updates',
parse_function=parse_checkpoint_updates,
fetch=[
SNMPTree(
base='.1.3.6.1.4.1.2620.1.6.20.8.1', # CHECKPOINT-MIB::updatesRecommendedEntry
oids=[
'2', # updatesRecommendedName
'3', # updatesRecommendedType
'4', # updatesRecommendedStatus
]
),
SNMPTree(
base='.1.3.6.1.4.1.2620.1.6.20.10.1', # CHECKPOINT-MIB::availableUpdates
oids=[
'2', # filename
'3', # description
'4', # type
'5', # status
'6', # available_since
'7', # recommended
'8', # installed_at
]
),
],
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.inventory_plugin( register.inventory_plugin(
name='checkpoint_inv_updates', name='checkpoint_inv_updates',
inventory_function=inventory_checkpoint_updates, inventory_function=inventory_checkpoint_updates,
) )
No preview for this file type
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
'num_files': 2, 'num_files': 2,
'title': 'Check Point appliance avilable updates inventory plugin', 'title': 'Check Point appliance avilable updates inventory plugin',
'version': '20210208.v.0.1', 'version': '20210208.v.0.1',
'version.min_required': '2.0.0i1', 'version.min_required': '2.0.0b8',
'version.packaged': '2020.11.27', 'version.packaged': '2.0.0b8',
'version.usable_until': None} '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