Пример #1
0
# tails. You should have  received  a copy of the  GNU  General Public
# License along with GNU Make; see the file  COPYING.  If  not,  write
# to the Free Software Foundation, Inc., 51 Franklin St,  Fifth Floor,
# Boston, MA 02110-1301 USA.

from cmk.gui.i18n import _
from cmk.gui.valuespec import TextAscii
from cmk.gui.plugins.wato import (
    RulespecGroupManualChecksStorage,
    ManualCheckParameterRulespec,
    rulespec_registry,
)


def _item_spec_raid():
    return TextAscii(
        title=_("Name of the device"),
        help=_("For Linux MD specify the device name without the "
               "<tt>/dev/</tt>, e.g. <tt>md0</tt>, for hardware raids "
               "please refer to the manual of the actual check being used."),
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="raid",
        group=RulespecGroupManualChecksStorage,
        item_spec=_item_spec_raid,
        title=lambda: _("RAID: overall state"),
    ))
Пример #2
0
                      Tuple(elements=[
                          Filesize(title=_("Warning below")),
                          Filesize(title=_("Critical below"))
                      ], )),
                     ("ignore", _("Do not impose levels")),
                 ],
             )),
        ],
        optional_keys=[],
    )


rulespec_registry.register(
    CheckParameterRulespecWithItem(
        check_group_name="sap_hana_memory",
        group=RulespecGroupCheckParametersApplications,
        item_spec=lambda: TextInput(title=_("The instance name")),
        match_type="dict",
        parameter_valuespec=_parameter_valuespec_sap_hana_memory,
        title=lambda: _("SAP HANA Memory"),
    ))

rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="sap_hana_proc",
        group=RulespecGroupEnforcedServicesApplications,
        item_spec=lambda: TextInput(title=_("The instance name")),
        match_type="dict",
        title=lambda: _("SAP HANA Process"),
    ))
Пример #3
0
        Tuple(elements=[
            Integer(title=_("Equal or more than"), unit=_("nodes")),
            Tuple(
                elements=[
                    Percentage(title=_("Warning at a utilization of"),
                               default_value=90.0),
                    Percentage(title=_("Critical at a utilization of"),
                               default_value=95.0)
                ],
                title=_("Alert on too high CPU utilization"),
            )
        ]),
        help=
        _("Configure levels for averaged CPU utilization depending on number of cluster nodes. "
          "The CPU utilization sums up the percentages of CPU time that is used "
          "for user processes and kernel routines over all available cores within "
          "the last check interval. The possible range is from 0% to 100%"),
        title=_("Memory Usage"),
        add_label=_("Add limits"),
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="cpu_utilization_cluster",
        group=RulespecGroupEnforcedServicesNetworking,
        parameter_valuespec=_parameter_valuespec_cpu_utilization_cluster,
        title=lambda: _("CPU Utilization of Clusters"),
        is_deprecated=True,
    ))
Пример #4
0
    return ListOf(
        Tuple(elements=[
            Integer(title=_("Equal or more than"), unit=_("nodes")),
            Tuple(
                elements=[
                    Percentage(title=_("Warning at a utilization of"),
                               default_value=90.0),
                    Percentage(title=_("Critical at a utilization of"),
                               default_value=95.0)
                ],
                title=_("Alert on too high CPU utilization"),
            )
        ]),
        help=
        _("Configure levels for averaged CPU utilization depending on number of cluster nodes. "
          "The CPU utilization sums up the percentages of CPU time that is used "
          "for user processes and kernel routines over all available cores within "
          "the last check interval. The possible range is from 0% to 100%"),
        title=_("Memory Usage"),
        add_label=_("Add limits"),
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="cpu_utilization_cluster",
        group=RulespecGroupManualChecksNetworking,
        parameter_valuespec=_parameter_valuespec_cpu_utilization_cluster,
        title=lambda: _("CPU Utilization of Clusters"),
    ))
Пример #5
0
                    "group_patterns",
                    ListOf(
                        Tuple(
                            help=_("This defines one file grouping pattern."),
                            show_titles=True,
                            orientation="vertical",
                            elements=[
                                TextInput(title=_("Include Pattern"), size=40),
                                TextInput(title=_("Exclude Pattern"), size=40),
                            ],
                        ),
                        title=_("Group patterns"),
                        help=_get_fileinfo_groups_help(),
                        add_label=_("Add pattern group"),
                    ),
                ),
            ] + get_fileinfo_groups_param_elements(),
        ),
        forth=_transform_manual_fileinfo_groups_params,
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="fileinfo-groups",
        group=RulespecGroupEnforcedServicesStorage,
        item_spec=_item_spec_fileinfo_groups,
        parameter_valuespec=_manual_parameter_valuespec_fileinfo_groups,
        title=lambda: _("Size, age and count of file groups"),
    ))
