Cleanup config.nodes_of
[check_mk.git] / cmk / gui / plugins / wato / check_parameters / fc_port.py
blobaabe70ba9498401c8ca8368d3d4ed5c04560227c
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,
38 from cmk.gui.plugins.wato import (
39 CheckParameterRulespecWithItem,
40 rulespec_registry,
41 RulespecGroupCheckParametersStorage,
45 @rulespec_registry.register
46 class RulespecCheckgroupParametersFcPort(CheckParameterRulespecWithItem):
47 @property
48 def group(self):
49 return RulespecGroupCheckParametersStorage
51 @property
52 def check_group_name(self):
53 return "fc_port"
55 @property
56 def title(self):
57 return _("FibreChannel Ports (FCMGMT MIB)")
59 @property
60 def match_type(self):
61 return "dict"
63 @property
64 def parameter_valuespec(self):
65 return Dictionary(
66 elements=[
67 ("bw",
68 Alternative(
69 title=_("Throughput levels"),
70 help=_("Please note: in a few cases the automatic detection of the link speed "
71 "does not work. In these cases you have to set the link speed manually "
72 "below if you want to monitor percentage values"),
73 elements=[
74 Tuple(
75 title=_("Used bandwidth of port relative to the link speed"),
76 elements=[
77 Percentage(title=_("Warning at"), unit=_("percent")),
78 Percentage(title=_("Critical at"), unit=_("percent")),
81 Tuple(
82 title=_("Used Bandwidth of port in megabyte/s"),
83 elements=[
84 Integer(title=_("Warning at"), unit=_("MByte/s")),
85 Integer(title=_("Critical at"), unit=_("MByte/s")),
89 )),
90 ("assumed_speed",
91 Float(
92 title=_("Assumed link speed"),
93 help=_("If the automatic detection of the link speed does "
94 "not work you can set the link speed here."),
95 unit=_("Gbit/s"))),
96 ("rxcrcs",
97 Tuple(
98 title=_("CRC errors rate"),
99 elements=[
100 Percentage(title=_("Warning at"), unit=_("percent")),
101 Percentage(title=_("Critical at"), unit=_("percent")),
104 ("rxencoutframes",
105 Tuple(
106 title=_("Enc-Out frames rate"),
107 elements=[
108 Percentage(title=_("Warning at"), unit=_("percent")),
109 Percentage(title=_("Critical at"), unit=_("percent")),
112 ("notxcredits",
113 Tuple(
114 title=_("No-TxCredits errors"),
115 elements=[
116 Percentage(title=_("Warning at"), unit=_("percent")),
117 Percentage(title=_("Critical at"), unit=_("percent")),
120 ("c3discards",
121 Tuple(
122 title=_("C3 discards"),
123 elements=[
124 Percentage(title=_("Warning at"), unit=_("percent")),
125 Percentage(title=_("Critical at"), unit=_("percent")),
128 ("average",
129 Integer(
130 title=_("Averaging"),
131 help=_("If this parameter is set, all throughputs will be averaged "
132 "over the specified time interval before levels are being applied. Per "
133 "default, averaging is turned off. "),
134 unit=_("minutes"),
135 minvalue=1,
136 default_value=5,
138 #("phystate",
139 # Optional(
140 # ListChoice(
141 # title=_("Allowed states (otherwise check will be critical)"),
142 # choices=[
143 # (1, _("unknown")),
144 # (2, _("failed")),
145 # (3, _("bypassed")),
146 # (4, _("active")),
147 # (5, _("loopback")),
148 # (6, _("txfault")),
149 # (7, _("nomedia")),
150 # (8, _("linkdown")),
151 # ],),
152 # title=_("Physical state of port"),
153 # negate=True,
154 # label=_("ignore physical state"),
155 # )),
156 #("opstate",
157 # Optional(
158 # ListChoice(
159 # title=_("Allowed states (otherwise check will be critical)"),
160 # choices=[
161 # (1, _("unknown")),
162 # (2, _("unused")),
163 # (3, _("ready")),
164 # (4, _("warning")),
165 # (5, _("failure")),
166 # (6, _("not participating")),
167 # (7, _("initializing")),
168 # (8, _("bypass")),
169 # (9, _("ols")),
170 # ],),
171 # title=_("Operational state"),
172 # negate=True,
173 # label=_("ignore operational state"),
174 # )),
175 #("admstate",
176 # Optional(
177 # ListChoice(
178 # title=_("Allowed states (otherwise check will be critical)"),
179 # choices=[
180 # (1, _("unknown")),
181 # (2, _("online")),
182 # (3, _("offline")),
183 # (4, _("bypassed")),
184 # (5, _("diagnostics")),
185 # ],),
186 # title=_("Administrative state"),
187 # negate=True,
188 # label=_("ignore administrative state"),
189 # ))
192 @property
193 def item_spec(self):
194 return TextAscii(
195 title=_("port name"),
196 help=_("The name of the FC port"),