2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
27 from cmk
.gui
.i18n
import _
28 from cmk
.gui
.valuespec
import (
38 from cmk
.gui
.plugins
.wato
import (
39 RulespecGroupCheckParametersApplications
,
40 RulespecGroupCheckParametersDiscovery
,
41 register_check_parameters
,
46 RulespecGroupCheckParametersDiscovery
,
47 varname
="discovery_win_dhcp_pools",
48 title
=_("Discovery of Windows DHCP Pools"),
49 valuespec
=Dictionary(elements
=[
52 title
=_("Discovery of empty DHCP pools"),
53 label
=_("Include empty pools into the monitoring"),
54 help=_("You can activate the creation of services for "
55 "DHCP pools, which contain no IP addresses."),
61 register_check_parameters(
62 RulespecGroupCheckParametersApplications
,
64 _("DHCP Pools for Windows and Linux"),
70 title
= _("Free leases levels"),
73 title
= _("Free leases levels in percent"),
75 Percentage(title
= _("Warning if below"), default_value
= 10.0),
76 Percentage(title
= _("Critical if below"), default_value
= 5.0)
80 title
= _("Absolute free leases levels"),
82 Integer(title
= _("Warning if below"), unit
= _("free leases")),
83 Integer(title
= _("Critical if below"), unit
= _("free leases"))
91 title
= _("Used leases levels"),
94 title
= _("Used leases levels in percent"),
96 Percentage(title
= _("Warning if below")),
97 Percentage(title
= _("Critical if below"))
101 title
= _("Absolute used leases levels"),
103 Integer(title
= _("Warning if below"), unit
= _("used leases")),
104 Integer(title
= _("Critical if below"), unit
= _("used leases"))
112 forth
= lambda params
: isinstance(params
, tuple) and {"free_leases" : (float(params
[0]), float(params
[1]))} or params
,
115 title
= _("Pool name"),
118 match_type
= "first",)