Пример #6
0
#!/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 import (
    ManualCheckParameterRulespec,
    rulespec_registry,
    RulespecGroupEnforcedServicesHardware,
)

rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="hw_errors",
        group=RulespecGroupEnforcedServicesHardware,
        title=lambda: _("Simple checks for BIOS/Hardware errors"),
    ))
Пример #7
0
#!/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 import (
    RulespecGroupManualChecksOperatingSystem,
    ManualCheckParameterRulespec,
    rulespec_registry,
)

rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="zypper",
        group=RulespecGroupManualChecksOperatingSystem,
        title=lambda: _("Zypper Updates"),
    ))
Пример #8
0
#!/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 import (
    RulespecGroupManualChecksVirtualization,
    ManualCheckParameterRulespec,
    rulespec_registry,
)

rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="vm_state",
        group=RulespecGroupManualChecksVirtualization,
        title=lambda: _("Overall state of a virtual machine (for example ESX VMs)"),
    ))
Пример #9
0
def _parameter_valuespec_mem_cluster():
    return ListOf(
        Tuple(
            elements=[
                Integer(title=_("Equal or more than"), unit=_("nodes")),
                Tuple(
                    title=_("Percentage of total RAM"),
                    elements=[
                        Percentage(title=_("Warning at a RAM usage of"), default_value=80.0),
                        Percentage(title=_("Critical at a RAM usage of"), default_value=90.0),
                    ],
                ),
            ]
        ),
        help=_("Here you can specify the total memory usage levels for clustered hosts."),
        title=_("Memory Usage"),
        add_label=_("Add limits"),
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="mem_cluster",
        group=RulespecGroupEnforcedServicesNetworking,
        parameter_valuespec=_parameter_valuespec_mem_cluster,
        title=lambda: _("Memory Usage of Clusters"),
        is_deprecated=True,
    )
)
Пример #10
0
#!/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.valuespec import TextInput
from cmk.gui.plugins.wato import (
    RulespecGroupEnforcedServicesEnvironment,
    ManualCheckParameterRulespec,
    rulespec_registry,
)


def _item_spec_temperature_auto():
    return TextInput(
        title=_("Sensor ID"),
        help=_("The identificator of the thermal sensor."),
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="temperature_auto",
        group=RulespecGroupEnforcedServicesEnvironment,
        is_deprecated=True,
        item_spec=_item_spec_temperature_auto,
        title=lambda: _("Temperature sensors with builtin levels"),
    ))
Пример #11
0
def _item_spec_wmic_process():
    return TextAscii(
        title=_("Process name for usage in the Nagios service description"),
        allow_empty=False,
    )


def _parameter_valuespec_wmic_process():
    return Tuple(elements=[
        TextAscii(
            title=_("Name of the process"),
            allow_empty=False,
        ),
        Integer(title=_("Memory warning at"), unit="MB"),
        Integer(title=_("Memory critical at"), unit="MB"),
        Integer(title=_("Pagefile warning at"), unit="MB"),
        Integer(title=_("Pagefile critical at"), unit="MB"),
        Percentage(title=_("CPU usage warning at")),
        Percentage(title=_("CPU usage critical at")),
    ], )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="wmic_process",
        group=RulespecGroupManualChecksApplications,
        item_spec=_item_spec_wmic_process,
        parameter_valuespec=_parameter_valuespec_wmic_process,
        title=lambda: _("Memory and CPU of processes on Windows"),
    ))
Пример #12
0
                 maxvalue=65535,
             )),
            ("max_states",
             Tuple(
                 title=_("Maximum number of connections or listeners"),
                 elements=[
                     Integer(title=_("Warning at")),
                     Integer(title=_("Critical at")),
                 ],
             )),
            ("min_states",
             Tuple(
                 title=_("Minimum number of connections or listeners"),
                 elements=[
                     Integer(title=_("Warning if below")),
                     Integer(title=_("Critical if below")),
                 ],
             )),
        ],
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="tcp_connections",
        group=RulespecGroupManualChecksNetworking,
        item_spec=_item_spec_tcp_connections,
        parameter_valuespec=_parameter_valuespec_tcp_connections,
        title=lambda: _("Monitor specific TCP/UDP connections and listeners"),
    ))
Пример #13
0
# | Copyright Mathias Kettner 2014             [email protected] |
# +------------------------------------------------------------------+
#
# This file is part of Check_MK.
# The official homepage is at http://mathias-kettner.de/check_mk.
#
# check_mk is free software;  you can redistribute it and/or modify it
# under the  terms of the  GNU General Public License  as published by
# the Free Software Foundation in version 2.  check_mk is  distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY;  with-
# out even the implied warranty of  MERCHANTABILITY  or  FITNESS FOR A
# PARTICULAR PURPOSE. See the  GNU General Public License for more de-
# tails. You should have  received  a copy of the  GNU  General Public
# License along with GNU Make; see the file  COPYING.  If  not,  write
# to the Free Software Foundation, Inc., 51 Franklin St,  Fifth Floor,
# Boston, MA 02110-1301 USA.

