check_mk-check-selinux/web/plugins/wato/selinux_check_parameters.py

49 lines
1.5 KiB
Python
Raw Normal View History

2018-06-12 09:35:31 +03:00
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
2024-01-12 15:32:52 +02:00
# 2024 Marius Pana <mp@spearhead.systems>
2018-06-12 09:35:31 +03:00
2024-01-12 15:32:52 +02:00
from cmk.gui.i18n import _
from cmk.gui.valuespec import (
Dictionary,
# Integer,
# TextInput,
)
from cmk.gui.plugins.wato.utils import (
CheckParameterRulespecWithoutItem,
rulespec_registry,
RulespecGroupCheckParametersOperatingSystem,
)
#def _item_valuespec_selinux():
# return TextInput(title="SELinux state", help="SELinux state configuration")
def _parameter_valuespec_selinux():
return Dictionary(
2018-06-12 09:35:31 +03:00
elements = [
( "modedisabled",
MonitoringState(
title = _("State when SELinux is disabled"),
default_value = 2,
)),
( "curmodepermissive",
MonitoringState(
title = _("State when SELinux current mode is permissive"),
default_value = 1,
)),
( "filemodepermissive",
MonitoringState(
title = _("State when SELinux file mode is permissive"),
default_value = 2,
)),
2024-01-12 15:32:52 +02:00
],
)
rulespec_registry.register(
CheckParameterRulespecWithoutItem(
check_group_name="selinux",
group=RulespecGroupCheckParametersOperatingSystem,
match_type="dict",
#item_spec=_item_valuespec_selinux,
parameter_valuespec=_parameter_valuespec_selinux,
title=lambda: _("SELinux states"),
))