49 lines
1.5 KiB
Python
49 lines
1.5 KiB
Python
#!/usr/bin/python
|
|
# -*- encoding: utf-8; py-indent-offset: 4 -*-
|
|
# 2024 Marius Pana <mp@spearhead.systems>
|
|
|
|
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(
|
|
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,
|
|
)),
|
|
],
|
|
)
|
|
|
|
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"),
|
|
)) |