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

Delete active_checks_ntp.py

parent 61b4a44b
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 : 2022-10-04
# File : wato/active_checks_ntp.py
#
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
Tuple,
Transform,
Integer,
TextAscii,
MonitoringState,
)
from cmk.gui.plugins.wato import (
rulespec_registry,
HostRulespec,
)
from cmk.gui.plugins.wato.active_checks import (
RulespecGroupActiveChecks
)
def _valuespec_active_checks_ntp():
return Transform(
Dictionary(
title=_('Check NTP service'),
help=_(''),
elements=[
('description',
TextAscii(
title=_('Service description'),
help=_(
'Must be unique for every host. The service description starts always with \"NTP server\".'),
size=50,
)),
('server',
TextAscii(
title=_('Server IP-address or name'),
help=_(
'Hostname or IP-address to monitor. Default is the host name/IP-Address of the monitored host.'
),
size=50,
)),
('port',
Integer(
title=_('NTP port'),
help=_('UDP Port to use. Default is 123.'),
# size=5,
default_value=123,
minvalue=1,
maxvalue=65535,
)),
('version',
Integer(
title=_('NTP version'),
help=_('NTP version for the request. Default is version 4.'),
# size=1,
default_value=4,
minvalue=1,
maxvalue=4,
)),
('timeout',
Integer(
title=_('Request timeout'),
help=_('Timeoute for the request in seconds. Min: 1s, Max: 20, Default is 2 seconds.'),
# size=3,
default_value=2,
minvalue=1,
maxvalue=20,
)),
('state_not_synchronized',
MonitoringState(
title=_('Monitoring state if server is not synchronized'),
help=_('Monitoring state if server is not synchronized. Default is warning.'),
default_value=2,
)),
('state_no_response',
MonitoringState(
default_value=2,
title=_('Monitoring state if server doesn\'t respond (timeout)'),
help=_('Monitoring state if the server doesn\'t respond. Default is "CRIT"')
)),
('stratum_levels',
Tuple(
title=_('max. stratum'),
elements=[
Integer(
title=_('Warning at'),
default_value=10,
maxvalue=255,
minvalue=1,
help=_(
'The stratum (\'distance\' to the reference clock) at which the check gets warning.'),
),
Integer(
title=_('Critical at'),
default_value=15,
maxvalue=18,
help=_(
'The stratum (\'distance\' to the reference clock) at which the check gets critical.'),
)
],
)),
('offset_levels',
Tuple(
title=_('max. offset in ms'),
help=_('Mean offset in the times reported between this local host and the remote peer or server.'
'Note: This levels will also be used as lower levels.'),
elements=[
Integer(
title=_('Warning at'),
unit='ms',
default_value=200,
help=_('The offset in ms at which a warning state is triggered. Default is 200ms'),
),
Integer(
title=_('Critical at'),
unit='ms',
default_value=500,
help=_('The offset in ms at which a critical state is triggered. Default is 500ms'),
)
],
)),
('delay_levels',
Tuple(
title=_('max. delay in ms'),
help=_('Upper levels for delay in milly seconds.'),
elements=[
Integer(
title=_('Warning at'),
unit='ms',
default_value=200,
help=_('The delay in ms at which a warning state is triggered. Default is 200ms'),
),
Integer(
title=_('Critical at'),
unit='ms',
default_value=500,
help=_('The delay in s at which a critical state is triggered. Default is 500ms'),
)
],
)),
('dispersion_levels',
Tuple(
title=_('max. root dispersion in s'),
help=_('Upper levels for (root) dispersion in seconds.'),
elements=[
Integer(
title=_('Warning at'),
unit='s',
default_value=3,
help=_('The dispersion in s at which a warning state is triggered. Default is 3s'),
),
Integer(
title=_('Critical at'),
unit='s',
default_value=5,
help=_('The dispersion in s at which a critical state is triggered. Default is 5s'),
)
],
)),
],
),
)
rulespec_registry.register(
HostRulespec(
group=RulespecGroupActiveChecks,
match_type='all',
name='active_checks:ntp',
valuespec=_valuespec_active_checks_ntp,
)
)
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