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

update project

parent 06bad375
No related branches found
No related tags found
No related merge requests found
......@@ -74,6 +74,7 @@ from cmk.base.plugins.agent_based.agent_based_api.v1.type_defs import (
@dataclass
class CheckpointIaDc:
index: int
status_code: int
status_str: str
events: int
......@@ -92,7 +93,7 @@ def parse_checkpoint_ia_adquery(string_table: StringTable) -> Optional[Dict[str,
domains = {}
for entry in string_table:
try:
status, domain, ipaddr, events = entry
index, status, domain, ipaddr, events = entry
except ValueError:
return
......@@ -102,6 +103,7 @@ def parse_checkpoint_ia_adquery(string_table: StringTable) -> Optional[Dict[str,
domains[domain].update({
ipaddr: CheckpointIaDc(
index=int(index),
status_code=int(status),
status_str=_dcstatus.get(status, f'unknown: {status}'),
events=int(events)
......@@ -136,8 +138,8 @@ def check_checkpoint_ia_adquery(item, params, section: Dict[str, Dict[str, Check
value = 0
yield from check_levels(
value=value,
label=f'DC {key} Events',
metric_name=f'checkpoint_ia_adquery_{dc_ip_address}',
label=f'DC{dc.index:02d} ({key}) Events',
metric_name=f'checkpoint_ia_adquery_dc_{dc.index}',
render_func=lambda v: f'{v:.2f}/s',
notice_only=True
)
......@@ -167,6 +169,7 @@ register.snmp_section(
fetch=SNMPTree(
base='.1.3.6.1.4.1.2620.1.38.25.1', # CHECKPOINT-MIB::identityAwarenessADQueryStatusEntry
oids=[
'1', # identityAwarenessADQueryStatusTableIndex
'2', # identityAwarenessADQueryStatusCurrStatus
'3', # identityAwarenessADQueryStatusDomainName
'4', # identityAwarenessADQueryStatusDomainIP
......@@ -184,7 +187,7 @@ register.snmp_section(
register.check_plugin(
name='checkpoint_ia_adquery',
service_name='Identity Awareness AD Domain %s',
service_name='IA AD Domain %s',
discovery_function=discovery_checkpoint_ia_adquery,
check_function=check_checkpoint_ia_adquery,
check_default_parameters={
......
......@@ -224,7 +224,7 @@ register.snmp_section(
register.check_plugin(
name='checkpoint_identity_awareness',
service_name='Identity Awareness status',
service_name='IA summary',
discovery_function=discovery_checkpoint_identity_awareness,
check_function=check_checkpoint_identity_awareness,
check_default_parameters={
......
No preview for this file type
......@@ -17,93 +17,42 @@ from cmk.gui.plugins.metrics import (
metric_info,
graph_info,
perfometer_info,
indexed_color,
)
metric_info['checkpoint_ia_adquery_summary'] = {
'title': _('Events summary'),
'unit': '1/s',
'color': '11/b',
}
# create one metric per dc
metric_info['checkpoint_ia_adquery_dc_10_140_110_1'] = {
'title': _('SDACDOM401 (10.140.110.1)'),
'unit': '1/s',
'color': '12/a',
}
metric_info['checkpoint_ia_adquery_dc_10_140_110_2'] = {
'title': _('SDACDOM402 (10.140.110.2)'),
'unit': '1/s',
'color': '22/a',
}
_MAX_DCS = 48 # max colors ;-)
metric_info['checkpoint_ia_adquery_dc_10_215_2_252'] = {
'title': _('SDACDOM02 (10.215.2.252)'),
'unit': '1/s',
'color': '22/a',
}
metric_info['checkpoint_ia_adquery_dc_10_215_2_253'] = {
'title': _('SDACDOM01 (10.215.2.253)'),
'unit': '1/s',
'color': '32/a',
}
metric_info['checkpoint_ia_adquery_dc_10_225_110_240'] = {
'title': _('SDACDNS01 (10.225.110.240)'),
metric_info['checkpoint_ia_adquery_events_sum'] = {
'title': _('Events summary'),
'unit': '1/s',
'color': '42/a',
'color': '26/a',
}
metric_info['checkpoint_ia_adquery_dc_10_250_1_112'] = {
'title': _('S250AD01 (10.250.1.112)'),
'unit': '1/s',
'color': '33/a',
}
metric_info['checkpoint_ia_adquery_dc_10_250_1_113'] = {
'title': _('S250AD02 (10.250.1.113)'),
'unit': '1/s',
'color': '43/a',
}
#
#
#
for i in range(1, _MAX_DCS):
# generate different colors for each DC.
# unfortunately there are only 24 colors on our
# color wheel, times two for two shades each, we
# can only draw 48 differently colored graphs
metric_info[f'checkpoint_ia_adquery_dc_{i}'] = {
'title': _(f'DC{i:02d} Events'),
'unit': '1/s',
'color': indexed_color(i, _MAX_DCS),
}
dc_metric = ([(f'checkpoint_ia_adquery_dc_{num:d}', 'stack') for num in range(_MAX_DCS, 0, -1)])
dc_metric.insert(0, ('checkpoint_ia_adquery_events_sum', 'line'))
graph_info['checkpoint_ia_adquery_dc'] = {
'title': _('Check Point Identity Awareness AD queries'),
'metrics': [
('checkpoint_ia_adquery_summary', 'line'),
('checkpoint_ia_adquery_dc_10_250_1_112', 'stack'),
('checkpoint_ia_adquery_dc_10_250_1_113', 'stack'),
],
'optional_metrics': [
'checkpoint_ia_adquery_dc_10_250_1_112',
'checkpoint_ia_adquery_dc_10_250_1_113',
],
'metrics': dc_metric,
'range': (0, None),
'optional_metrics': [f'checkpoint_ia_adquery_dc_{num:d}' for num in range(0, _MAX_DCS + 1)]
}
# graph_info.append({
# 'title': _('Check Point Identity Awareness AD queries'),
# 'metrics': [
# ('checkpoint_ia_adquery_summary', 'line'),
# ('checkpoint_ia_adquery_dc_10_140_110_1', 'stack'),
# ('checkpoint_ia_adquery_dc_10_140_110_2', 'stack'),
# ],
# })
# graph_info.append({
# 'title': _('Check Point Identity Awareness AD queries'),
# 'metrics': [
# ('checkpoint_ia_adquery_summary', 'line'),
# ('checkpoint_ia_adquery_dc_10_215_2_252', 'stack'),
# ('checkpoint_ia_adquery_dc_10_215_2_253', 'stack'),
# ('checkpoint_ia_adquery_dc_10_225_110_240', 'stack'),
# ],
# })
perfometer_info.append({
'type': 'linear',
'segments': [
'checkpoint_ia_adquery_summary',
'checkpoint_ia_adquery_events_sum',
],
'total': 100,
})
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