From 54a98e8ae8d4e7986e9bae24e194344c981ba012 Mon Sep 17 00:00:00 2001 From: Kenneth Okoh Date: Fri, 18 Jan 2019 12:20:35 +0100 Subject: [PATCH] Refactoring: Moved last check parameters from unsorted.py to dedicated modules (CMK-1393) Change-Id: Ief3a578e7f29d93dce658f140de9f87c7fac3013 --- .../wato/check_parameters/bossock_fibers.py | 45 +++ .../wato/check_parameters/carbon_monoxide.py | 48 +++ .../wato/check_parameters/domino_mailqueues.py | 66 +++++ .../plugins/wato/check_parameters/domino_tasks.py | 108 +++++++ .../wato/check_parameters/domino_transactions.py | 49 +++ .../plugins/wato/check_parameters/domino_users.py | 49 +++ .../check_parameters/heartbeat_crm_resources.py | 50 ++++ .../wato/check_parameters/netscaler_dnsrates.py | 65 ++++ .../wato/check_parameters/netscaler_sslcerts.py | 57 ++++ .../wato/check_parameters/netscaler_tcp_conns.py | 72 +++++ .../wato/check_parameters/siemens_plc_counter.py | 64 ++++ .../wato/check_parameters/siemens_plc_duration.py | 64 ++++ .../wato/check_parameters/siemens_plc_flag.py | 57 ++++ cmk/gui/plugins/wato/check_parameters/unsorted.py | 327 --------------------- 14 files changed, 794 insertions(+), 327 deletions(-) create mode 100644 cmk/gui/plugins/wato/check_parameters/bossock_fibers.py create mode 100644 cmk/gui/plugins/wato/check_parameters/carbon_monoxide.py create mode 100644 cmk/gui/plugins/wato/check_parameters/domino_mailqueues.py create mode 100644 cmk/gui/plugins/wato/check_parameters/domino_tasks.py create mode 100644 cmk/gui/plugins/wato/check_parameters/domino_transactions.py create mode 100644 cmk/gui/plugins/wato/check_parameters/domino_users.py create mode 100644 cmk/gui/plugins/wato/check_parameters/heartbeat_crm_resources.py create mode 100644 cmk/gui/plugins/wato/check_parameters/netscaler_dnsrates.py create mode 100644 cmk/gui/plugins/wato/check_parameters/netscaler_sslcerts.py create mode 100644 cmk/gui/plugins/wato/check_parameters/netscaler_tcp_conns.py create mode 100644 cmk/gui/plugins/wato/check_parameters/siemens_plc_counter.py create mode 100644 cmk/gui/plugins/wato/check_parameters/siemens_plc_duration.py create mode 100644 cmk/gui/plugins/wato/check_parameters/siemens_plc_flag.py diff --git a/cmk/gui/plugins/wato/check_parameters/bossock_fibers.py b/cmk/gui/plugins/wato/check_parameters/bossock_fibers.py new file mode 100644 index 0000000000..e633af5387 --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/bossock_fibers.py @@ -0,0 +1,45 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Integer, + TextAscii, + Tuple, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersStorage, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersStorage, "bossock_fibers", _("Number of Running Bossock Fibers"), + Tuple( + title=_("Number of fibers"), + elements=[ + Integer(title=_("Warning at"), unit=_("fibers")), + Integer(title=_("Critical at"), unit=_("fibers")), + ]), TextAscii(title=_("Node ID")), "first") diff --git a/cmk/gui/plugins/wato/check_parameters/carbon_monoxide.py b/cmk/gui/plugins/wato/check_parameters/carbon_monoxide.py new file mode 100644 index 0000000000..62389339c3 --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/carbon_monoxide.py @@ -0,0 +1,48 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Dictionary, + Integer, + Tuple, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersEnvironment, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersEnvironment, "carbon_monoxide", ("Carbon monoxide"), + Dictionary(elements=[ + ("levels_ppm", + Tuple( + title="Levels in parts per million", + elements=[ + Integer(title=_("Warning at"), unit=_("ppm"), default=10), + Integer(title=_("Critical at"), unit=_("ppm"), default=25), + ])), + ]), None, "dict") diff --git a/cmk/gui/plugins/wato/check_parameters/domino_mailqueues.py b/cmk/gui/plugins/wato/check_parameters/domino_mailqueues.py new file mode 100644 index 0000000000..778863e2bf --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/domino_mailqueues.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Dictionary, + DropdownChoice, + Integer, + Tuple, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersApplications, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersApplications, + "domino_mailqueues", + _("Lotus Domino Mail Queues"), + Dictionary( + elements=[ + ("queue_length", + Tuple( + title=_("Number of Mails in Queue"), + elements=[ + Integer(title=_("warning at"), default_value=300), + Integer(title=_("critical at"), default_value=350), + ])), + ], + required_keys=['queue_length'], + ), + DropdownChoice( + choices=[ + ('lnDeadMail', _('Mails in Dead Queue')), + ('lnWaitingMail', _('Mails in Waiting Queue')), + ('lnMailHold', _('Mails in Hold Queue')), + ('lnMailTotalPending', _('Total Pending Mails')), + ('InMailWaitingforDNS', _('Mails Waiting for DNS Queue')), + ], + title=_("Domino Mail Queue Names"), + ), + match_type="dict", +) diff --git a/cmk/gui/plugins/wato/check_parameters/domino_tasks.py b/cmk/gui/plugins/wato/check_parameters/domino_tasks.py new file mode 100644 index 0000000000..0601be7532 --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/domino_tasks.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Alternative, + Dictionary, + FixedValue, + Integer, + RegExp, + TextAscii, + Transform, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersApplications, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersApplications, + "domino_tasks", + _("Lotus Domino Tasks"), + Dictionary( + elements=[ + ( + "process", + Alternative( + title=_("Name of the task"), + style="dropdown", + elements=[ + TextAscii( + title=_("Exact name of the task"), + size=50, + ), + Transform( + RegExp( + size=50, + mode=RegExp.prefix, + ), + title=_("Regular expression matching tasks"), + help=_("This regex must match the beginning of the complete " + "command line of the task including arguments"), + 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))), + ("warnmin", + Integer( + title=_("Minimum number of matched tasks for WARNING state"), + default_value=1, + )), + ("okmin", + Integer( + title=_("Minimum number of matched tasks for OK state"), + default_value=1, + )), + ("okmax", + Integer( + title=_("Maximum number of matched tasks for OK state"), + default_value=99999, + )), + ("warnmax", + Integer( + title=_("Maximum number of matched tasks for WARNING state"), + default_value=99999, + )), + ], + required_keys=['warnmin', 'okmin', 'okmax', 'warnmax', 'process'], + ), + TextAscii( + title=_("Name of service"), + help=_("This name will be used in the description of the service"), + allow_empty=False, + regex="^[a-zA-Z_0-9 _.-]*$", + regex_error=_("Please use only a-z, A-Z, 0-9, space, underscore, " + "dot and hyphen for your service description"), + ), + match_type="dict", + has_inventory=False) diff --git a/cmk/gui/plugins/wato/check_parameters/domino_transactions.py b/cmk/gui/plugins/wato/check_parameters/domino_transactions.py new file mode 100644 index 0000000000..43f6125109 --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/domino_transactions.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Integer, + Tuple, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersApplications, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersApplications, + "domino_transactions", + _("Lotus Domino Transactions"), + Tuple( + title=_("Number of Transactions per Minute on a Lotus Domino Server"), + elements=[ + Integer(title=_("warning at"), default_value=30000), + Integer(title=_("critical at"), default_value=35000), + ]), + None, + match_type="first", +) diff --git a/cmk/gui/plugins/wato/check_parameters/domino_users.py b/cmk/gui/plugins/wato/check_parameters/domino_users.py new file mode 100644 index 0000000000..9db22945ec --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/domino_users.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Integer, + Tuple, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersApplications, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersApplications, + "domino_users", + _("Lotus Domino Users"), + Tuple( + title=_("Number of Lotus Domino Users"), + elements=[ + Integer(title=_("warning at"), default_value=1000), + Integer(title=_("critical at"), default_value=1500), + ]), + None, + match_type="first", +) diff --git a/cmk/gui/plugins/wato/check_parameters/heartbeat_crm_resources.py b/cmk/gui/plugins/wato/check_parameters/heartbeat_crm_resources.py new file mode 100644 index 0000000000..7499fef2ed --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/heartbeat_crm_resources.py @@ -0,0 +1,50 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Optional, + TextAscii, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersStorage, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersStorage, "heartbeat_crm_resources", + _("Heartbeat CRM resource status"), + Optional( + TextAscii(allow_empty=False), + title=_("Expected node"), + help=_("The hostname of the expected node to hold this resource."), + none_label=_("Do not enforce the resource to be hold by a specific node."), + ), + TextAscii( + title=_("Resource Name"), + help=_("The name of the cluster resource as shown in the service description."), + allow_empty=False, + ), "first") diff --git a/cmk/gui/plugins/wato/check_parameters/netscaler_dnsrates.py b/cmk/gui/plugins/wato/check_parameters/netscaler_dnsrates.py new file mode 100644 index 0000000000..c67507d7ac --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/netscaler_dnsrates.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Dictionary, + Float, + Tuple, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersApplications, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersApplications, "netscaler_dnsrates", + _("Citrix Netscaler DNS counter rates"), + Dictionary( + help=_("Counter rates of DNS parameters for Citrix Netscaler Loadbalancer " + "Appliances"), + elements=[ + ( + "query", + Tuple( + title=_("Upper Levels for Total Number of DNS queries"), + elements=[ + Float(title=_("Warning at"), default_value=1500.0, unit="/sec"), + Float(title=_("Critical at"), default_value=2000.0, unit="/sec") + ], + ), + ), + ( + "answer", + Tuple( + title=_("Upper Levels for Total Number of DNS replies"), + elements=[ + Float(title=_("Warning at"), default_value=1500.0, unit="/sec"), + Float(title=_("Critical at"), default_value=2000.0, unit="/sec") + ], + ), + ), + ]), None, "dict") diff --git a/cmk/gui/plugins/wato/check_parameters/netscaler_sslcerts.py b/cmk/gui/plugins/wato/check_parameters/netscaler_sslcerts.py new file mode 100644 index 0000000000..145dab1788 --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/netscaler_sslcerts.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Dictionary, + Integer, + TextAscii, + Tuple, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersApplications, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersApplications, + "netscaler_sslcerts", + _("Citrix Netscaler SSL certificates"), + Dictionary( + elements=[ + ( + 'age_levels', + Tuple( + title=_("Remaining days of validity"), + elements=[ + Integer(title=_("Warning below"), default_value=30, min_value=0), + Integer(title=_("Critical below"), default_value=10, min_value=0), + ], + ), + ), + ],), + TextAscii(title=_("Name of Certificate"),), + match_type="dict") diff --git a/cmk/gui/plugins/wato/check_parameters/netscaler_tcp_conns.py b/cmk/gui/plugins/wato/check_parameters/netscaler_tcp_conns.py new file mode 100644 index 0000000000..589b5ec5ab --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/netscaler_tcp_conns.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Dictionary, + Integer, + Tuple, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersApplications, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersApplications, "netscaler_tcp_conns", + _("Citrix Netscaler Loadbalancer TCP Connections"), + Dictionary(elements=[ + ( + "client_conns", + Tuple( + title=_("Max. number of client connections"), + elements=[ + Integer( + title=_("Warning at"), + default_value=25000, + ), + Integer( + title=_("Critical at"), + default_value=30000, + ), + ]), + ), + ( + "server_conns", + Tuple( + title=_("Max. number of server connections"), + elements=[ + Integer( + title=_("Warning at"), + default_value=25000, + ), + Integer( + title=_("Critical at"), + default_value=30000, + ), + ]), + ), + ]), None, "dict") diff --git a/cmk/gui/plugins/wato/check_parameters/siemens_plc_counter.py b/cmk/gui/plugins/wato/check_parameters/siemens_plc_counter.py new file mode 100644 index 0000000000..904fc7e5fb --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/siemens_plc_counter.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Dictionary, + Integer, + TextAscii, + Tuple, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersEnvironment, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersEnvironment, + "siemens_plc_counter", + _("Siemens PLC Counter"), + Dictionary( + elements=[ + ('levels', + Tuple( + title=_("Counter level"), + elements=[ + Integer(title=_("Warning at"),), + Integer(title=_("Critical at"),), + ])), + ], + help=_("This rule is used to configure thresholds for counter values read from " + "Siemens PLC devices."), + title=_("Counter levels"), + ), + TextAscii( + title=_("Device Name and Value Ident"), + help=_("You need to concatenate the device name which is configured in the special agent " + "for the PLC device separated by a space with the ident of the value which is also " + "configured in the special agent."), + ), + match_type="dict", +) diff --git a/cmk/gui/plugins/wato/check_parameters/siemens_plc_duration.py b/cmk/gui/plugins/wato/check_parameters/siemens_plc_duration.py new file mode 100644 index 0000000000..56c8340423 --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/siemens_plc_duration.py @@ -0,0 +1,64 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + Age, + Dictionary, + TextAscii, + Tuple, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersEnvironment, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersEnvironment, + "siemens_plc_duration", + _("Siemens PLC Duration"), + Dictionary( + elements=[ + ('duration', + Tuple( + title=_("Duration"), + elements=[ + Age(title=_("Warning at"),), + Age(title=_("Critical at"),), + ])), + ], + help=_("This rule is used to configure thresholds for duration values read from " + "Siemens PLC devices."), + title=_("Duration levels"), + ), + TextAscii( + title=_("Device Name and Value Ident"), + help=_("You need to concatenate the device name which is configured in the special agent " + "for the PLC device separated by a space with the ident of the value which is also " + "configured in the special agent."), + ), + match_type="dict", +) diff --git a/cmk/gui/plugins/wato/check_parameters/siemens_plc_flag.py b/cmk/gui/plugins/wato/check_parameters/siemens_plc_flag.py new file mode 100644 index 0000000000..252c3ca7b6 --- /dev/null +++ b/cmk/gui/plugins/wato/check_parameters/siemens_plc_flag.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# 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.valuespec import ( + DropdownChoice, + TextAscii, +) +from cmk.gui.plugins.wato import ( + RulespecGroupCheckParametersEnvironment, + register_check_parameters, +) + +register_check_parameters( + RulespecGroupCheckParametersEnvironment, + "siemens_plc_flag", + _("State of Siemens PLC Flags"), + DropdownChoice( + help=_("This rule sets the expected state, the one which should result in an OK state, " + "of the monitored flags of Siemens PLC devices."), + title=_("Expected flag state"), + choices=[ + (True, _("Expect the flag to be: On")), + (False, _("Expect the flag to be: Off")), + ], + default_value=True), + TextAscii( + title=_("Device Name and Value Ident"), + help=_("You need to concatenate the device name which is configured in the special agent " + "for the PLC device separated by a space with the ident of the value which is also " + "configured in the special agent."), + allow_empty=True), + match_type="first", +) diff --git a/cmk/gui/plugins/wato/check_parameters/unsorted.py b/cmk/gui/plugins/wato/check_parameters/unsorted.py index a3f7a81587..b90273ca3f 100644 --- a/cmk/gui/plugins/wato/check_parameters/unsorted.py +++ b/cmk/gui/plugins/wato/check_parameters/unsorted.py @@ -35,9 +35,7 @@ from cmk.gui.valuespec import ( Dictionary, Tuple, Integer, - Float, TextAscii, - Age, DropdownChoice, Checkbox, RegExp, @@ -47,7 +45,6 @@ from cmk.gui.valuespec import ( ListOf, ListOfStrings, FixedValue, - Optional, DualListChoice, RadioChoice, TextUnicode, @@ -56,11 +53,9 @@ from cmk.gui.valuespec import ( from cmk.gui.plugins.wato import ( RulespecGroupCheckParametersApplications, RulespecGroupCheckParametersDiscovery, - RulespecGroupCheckParametersEnvironment, RulespecGroupCheckParametersNetworking, RulespecGroupCheckParametersStorage, register_rule, - register_check_parameters, UserIconOrAction, ) from cmk.gui.plugins.wato.check_parameters.ps import process_level_elements @@ -995,325 +990,3 @@ register_rule( "support 64 bit counters but do not output any actual data " "in those counters. Listing those hosts in this rule forces " "them to use the interface check with 32 bit counters instead.")) - -register_check_parameters( - RulespecGroupCheckParametersStorage, "heartbeat_crm_resources", - _("Heartbeat CRM resource status"), - Optional( - TextAscii(allow_empty=False), - title=_("Expected node"), - help=_("The hostname of the expected node to hold this resource."), - none_label=_("Do not enforce the resource to be hold by a specific node."), - ), - TextAscii( - title=_("Resource Name"), - help=_("The name of the cluster resource as shown in the service description."), - allow_empty=False, - ), "first") - -register_check_parameters( - RulespecGroupCheckParametersApplications, - "domino_tasks", - _("Lotus Domino Tasks"), - Dictionary( - elements=[ - ( - "process", - Alternative( - title=_("Name of the task"), - style="dropdown", - elements=[ - TextAscii( - title=_("Exact name of the task"), - size=50, - ), - Transform( - RegExp( - size=50, - mode=RegExp.prefix, - ), - title=_("Regular expression matching tasks"), - help=_("This regex must match the beginning of the complete " - "command line of the task including arguments"), - 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))), - ("warnmin", - Integer( - title=_("Minimum number of matched tasks for WARNING state"), - default_value=1, - )), - ("okmin", - Integer( - title=_("Minimum number of matched tasks for OK state"), - default_value=1, - )), - ("okmax", - Integer( - title=_("Maximum number of matched tasks for OK state"), - default_value=99999, - )), - ("warnmax", - Integer( - title=_("Maximum number of matched tasks for WARNING state"), - default_value=99999, - )), - ], - required_keys=['warnmin', 'okmin', 'okmax', 'warnmax', 'process'], - ), - TextAscii( - title=_("Name of service"), - help=_("This name will be used in the description of the service"), - allow_empty=False, - regex="^[a-zA-Z_0-9 _.-]*$", - regex_error=_("Please use only a-z, A-Z, 0-9, space, underscore, " - "dot and hyphen for your service description"), - ), - match_type="dict", - has_inventory=False) - -register_check_parameters( - RulespecGroupCheckParametersApplications, - "domino_mailqueues", - _("Lotus Domino Mail Queues"), - Dictionary( - elements=[ - ("queue_length", - Tuple( - title=_("Number of Mails in Queue"), - elements=[ - Integer(title=_("warning at"), default_value=300), - Integer(title=_("critical at"), default_value=350), - ])), - ], - required_keys=['queue_length'], - ), - DropdownChoice( - choices=[ - ('lnDeadMail', _('Mails in Dead Queue')), - ('lnWaitingMail', _('Mails in Waiting Queue')), - ('lnMailHold', _('Mails in Hold Queue')), - ('lnMailTotalPending', _('Total Pending Mails')), - ('InMailWaitingforDNS', _('Mails Waiting for DNS Queue')), - ], - title=_("Domino Mail Queue Names"), - ), - match_type="dict", -) - -register_check_parameters( - RulespecGroupCheckParametersApplications, - "domino_users", - _("Lotus Domino Users"), - Tuple( - title=_("Number of Lotus Domino Users"), - elements=[ - Integer(title=_("warning at"), default_value=1000), - Integer(title=_("critical at"), default_value=1500), - ]), - None, - match_type="first", -) - -register_check_parameters( - RulespecGroupCheckParametersApplications, - "domino_transactions", - _("Lotus Domino Transactions"), - Tuple( - title=_("Number of Transactions per Minute on a Lotus Domino Server"), - elements=[ - Integer(title=_("warning at"), default_value=30000), - Integer(title=_("critical at"), default_value=35000), - ]), - None, - match_type="first", -) - -register_check_parameters( - RulespecGroupCheckParametersApplications, "netscaler_dnsrates", - _("Citrix Netscaler DNS counter rates"), - Dictionary( - help=_("Counter rates of DNS parameters for Citrix Netscaler Loadbalancer " - "Appliances"), - elements=[ - ( - "query", - Tuple( - title=_("Upper Levels for Total Number of DNS queries"), - elements=[ - Float(title=_("Warning at"), default_value=1500.0, unit="/sec"), - Float(title=_("Critical at"), default_value=2000.0, unit="/sec") - ], - ), - ), - ( - "answer", - Tuple( - title=_("Upper Levels for Total Number of DNS replies"), - elements=[ - Float(title=_("Warning at"), default_value=1500.0, unit="/sec"), - Float(title=_("Critical at"), default_value=2000.0, unit="/sec") - ], - ), - ), - ]), None, "dict") - -register_check_parameters( - RulespecGroupCheckParametersApplications, "netscaler_tcp_conns", - _("Citrix Netscaler Loadbalancer TCP Connections"), - Dictionary(elements=[ - ( - "client_conns", - Tuple( - title=_("Max. number of client connections"), - elements=[ - Integer( - title=_("Warning at"), - default_value=25000, - ), - Integer( - title=_("Critical at"), - default_value=30000, - ), - ]), - ), - ( - "server_conns", - Tuple( - title=_("Max. number of server connections"), - elements=[ - Integer( - title=_("Warning at"), - default_value=25000, - ), - Integer( - title=_("Critical at"), - default_value=30000, - ), - ]), - ), - ]), None, "dict") - -register_check_parameters( - RulespecGroupCheckParametersApplications, - "netscaler_sslcerts", - _("Citrix Netscaler SSL certificates"), - Dictionary( - elements=[ - ( - 'age_levels', - Tuple( - title=_("Remaining days of validity"), - elements=[ - Integer(title=_("Warning below"), default_value=30, min_value=0), - Integer(title=_("Critical below"), default_value=10, min_value=0), - ], - ), - ), - ],), - TextAscii(title=_("Name of Certificate"),), - match_type="dict") - -register_check_parameters( - RulespecGroupCheckParametersEnvironment, - "siemens_plc_flag", - _("State of Siemens PLC Flags"), - DropdownChoice( - help=_("This rule sets the expected state, the one which should result in an OK state, " - "of the monitored flags of Siemens PLC devices."), - title=_("Expected flag state"), - choices=[ - (True, _("Expect the flag to be: On")), - (False, _("Expect the flag to be: Off")), - ], - default_value=True), - TextAscii( - title=_("Device Name and Value Ident"), - help=_("You need to concatenate the device name which is configured in the special agent " - "for the PLC device separated by a space with the ident of the value which is also " - "configured in the special agent."), - allow_empty=True), - match_type="first", -) - -register_check_parameters( - RulespecGroupCheckParametersEnvironment, - "siemens_plc_duration", - _("Siemens PLC Duration"), - Dictionary( - elements=[ - ('duration', - Tuple( - title=_("Duration"), - elements=[ - Age(title=_("Warning at"),), - Age(title=_("Critical at"),), - ])), - ], - help=_("This rule is used to configure thresholds for duration values read from " - "Siemens PLC devices."), - title=_("Duration levels"), - ), - TextAscii( - title=_("Device Name and Value Ident"), - help=_("You need to concatenate the device name which is configured in the special agent " - "for the PLC device separated by a space with the ident of the value which is also " - "configured in the special agent."), - ), - match_type="dict", -) - -register_check_parameters( - RulespecGroupCheckParametersEnvironment, - "siemens_plc_counter", - _("Siemens PLC Counter"), - Dictionary( - elements=[ - ('levels', - Tuple( - title=_("Counter level"), - elements=[ - Integer(title=_("Warning at"),), - Integer(title=_("Critical at"),), - ])), - ], - help=_("This rule is used to configure thresholds for counter values read from " - "Siemens PLC devices."), - title=_("Counter levels"), - ), - TextAscii( - title=_("Device Name and Value Ident"), - help=_("You need to concatenate the device name which is configured in the special agent " - "for the PLC device separated by a space with the ident of the value which is also " - "configured in the special agent."), - ), - match_type="dict", -) - -register_check_parameters( - RulespecGroupCheckParametersStorage, "bossock_fibers", _("Number of Running Bossock Fibers"), - Tuple( - title=_("Number of fibers"), - elements=[ - Integer(title=_("Warning at"), unit=_("fibers")), - Integer(title=_("Critical at"), unit=_("fibers")), - ]), TextAscii(title=_("Node ID")), "first") - -register_check_parameters( - RulespecGroupCheckParametersEnvironment, "carbon_monoxide", ("Carbon monoxide"), - Dictionary(elements=[ - ("levels_ppm", - Tuple( - title="Levels in parts per million", - elements=[ - Integer(title=_("Warning at"), unit=_("ppm"), default=10), - Integer(title=_("Critical at"), unit=_("ppm"), default=25), - ])), - ]), None, "dict") -- 2.11.4.GIT