Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / cmk / gui / plugins / wato / check_parameters / fc_port.py
blob639a10d0034046c622af9f12ac0f2624444a864d
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
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 (
29 Alternative,
30 Dictionary,
31 Float,
32 Integer,
33 Percentage,
34 TextAscii,
35 Tuple,
37 from cmk.gui.plugins.wato import (
38 RulespecGroupCheckParametersStorage,
39 register_check_parameters,
42 register_check_parameters(
43 RulespecGroupCheckParametersStorage,
44 "fc_port",
45 _("FibreChannel Ports (FCMGMT MIB)"),
46 Dictionary(elements=[
47 ("bw",
48 Alternative(
49 title=_("Throughput levels"),
50 help=_("Please note: in a few cases the automatic detection of the link speed "
51 "does not work. In these cases you have to set the link speed manually "
52 "below if you want to monitor percentage values"),
53 elements=[
54 Tuple(
55 title=_("Used bandwidth of port relative to the link speed"),
56 elements=[
57 Percentage(title=_("Warning at"), unit=_("percent")),
58 Percentage(title=_("Critical at"), unit=_("percent")),
59 ]),
60 Tuple(
61 title=_("Used Bandwidth of port in megabyte/s"),
62 elements=[
63 Integer(title=_("Warning at"), unit=_("MByte/s")),
64 Integer(title=_("Critical at"), unit=_("MByte/s")),
66 ])),
67 ("assumed_speed",
68 Float(
69 title=_("Assumed link speed"),
70 help=_("If the automatic detection of the link speed does "
71 "not work you can set the link speed here."),
72 unit=_("Gbit/s"))),
73 ("rxcrcs",
74 Tuple(
75 title=_("CRC errors rate"),
76 elements=[
77 Percentage(title=_("Warning at"), unit=_("percent")),
78 Percentage(title=_("Critical at"), unit=_("percent")),
79 ])),
80 ("rxencoutframes",
81 Tuple(
82 title=_("Enc-Out frames rate"),
83 elements=[
84 Percentage(title=_("Warning at"), unit=_("percent")),
85 Percentage(title=_("Critical at"), unit=_("percent")),
86 ])),
87 ("notxcredits",
88 Tuple(
89 title=_("No-TxCredits errors"),
90 elements=[
91 Percentage(title=_("Warning at"), unit=_("percent")),
92 Percentage(title=_("Critical at"), unit=_("percent")),
93 ])),
94 ("c3discards",
95 Tuple(
96 title=_("C3 discards"),
97 elements=[
98 Percentage(title=_("Warning at"), unit=_("percent")),
99 Percentage(title=_("Critical at"), unit=_("percent")),
100 ])),
101 ("average",
102 Integer(
103 title=_("Averaging"),
104 help=_("If this parameter is set, all throughputs will be averaged "
105 "over the specified time interval before levels are being applied. Per "
106 "default, averaging is turned off. "),
107 unit=_("minutes"),
108 minvalue=1,
109 default_value=5,
111 #("phystate",
112 # Optional(
113 # ListChoice(
114 # title=_("Allowed states (otherwise check will be critical)"),
115 # choices=[
116 # (1, _("unknown")),
117 # (2, _("failed")),
118 # (3, _("bypassed")),
119 # (4, _("active")),
120 # (5, _("loopback")),
121 # (6, _("txfault")),
122 # (7, _("nomedia")),
123 # (8, _("linkdown")),
124 # ]),
125 # title=_("Physical state of port"),
126 # negate=True,
127 # label=_("ignore physical state"),
128 # )),
129 #("opstate",
130 # Optional(
131 # ListChoice(
132 # title=_("Allowed states (otherwise check will be critical)"),
133 # choices=[
134 # (1, _("unknown")),
135 # (2, _("unused")),
136 # (3, _("ready")),
137 # (4, _("warning")),
138 # (5, _("failure")),
139 # (6, _("not participating")),
140 # (7, _("initializing")),
141 # (8, _("bypass")),
142 # (9, _("ols")),
143 # ]),
144 # title=_("Operational state"),
145 # negate=True,
146 # label=_("ignore operational state"),
147 # )),
148 #("admstate",
149 # Optional(
150 # ListChoice(
151 # title=_("Allowed states (otherwise check will be critical)"),
152 # choices=[
153 # (1, _("unknown")),
154 # (2, _("online")),
155 # (3, _("offline")),
156 # (4, _("bypassed")),
157 # (5, _("diagnostics")),
158 # ]),
159 # title=_("Administrative state"),
160 # negate=True,
161 # label=_("ignore administrative state"),
162 # ))
164 TextAscii(
165 title=_("port name"),
166 help=_("The name of the FC port"),
168 match_type="dict",