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

update project

parent 4b5d38f9
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@
# Monitor Check Point Maestro SMO Chassis status (asg monitor)
#
# 2021-02-25: rewrite for CMK 2.x
# added warning/critical is chassis grade not equeal maxGrade
#
# ToDo: add warning if SGM/Chassis is missing compared to inventory time
#
......@@ -92,6 +93,7 @@ class CheckPointASGChassisInfo(NamedTuple):
synctoactive: str
synctostandby: str
class CheckPointASGChassisParams(NamedTuple):
id: str
status: str
......@@ -99,6 +101,7 @@ class CheckPointASGChassisParams(NamedTuple):
maxgrade: str
uniqueip: str
class CheckPointASGChassisSgms(NamedTuple):
id: str
status: str
......@@ -110,7 +113,7 @@ class CheckPointASGChassis(NamedTuple):
sgms: List
def parse_checkpoint_asg_chassis(string_table: List[StringTable]): #-> CheckPointASGChassis:
def parse_checkpoint_asg_chassis(string_table: List[StringTable]): # -> CheckPointASGChassis:
chassis = CheckPointASGChassis
try:
chassis.info = CheckPointASGChassisInfo(*string_table[0][0])
......@@ -128,9 +131,8 @@ def discovery_checkpoint_asg_chassis(section: CheckPointASGChassis) -> Discovery
def check_checkpoint_asg_chassis(params, section: CheckPointASGChassis) -> CheckResult:
details = ''
details += '\n\nTo verify this output use the "asg monitor" CLI command on the Check Point SMO,\n'
details += '\nTo verify this output use the "asg monitor" CLI command on the Check Point SMO,\n'
details += '\nChassis Mode: %s' % section.info.mode
details += '\nH/A Mode: %s' % section.info.hamode
details += '\nSync to active: %s' % section.info.synctoactive
......@@ -142,16 +144,17 @@ def check_checkpoint_asg_chassis(params, section: CheckPointASGChassis) -> Check
chassis = CheckPointASGChassisParams(*chassis)
if chassis.uniqueip != 'N/A':
details += '\nChassis %s unique IP: %s' % (chassis.id, chassis.uniqueip)
details += '\nChassis %s unique IP: %s' % (chassis.id, chassis.uniqueip)
for inv_chassis in inv_chassis_parms:
inv_chassis = CheckPointASGChassisParams(*inv_chassis)
if chassis.id == inv_chassis.id:
yield_text = 'Chassis %s: %s, grade: %s/%s' % (chassis.id, chassis.status,chassis.grade,chassis.maxgrade)
if not chassis.status.lower() in ['active', 'standby']:
yield_text = 'Chassis %s: %s, grade: %s/%s' % (
chassis.id, chassis.status, chassis.grade, chassis.maxgrade)
if not chassis.status.lower() in ['active', 'standby'] or chassis.grade != chassis.maxgrade:
yield Result(state=State.CRIT, summary=yield_text)
elif (chassis.status != inv_chassis.status) or (chassis.grade != inv_chassis.grade) or (chassis.maxgrade != inv_chassis.maxgrade):
yield Result(State.WARNING, notice=yield_text + ' (expected: %s, grade: %s/%s)' % (inv_chassis.status, inv_chassis.grade, inv_chassis.maxgrade))
yield Result(State.WARNING, notice=yield_text + ' (expected: %s, grade: %s/%s)' % (inv_chassis.status, inv_chassis.grade, inv_chassis.maxgrade))
else:
yield Result(state=State.OK, summary=yield_text)
......@@ -167,6 +170,7 @@ def check_checkpoint_asg_chassis(params, section: CheckPointASGChassis) -> Check
summary='%d/%d SGMs active' % (active_sgms, len(section.sgms)),
details=details)
register.snmp_section(
name='checkpoint_asg_chassis',
parse_function=parse_checkpoint_asg_chassis,
......
......@@ -8,7 +8,8 @@ description:
and of the Security Gateway Modules (SGM).
The Check goes into warning if the chassis state is not equal compared to the state at invetory time.
If the chassis state is not "ACTIVE" or "STANDBY" the check goes critical. Also if a SGM not "ACTIVE".
To verify the output of this check use the "asg monitor" CLI command on the Check Point Single Management Object (SMO).
default thresholds are:
there are no defaults.
......
No preview for this file type
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