checkmk-plugins/check_mk-scality-ring/local/share/check_mk/web/plugins/wato/scality_disks.py

53 lines
1.6 KiB
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from cmk.gui.i18n import _
from cmk.gui.plugins.wato.utils import (
CheckParameterRulespecWithItem,
rulespec_registry,
RulespecGroupCheckParametersApplications,
Transform,
)
from cmk.gui.valuespec import Dictionary, Integer, Tuple, TextInput
def _item_spec_scality_disks():
return TextInput(
title=_("Ring"), help=_("Ring Name")
)
def _parameter_valuespec_scality_disks():
return Dictionary(
elements=[
(
"disks",
Tuple(
help=_(
"This rule sets lower limits for the number of disks in the "
"scality ring system and it's applied for each RING"
),
title=_("Minimum number of disks:"),
elements=[
Integer(title=_("Warning below")),
Integer(title=_("Critical below")),
],
),
),
],
)
rulespec_registry.register(
CheckParameterRulespecWithItem(
check_group_name="scality_disks",
group=RulespecGroupCheckParametersApplications,
item_spec=_item_spec_scality_disks,
match_type="dict",
parameter_valuespec=_parameter_valuespec_scality_disks,
title=lambda: _("Scality Ring Disk Number"),
)
)