from cmk.gui.i18n import _
from cmk.gui.plugins.wato import (
    RulespecGroupManualChecksStorage,
    ManualCheckParameterRulespec,
    rulespec_registry,
)

rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="zpool_status",
        group=RulespecGroupManualChecksStorage,
        title=lambda: _("ZFS storage pool status"),
    ))
Пример #14
0
)


def _parameter_valuespec_mem_cluster():
    return ListOf(
        Tuple(elements=[
            Integer(title=_("Equal or more than"), unit=_("nodes")),
            Tuple(title=_("Percentage of total RAM"),
                  elements=[
                      Percentage(title=_("Warning at a RAM usage of"),
                                 default_value=80.0),
                      Percentage(title=_("Critical at a RAM usage of"),
                                 default_value=90.0),
                  ])
        ]),
        help=
        _("Here you can specify the total memory usage levels for clustered hosts."
          ),
        title=_("Memory Usage"),
        add_label=_("Add limits"),
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="mem_cluster",
        group=RulespecGroupManualChecksNetworking,
        parameter_valuespec=_parameter_valuespec_mem_cluster,
        title=lambda: _("Memory Usage of Clusters"),
    ))
Пример #15
0
                                forth=lambda x: x[1:],  # remove ~
                                back=lambda x: "~" + x,  # prefix ~
                            ),
                            FixedValue(
                                None,
                                totext="",
                                title=_("Match all tasks"),
                            )
                        ],
                        match=lambda x:
                        (not x and 2) or (x[0] == '~' and 1 or 0))),
                ("levels",
                 _vs_levels(
                     _("Specify levels on the minimum and maximum number of tasks."
                       ), )),
            ],
            optional_keys=False,
        ),
        forth=_transform_valuespec_domino_tasks,
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="domino_tasks",
        group=RulespecGroupEnforcedServicesApplications,
        item_spec=_item_spec_domino_tasks,
        parameter_valuespec=_parameter_valuespec_domino_tasks,
        title=lambda: _("Lotus Domino Tasks"),
    ))
Пример #16
0
    return Transform(
        Dictionary(elements=[
            ("process", process_match_options()),
            ("user", user_match_options()),
        ] + process_level_elements(),
                   ignored_keys=["match_groups"],
                   required_keys=["cpu_rescale_max"]),
        forth=ps_cleanup_params,
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="ps",
        group=RulespecGroupManualChecksApplications,
        item_spec=_manual_item_spec_ps,
        parameter_valuespec=_manual_parameter_valuespec_ps,
        title=lambda: _("State and count of processes"),
    ))


# In version 1.2.4 the check parameters for the resulting ps check
# where defined in the dicovery rule. We moved that to an own rule
# in the classical check parameter style. In order to support old
# configuration we allow reading old discovery rules and ship these
# settings in an optional sub-dictionary.
def convert_inventory_processes(old_dict):
    new_dict: Dict[str, Dict[str, Any]] = {"default_params": {}}
    for key in old_dict:
        if key in [
                'levels',
Пример #17
0
#!/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.valuespec import TextInput
from cmk.gui.plugins.wato import (
    RulespecGroupEnforcedServicesApplications,
    ManualCheckParameterRulespec,
    rulespec_registry,
)


def _item_spec_omd_status():
    return TextInput(
        title=_("Name of the OMD site"),
        help=_("The name of the OMD site to check the status for"),
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="omd_status",
        group=RulespecGroupEnforcedServicesApplications,
        item_spec=_item_spec_omd_status,
        title=lambda: _("OMD site status"),
    ))
Пример #18
0
from cmk.gui.i18n import _
from cmk.gui.plugins.wato import (
    CheckParameterRulespecWithItem,
    ManualCheckParameterRulespec,
    rulespec_registry,
    RulespecGroupCheckParametersApplications,
    RulespecGroupEnforcedServicesApplications,
)
from cmk.gui.valuespec import Dictionary, DropdownChoice, TextInput, Transform

rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="local",
        group=RulespecGroupEnforcedServicesApplications,
        item_spec=lambda: TextInput(title=_("Name of local item")),
        parameter_valuespec=lambda: Transform(Dictionary(elements=[]),
                                              forth=lambda p: {}),
        title=lambda: _("Local checks"),
    ))

# We only need the above, there are no "true" parameters to this check plugin.


def _deprecation_message() -> str:
    return _(
        'This ruleset is deprecated. Please use the ruleset <i>"%s"</i> instead.'
    ) % _("Aggregation options for clustered services")


def _parameter_valuespec_local():
    return Dictionary(elements=[