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 (
31 OptionalDropdownChoice
,
38 from cmk
.gui
.plugins
.wato
import (
41 RulespecGroupCheckParametersNetworking
,
42 register_check_parameters
,
46 def vs_interface_traffic():
48 return CascadingDropdown(
49 orientation
="horizontal",
50 choices
=[("perc", _("Percentual levels (in relation to port speed)"),
55 Percentage(label
=_("Warning at")),
56 Percentage(label
=_("Critical at")),
58 ("abs", _("Absolute levels in bits or bytes per second"),
63 Integer(label
=_("Warning at")),
64 Integer(label
=_("Critical at")),
65 ])), ("predictive", _("Predictive Levels"), PredictiveLevels())])
67 return CascadingDropdown(
68 orientation
="horizontal",
70 ("upper", _("Upper"), vs_abs_perc()),
71 ("lower", _("Lower"), vs_abs_perc()),
75 register_check_parameters(
76 RulespecGroupCheckParametersNetworking
,
78 _("Fibrechannel Interfaces"),
81 OptionalDropdownChoice(
82 title
=_("Operating speed"),
83 help=_("If you use this parameter then the check goes warning if the "
84 "interface is not operating at the expected speed (e.g. it "
85 "is working with 8Gbit/s instead of 16Gbit/s)."),
87 (None, _("ignore speed")),
88 (4000000000, "4 Gbit/s"),
89 (8000000000, "8 Gbit/s"),
90 (16000000000, "16 Gbit/s"),
92 otherlabel
=_("specify manually ->"),
94 title
=_("Other speed in bits per second"), label
=_("Bits per second")))),
99 orientation
="horizontal",
101 ('both', _("In / Out"), vs_interface_traffic()),
102 ('in', _("In"), vs_interface_traffic()),
103 ('out', _("Out"), vs_interface_traffic()),
105 title
=_("Used bandwidth (minimum or maximum traffic)"),
106 help=_("Setting levels on the used bandwidth is optional. If you do set "
107 "levels you might also consider using averaging."),
111 title
=_("Read latency"),
114 default_levels
=(50.0, 100.0))),
117 title
=_("Write latency"),
120 default_levels
=(50.0, 100.0))),
123 title
=_("Overall latency"),
126 default_levels
=(50.0, 100.0))),
128 TextAscii(title
=_("Port specification"), allow_empty
=False),