示例#1
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.utils import (
    ManualCheckParameterRulespec,
    rulespec_registry,
    RulespecGroupEnforcedServicesApplications,
)
from cmk.gui.valuespec import TextInput


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"),
    ))
示例#2
0
def _parameter_valuespec_mem_cluster():
    return ListOf(
        valuespec=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,
    ))
示例#3
0
def _item_spec_wmic_process():
    return TextInput(
        title=_("Process name for usage in the Nagios service description"),
        allow_empty=False,
    )


def _parameter_valuespec_wmic_process():
    return Tuple(elements=[
        TextInput(
            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=RulespecGroupEnforcedServicesApplications,
        item_spec=_item_spec_wmic_process,
        parameter_valuespec=_parameter_valuespec_wmic_process,
        title=lambda: _("Memory and CPU of processes on Windows"),
    ))
示例#4
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.utils import (
    ManualCheckParameterRulespec,
    rulespec_registry,
    RulespecGroupEnforcedServicesVirtualization,
)

rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="vm_state",
        group=RulespecGroupEnforcedServicesVirtualization,
        title=lambda: _(
            "Overall state of a virtual machine (for example ESX VMs)"),
    ))
示例#5
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.utils import (
    ManualCheckParameterRulespec,
    rulespec_registry,
    RulespecGroupEnforcedServicesHardware,
)

rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="hw_errors",
        group=RulespecGroupEnforcedServicesHardware,
        title=lambda: _("Simple checks for BIOS/Hardware errors"),
    ))
示例#6
0
        parameter_valuespec=_parameter_valuespec_sap_hana_memory,
        title=lambda: _("SAP HANA Memory"),
    )
)


def _parameter_valuespec_sap_hana_proc():
    return Dictionary(
        required_keys=["coordin"],
        elements=[
            (
                "coordin",
                TextInput(
                    title=_("Role"),
                    allow_empty=False,
                ),
            )
        ],
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="sap_hana_proc",
        group=RulespecGroupEnforcedServicesApplications,
        item_spec=lambda: TextInput(title=_("The instance name")),
        parameter_valuespec=_parameter_valuespec_sap_hana_proc,
        title=lambda: _("SAP HANA Process"),
    )
)
                        unit=_("mails"),
                        minvalue=0,
                    ),
                    Integer(
                        title=_("Critical at"),
                        default_value=100,
                        unit=_("mails"),
                        minvalue=0,
                    ),
                ],
            ),
        ) for queue in [
            "postfix",
            "incoming",
            "active",
            "deferred",
            "hold",
            "maildrop",
            "z1",
        ]],
    )


rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="zertificon_mail_queues",
        group=RulespecGroupEnforcedServicesApplications,
        parameter_valuespec=_parameter_valuespec,
        title=lambda: _("Zertificon Mail Queues"),
    ))
示例#8
0
                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=RulespecGroupEnforcedServicesNetworking,
        item_spec=_item_spec_tcp_connections,
        parameter_valuespec=_parameter_valuespec_tcp_connections,
        title=lambda: _("Monitor specific TCP/UDP connections and listeners"),
    ))
示例#9
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.utils import (
    ManualCheckParameterRulespec,
    rulespec_registry,
    RulespecGroupEnforcedServicesStorage,
)

rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="zpool_status",
        group=RulespecGroupEnforcedServicesStorage,
        title=lambda: _("ZFS storage pool status"),
    ))
示例#10
0
from cmk.gui.i18n import _
from cmk.gui.plugins.wato.utils 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=[
示例#11
0
        valuespec=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,
    ))
示例#12
0
                ("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=RulespecGroupEnforcedServicesApplications,
        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 discovery 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 [
示例#13
0
# -*- 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 (
    ManualCheckParameterRulespec,
    rulespec_registry,
    RulespecGroupEnforcedServicesStorage,
)
from cmk.gui.valuespec import TextInput


def _item_spec_raid():
    return TextInput(
        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=RulespecGroupEnforcedServicesStorage,
        item_spec=_item_spec_raid,
        title=lambda: _("RAID: overall state"),
    ))
示例#14
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.utils import (
    ManualCheckParameterRulespec,
    rulespec_registry,
    RulespecGroupEnforcedServicesOperatingSystem,
)

rulespec_registry.register(
    ManualCheckParameterRulespec(
        check_group_name="zypper",
        group=RulespecGroupEnforcedServicesOperatingSystem,
        title=lambda: _("Zypper Updates"),
    )
)
示例#15
0
                                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
                    "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"),
    ))
示例#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.plugins.wato.utils import (
    ManualCheckParameterRulespec,
    rulespec_registry,
    RulespecGroupEnforcedServicesEnvironment,
)
from cmk.gui.valuespec import TextInput


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"),
    ))