Refactoring: Moved last application check parameters from unsorted.py to dedicated...
[check_mk.git] / cmk / gui / plugins / wato / check_parameters / unsorted.py
blob47400088a26906143113bf57f9335eebc9cf59de
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 import re
28 import cmk.utils.defines as defines
30 from cmk.gui.plugins.wato.active_checks import check_icmp_params
32 import cmk.gui.mkeventd as mkeventd
33 from cmk.gui.exceptions import MKUserError
34 from cmk.gui.i18n import _
35 from cmk.gui.valuespec import (
36 Dictionary,
37 Tuple,
38 Integer,
39 Float,
40 TextAscii,
41 Age,
42 DropdownChoice,
43 Checkbox,
44 RegExp,
45 Filesize,
46 Alternative,
47 Percentage,
48 ListChoice,
49 Transform,
50 ListOf,
51 ListOfStrings,
52 ListOfTimeRanges,
53 CascadingDropdown,
54 FixedValue,
55 Optional,
56 MonitoringState,
57 DualListChoice,
58 RadioChoice,
59 IPv4Address,
60 TextUnicode,
61 OptionalDropdownChoice,
62 RegExpUnicode,
64 from cmk.gui.plugins.wato import (
65 RulespecGroupCheckParametersApplications,
66 RulespecGroupCheckParametersDiscovery,
67 RulespecGroupCheckParametersEnvironment,
68 RulespecGroupCheckParametersHardware,
69 RulespecGroupCheckParametersNetworking,
70 RulespecGroupCheckParametersOperatingSystem,
71 RulespecGroupCheckParametersPrinters,
72 RulespecGroupCheckParametersStorage,
73 RulespecGroupCheckParametersVirtualization,
74 register_rule,
75 register_check_parameters,
76 UserIconOrAction,
77 Levels,
78 PredictiveLevels,
80 from cmk.gui.plugins.wato.check_parameters.ps import process_level_elements
82 # TODO: Sort all rules and check parameters into the figlet header sections.
83 # Beware: there are dependencies, so sometimes the order matters. All rules
84 # that are not yet handles are in the last section: in "Unsorted". Move rules
85 # from there into their appropriate sections until "Unsorted" is empty.
86 # Create new rules directly in the correct secions.
88 # .--Networking----------------------------------------------------------.
89 # | _ _ _ _ _ |
90 # | | \ | | ___| |___ _____ _ __| | _(_)_ __ __ _ |
91 # | | \| |/ _ \ __\ \ /\ / / _ \| '__| |/ / | '_ \ / _` | |
92 # | | |\ | __/ |_ \ V V / (_) | | | <| | | | | (_| | |
93 # | |_| \_|\___|\__| \_/\_/ \___/|_| |_|\_\_|_| |_|\__, | |
94 # | |___/ |
95 # '----------------------------------------------------------------------'
97 register_rule(
98 RulespecGroupCheckParametersNetworking,
99 "ping_levels",
100 Dictionary(
101 title=_("PING and host check parameters"),
102 help=_("This rule sets the parameters for the host checks (via <tt>check_icmp</tt>) "
103 "and also for PING checks on ping-only-hosts. For the host checks only the "
104 "critical state is relevant, the warning levels are ignored."),
105 elements=check_icmp_params,
107 match="dict")
110 # .--Inventory-----------------------------------------------------------.
111 # | ___ _ |
112 # | |_ _|_ ____ _____ _ __ | |_ ___ _ __ _ _ |
113 # | | || '_ \ \ / / _ \ '_ \| __/ _ \| '__| | | | |
114 # | | || | | \ V / __/ | | | || (_) | | | |_| | |
115 # | |___|_| |_|\_/ \___|_| |_|\__\___/|_| \__, | |
116 # | |___/ |
117 # '----------------------------------------------------------------------'
120 def transform_ipmi_inventory_rules(p):
121 if not isinstance(p, dict):
122 return p
123 if p.get("summarize", True):
124 return 'summarize'
125 if p.get('ignored_sensors', []):
126 return ('single', {'ignored_sensors': p["ignored_sensors"]})
127 return ('single', {})
130 register_rule(
131 RulespecGroupCheckParametersDiscovery,
132 varname="inventory_ipmi_rules",
133 title=_("Discovery of IPMI sensors"),
134 valuespec=Transform(
135 CascadingDropdown(
136 orientation="vertical",
137 choices=
138 [("summarize", _("Summary")),
139 ("single", _("Single"),
140 Dictionary(
141 show_titles=True,
142 elements=[
143 ("ignored_sensors",
144 ListOfStrings(
145 title=_("Ignore the following IPMI sensors"),
146 help=_("Names of IPMI sensors that should be ignored during inventory "
147 "and when summarizing."
148 "The pattern specified here must match exactly the beginning of "
149 "the actual sensor name (case sensitive)."),
150 orientation="horizontal")),
151 ("ignored_sensorstates",
152 ListOfStrings(
153 title=_("Ignore the following IPMI sensor states"),
154 help=_(
155 "IPMI sensors with these states that should be ignored during inventory "
156 "and when summarizing."
157 "The pattern specified here must match exactly the beginning of "
158 "the actual sensor name (case sensitive)."),
159 orientation="horizontal",
161 ]))]),
162 forth=transform_ipmi_inventory_rules),
163 match='first')
165 register_rule(
166 RulespecGroupCheckParametersDiscovery,
167 varname="ewon_discovery_rules",
168 title=_("eWON Discovery"),
169 help=_("The ewon vpn routers can rely data from a secondary device via snmp. "
170 "It doesn't however allow discovery of the device type relayed this way. "
171 "To allow interpretation of the data you need to pick the device manually."),
172 valuespec=DropdownChoice(
173 title=_("Device Type"),
174 label=_("Select device type"),
175 choices=[
176 (None, _("None selected")),
177 ("oxyreduct", _("Wagner OxyReduct")),
179 default_value=None,
181 match='first')
183 register_rule(
184 RulespecGroupCheckParametersDiscovery,
185 varname="mssql_transactionlogs_discovery",
186 title=_("MSSQL Datafile and Transactionlog Discovery"),
187 valuespec=Dictionary(
188 elements=[
189 ("summarize_datafiles",
190 Checkbox(
191 title=_("Display only a summary of all Datafiles"),
192 label=_("Summarize Datafiles"),
194 ("summarize_transactionlogs",
195 Checkbox(
196 title=_("Display only a summary of all Transactionlogs"),
197 label=_("Summarize Transactionlogs"),
200 optional_keys=[]),
201 match="first")
203 register_rule(
204 RulespecGroupCheckParametersDiscovery,
205 varname="inventory_services_rules",
206 title=_("Windows Service Discovery"),
207 valuespec=Dictionary(
208 elements=[
209 ('services',
210 ListOfStrings(
211 title=_("Services (Regular Expressions)"),
212 help=_('Regular expressions matching the begining of the internal name '
213 'or the description of the service. '
214 'If no name is given then this rule will match all services. The '
215 'match is done on the <i>beginning</i> of the service name. It '
216 'is done <i>case sensitive</i>. You can do a case insensitive match '
217 'by prefixing the regular expression with <tt>(?i)</tt>. Example: '
218 '<tt>(?i).*mssql</tt> matches all services which contain <tt>MSSQL</tt> '
219 'or <tt>MsSQL</tt> or <tt>mssql</tt> or...'),
220 orientation="horizontal",
222 ('state',
223 DropdownChoice(
224 choices=[
225 ('running', _('Running')),
226 ('stopped', _('Stopped')),
228 title=_("Create check if service is in state"),
230 ('start_mode',
231 DropdownChoice(
232 choices=[
233 ('auto', _('Automatic')),
234 ('demand', _('Manual')),
235 ('disabled', _('Disabled')),
237 title=_("Create check if service is in start mode"),
240 help=_(
241 'This rule can be used to configure the inventory of the windows services check. '
242 'You can configure specific windows services to be monitored by the windows check by '
243 'selecting them by name, current state during the inventory, or start mode.'),
245 match='all',
248 register_rule(
249 RulespecGroupCheckParametersDiscovery,
250 varname="inventory_solaris_services_rules",
251 title=_("Solaris Service Discovery"),
252 valuespec=Dictionary(
253 elements=[
254 ('descriptions', ListOfStrings(title=_("Descriptions"))),
255 ('categories', ListOfStrings(title=_("Categories"))),
256 ('names', ListOfStrings(title=_("Names"))),
257 ('instances', ListOfStrings(title=_("Instances"))),
258 ('states',
259 ListOf(
260 DropdownChoice(
261 choices=[
262 ("online", _("online")),
263 ("disabled", _("disabled")),
264 ("maintenance", _("maintenance")),
265 ("legacy_run", _("legacy run")),
266 ],),
267 title=_("States"),
269 ('outcome',
270 Alternative(
271 title=_("Service name"),
272 style="dropdown",
273 elements=[
274 FixedValue("full_descr", title=_("Full Description"), totext=""),
275 FixedValue(
276 "descr_without_prefix",
277 title=_("Description without type prefix"),
278 totext=""),
282 help=_(
283 'This rule can be used to configure the discovery of the Solaris services check. '
284 'You can configure specific Solaris services to be monitored by the Solaris check by '
285 'selecting them by description, category, name, or current state during the discovery.'
288 match='all',
291 register_rule(
292 RulespecGroupCheckParametersDiscovery,
293 varname="discovery_systemd_units_services_rules",
294 title=_("Systemd Service Discovery"),
295 valuespec=Dictionary(
296 elements=[
297 ('descriptions', ListOfStrings(title=_("Descriptions"))),
298 ('names', ListOfStrings(title=_("Service unit names"))),
299 ('states',
300 ListOf(
301 DropdownChoice(
302 choices=[
303 ("active", "active"),
304 ("inactive", "inactive"),
305 ("failed", "failed"),
306 ],),
307 title=_("States"),
310 help=_('This rule can be used to configure the discovery of the Linux services check. '
311 'You can configure specific Linux services to be monitored by the Linux check by '
312 'selecting them by description, unit name, or current state during the discovery.'),
314 match='all',
317 register_rule(
318 RulespecGroupCheckParametersDiscovery,
319 varname="discovery_win_dhcp_pools",
320 title=_("Discovery of Windows DHCP Pools"),
321 valuespec=Dictionary(elements=[
322 ("empty_pools",
323 Checkbox(
324 title=_("Discovery of empty DHCP pools"),
325 label=_("Include empty pools into the monitoring"),
326 help=_("You can activate the creation of services for "
327 "DHCP pools, which contain no IP addresses."),
330 match='dict',
333 register_rule(
334 RulespecGroupCheckParametersDiscovery,
335 varname="inventory_if_rules",
336 title=_("Network Interface and Switch Port Discovery"),
337 valuespec=Dictionary(
338 elements=[
339 ("use_desc",
340 DropdownChoice(
341 choices=[
342 (True, _('Use description')),
343 (False, _('Do not use description')),
345 title=_("Description as service name for network interface checks"),
346 help=_(
347 "This option lets Check_MK use the interface description as item instead "
348 "of the port number. If no description is available then the port number is "
349 "used anyway."))),
350 ("use_alias",
351 DropdownChoice(
352 choices=[
353 (True, _('Use alias')),
354 (False, _('Do not use alias')),
356 title=_("Alias as service name for network interface checks"),
357 help=_(
358 "This option lets Check_MK use the alias of the port (ifAlias) as item instead "
359 "of the port number. If no alias is available then the port number is used "
360 "anyway."))),
361 ("pad_portnumbers",
362 DropdownChoice(
363 choices=[
364 (True, _('Pad port numbers with zeros')),
365 (False, _('Do not pad')),
367 title=_("Port numbers"),
368 help=_("If this option is activated then Check_MK will pad port numbers of "
369 "network interfaces with zeroes so that all port descriptions from "
370 "all ports of a host or switch have the same length and thus sort "
371 "currectly in the GUI. In versions prior to 1.1.13i3 there was no "
372 "padding. You can switch back to the old behaviour by disabling this "
373 "option. This will retain the old service descriptions and the old "
374 "performance data."),
376 ("match_alias",
377 ListOfStrings(
378 title=_("Match interface alias (regex)"),
379 help=_("Only discover interfaces whose alias matches one of the configured "
380 "regular expressions. The match is done on the beginning of the alias. "
381 "This allows you to select interfaces based on the alias without having "
382 "the alias be part of the service description."),
383 orientation="horizontal",
384 valuespec=RegExp(
385 size=32,
386 mode=RegExp.prefix,
389 ("match_desc",
390 ListOfStrings(
391 title=_("Match interface description (regex)"),
392 help=_(
393 "Only discover interfaces whose the description matches one of the configured "
394 "regular expressions. The match is done on the beginning of the description. "
395 "This allows you to select interfaces based on the description without having "
396 "the alias be part of the service description."),
397 orientation="horizontal",
398 valuespec=RegExp(
399 size=32,
400 mode=RegExp.prefix,
403 ("portstates",
404 ListChoice(
405 title=_("Network interface port states to discover"),
406 help=
407 _("When doing discovery on switches or other devices with network interfaces "
408 "then only ports found in one of the configured port states will be added to the monitoring. "
409 "Note: the state <i>admin down</i> is in fact not an <tt>ifOperStatus</tt> but represents the "
410 "<tt>ifAdminStatus</tt> of <tt>down</tt> - a port administratively switched off. If you check this option "
411 "then an alternate version of the check is being used that fetches the <tt>ifAdminState</tt> in addition. "
412 "This will add about 5% of additional SNMP traffic."),
413 choices=defines.interface_oper_states(),
414 toggle_all=True,
415 default_value=['1'],
417 ("porttypes",
418 DualListChoice(
419 title=_("Network interface port types to discover"),
420 help=_("When doing discovery on switches or other devices with network interfaces "
421 "then only ports of the specified types will be created services for."),
422 choices=defines.interface_port_types(),
423 custom_order=True,
424 rows=40,
425 toggle_all=True,
426 default_value=[
427 '6', '32', '62', '117', '127', '128', '129', '180', '181', '182', '205', '229'
430 ("rmon",
431 DropdownChoice(
432 choices=[
433 (True,
434 _("Create extra service with RMON statistics data (if available for the device)"
436 (False, _('Do not create extra services')),
438 title=_("Collect RMON statistics data"),
439 help=
440 _("If you enable this option, for every RMON capable switch port an additional service will "
441 "be created which is always OK and collects RMON data. This will give you detailed information "
442 "about the distribution of packet sizes transferred over the port. Note: currently "
443 "this extra RMON check does not honor the inventory settings for switch ports. In a future "
444 "version of Check_MK RMON data may be added to the normal interface service and not add "
445 "an additional service."),
448 help=_('This rule can be used to control the inventory for network ports. '
449 'You can configure the port types and port states for inventory'
450 'and the use of alias or description as service name.'),
452 match='list',
455 _brocade_fcport_adm_choices = [
456 (1, 'online(1)'),
457 (2, 'offline(2)'),
458 (3, 'testing(3)'),
459 (4, 'faulty(4)'),
462 _brocade_fcport_op_choices = [
463 (0, 'unkown(0)'),
464 (1, 'online(1)'),
465 (2, 'offline(2)'),
466 (3, 'testing(3)'),
467 (4, 'faulty(4)'),
470 _brocade_fcport_phy_choices = [
471 (1, 'noCard(1)'),
472 (2, 'noTransceiver(2)'),
473 (3, 'laserFault(3)'),
474 (4, 'noLight(4)'),
475 (5, 'noSync(5)'),
476 (6, 'inSync(6)'),
477 (7, 'portFault(7)'),
478 (8, 'diagFault(8)'),
479 (9, 'lockRef(9)'),
480 (10, 'validating(10)'),
481 (11, 'invalidModule(11)'),
482 (14, 'noSigDet(14)'),
483 (255, 'unkown(255)'),
486 register_rule(
487 RulespecGroupCheckParametersDiscovery,
488 varname="brocade_fcport_inventory",
489 title=_("Brocade Port Discovery"),
490 valuespec=Dictionary(
491 elements=[
492 ("use_portname",
493 Checkbox(
494 title=_("Use port name as service name"),
495 label=_("use port name"),
496 default_value=True,
497 help=_("This option lets Check_MK use the port name as item instead of the "
498 "port number. If no description is available then the port number is "
499 "used anyway."))),
500 ("show_isl",
501 Checkbox(
502 title=_("add \"ISL\" to service description for interswitch links"),
503 label=_("add ISL"),
504 default_value=True,
505 help=_("This option lets Check_MK add the string \"ISL\" to the service "
506 "description for interswitch links."))),
507 ("admstates",
508 ListChoice(
509 title=_("Administrative port states to discover"),
510 help=_(
511 "When doing service discovery on brocade switches only ports with the given administrative "
512 "states will be added to the monitoring system."),
513 choices=_brocade_fcport_adm_choices,
514 columns=1,
515 toggle_all=True,
516 default_value=['1', '3', '4'],
518 ("phystates",
519 ListChoice(
520 title=_("Physical port states to discover"),
521 help=_(
522 "When doing service discovery on brocade switches only ports with the given physical "
523 "states will be added to the monitoring system."),
524 choices=_brocade_fcport_phy_choices,
525 columns=1,
526 toggle_all=True,
527 default_value=[3, 4, 5, 6, 7, 8, 9, 10])),
528 ("opstates",
529 ListChoice(
530 title=_("Operational port states to discover"),
531 help=_(
532 "When doing service discovery on brocade switches only ports with the given operational "
533 "states will be added to the monitoring system."),
534 choices=_brocade_fcport_op_choices,
535 columns=1,
536 toggle_all=True,
537 default_value=[1, 2, 3, 4])),
539 help=_('This rule can be used to control the service discovery for brocade ports. '
540 'You can configure the port states for inventory '
541 'and the use of the description as service name.'),
543 match='dict',
547 # In version 1.2.4 the check parameters for the resulting ps check
548 # where defined in the dicovery rule. We moved that to an own rule
549 # in the classical check parameter style. In order to support old
550 # configuration we allow reading old discovery rules and ship these
551 # settings in an optional sub-dictionary.
552 def convert_inventory_processes(old_dict):
553 new_dict = {"default_params": {}}
554 for key, value in old_dict.items():
555 if key in [
556 'levels',
557 'handle_count',
558 'cpulevels',
559 'cpu_average',
560 'virtual_levels',
561 'resident_levels',
563 new_dict["default_params"][key] = value
564 elif key != "perfdata":
565 new_dict[key] = value
567 # New cpu rescaling load rule
568 if old_dict.get('cpu_rescale_max') is None:
569 new_dict['cpu_rescale_max'] = True
571 return new_dict
574 def forbid_re_delimiters_inside_groups(pattern, varprefix):
575 # Used as input validation in PS check wato config
576 group_re = r'\(.*?\)'
577 for match in re.findall(group_re, pattern):
578 for char in ['\\b', '$', '^']:
579 if char in match:
580 raise MKUserError(
581 varprefix,
582 _('"%s" is not allowed inside the regular expression group %s. '
583 'Bounding characters inside groups will vanish after discovery, '
584 'because processes are instanced for every matching group. '
585 'Thus enforce delimiters outside the group.') % (char, match))
588 register_rule(
589 RulespecGroupCheckParametersDiscovery,
590 varname="inventory_processes_rules",
591 title=_('Process Discovery'),
592 help=_(
593 "This ruleset defines criteria for automatically creating checks for running processes "
594 "based upon what is running when the service discovery is done. These services will be "
595 "created with default parameters. They will get critical when no process is running and "
596 "OK otherwise. You can parameterize the check with the ruleset <i>State and count of processes</i>."
598 valuespec=Transform(
599 Dictionary(
600 elements=[
601 ('descr',
602 TextAscii(
603 title=_('Process Name'),
604 style="dropdown",
605 allow_empty=False,
606 help=
607 _('<p>The process name may contain one or more occurances of <tt>%s</tt>. If you do this, then the pattern must be a regular '
608 'expression and be prefixed with ~. For each <tt>%s</tt> in the description, the expression has to contain one "group". A group '
609 'is a subexpression enclosed in brackets, for example <tt>(.*)</tt> or <tt>([a-zA-Z]+)</tt> or <tt>(...)</tt>. When the inventory finds a process '
610 'matching the pattern, it will substitute all such groups with the actual values when creating the check. That way one '
611 'rule can create several checks on a host.</p>'
612 '<p>If the pattern contains more groups then occurrances of <tt>%s</tt> in the service description then only the first matching '
613 'subexpressions are used for the service descriptions. The matched substrings corresponding to the remaining groups '
614 'are copied into the regular expression, nevertheless.</p>'
615 '<p>As an alternative to <tt>%s</tt> you may also use <tt>%1</tt>, <tt>%2</tt>, etc. '
616 'These will be replaced by the first, second, ... matching group. This allows you to reorder things.</p>'
620 'match',
621 Alternative(
622 title=_("Process Matching"),
623 style="dropdown",
624 elements=[
625 TextAscii(
626 title=_("Exact name of the process without argments"),
627 label=_("Executable:"),
628 size=50,
630 Transform(
631 RegExp(
632 size=50,
633 mode=RegExp.prefix,
634 validate=forbid_re_delimiters_inside_groups,
636 title=_("Regular expression matching command line"),
637 label=_("Command line:"),
638 help=
639 _("This regex must match the <i>beginning</i> of the complete "
640 "command line of the process including arguments.<br>"
641 "When using groups, matches will be instantiated "
642 "during process discovery. e.g. (py.*) will match python, python_dev "
643 "and python_test and discover 3 services. At check time, because "
644 "python is a substring of python_test and python_dev it will aggregate"
645 "all process that start with python. If that is not the intended behavior "
646 "please use a delimiter like '$' or '\\b' around the group, e.g. (py.*)$"
648 forth=lambda x: x[1:], # remove ~
649 back=lambda x: "~" + x, # prefix ~
651 FixedValue(
652 None,
653 totext="",
654 title=_("Match all processes"),
657 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0),
658 default_value='/usr/sbin/foo')),
659 ('user',
660 Alternative(
661 title=_('Name of the User'),
662 style="dropdown",
663 elements=[
664 FixedValue(
665 None,
666 totext="",
667 title=_("Match all users"),
669 TextAscii(
670 title=_('Exact name of the user'),
671 label=_("User:"),
673 FixedValue(
674 False,
675 title=_('Grab user from found processess'),
676 totext='',
679 help=
680 _('<p>The user specification can either be a user name (string). The inventory will then trigger only if that user matches '
681 'the user the process is running as and the resulting check will require that user. Alternatively you can specify '
682 '"grab user". If user is not selected the created check will not check for a specific user.</p>'
683 '<p>Specifying "grab user" makes the created check expect the process to run as the same user as during inventory: the user '
684 'name will be hardcoded into the check. In that case if you put %u into the service description, that will be replaced '
685 'by the actual user name during inventory. You need that if your rule might match for more than one user - your would '
686 'create duplicate services with the same description otherwise.</p><p>Windows users are specified by the namespace followed by '
687 'the actual user name. For example "\\\\NT AUTHORITY\\NETWORK SERVICE" or "\\\\CHKMKTEST\\Administrator".</p>'
690 ('icon',
691 UserIconOrAction(
692 title=_("Add custom icon or action"),
693 help=_(
694 "You can assign icons or actions to the found services in the status GUI."
697 ("cpu_rescale_max",
698 RadioChoice(
699 title=_("CPU rescale maximum load"),
700 help=_("CPU utilization is delivered by the Operating "
701 "System as a per CPU core basis. Thus each core contributes "
702 "with a 100% at full utilization, producing a maximum load "
703 "of N*100% (N=number of cores). For simplicity this maximum "
704 "can be rescaled down, making 100% the maximum and thinking "
705 "in terms of total CPU utilization."),
706 default_value=True,
707 orientation="vertical",
708 choices=[
709 (True, _("100% is all cores at full load")),
710 (False,
711 _("<b>N</b> * 100% as each core contributes with 100% at full load")),
712 ])),
713 ('default_params',
714 Dictionary(
715 title=_("Default parameters for detected services"),
716 help=
717 _("Here you can select default parameters that are being set "
718 "for detected services. Note: the preferred way for setting parameters is to use "
719 "the rule set <a href='wato.py?varname=checkgroup_parameters%3Apsmode=edit_ruleset'> "
720 "State and Count of Processes</a> instead. "
721 "A change there will immediately be active, while a change in this rule "
722 "requires a re-discovery of the services."),
723 elements=process_level_elements,
726 required_keys=["descr", "cpu_rescale_max"],
728 forth=convert_inventory_processes,
730 match='all',
733 register_rule(
734 RulespecGroupCheckParametersDiscovery,
735 varname="inv_domino_tasks_rules",
736 title=_('Lotus Domino Task Discovery'),
737 help=_("This rule controls the discovery of tasks on Lotus Domino systems. "
738 "Any changes later on require a host re-discovery"),
739 valuespec=Dictionary(
740 elements=[
741 ('descr',
742 TextAscii(
743 title=_('Service Description'),
744 allow_empty=False,
745 help=
746 _('<p>The service description may contain one or more occurances of <tt>%s</tt>. In this '
747 'case, the pattern must be a regular expression prefixed with ~. For each '
748 '<tt>%s</tt> in the description, the expression has to contain one "group". A group '
749 'is a subexpression enclosed in brackets, for example <tt>(.*)</tt> or '
750 '<tt>([a-zA-Z]+)</tt> or <tt>(...)</tt>. When the inventory finds a task '
751 'matching the pattern, it will substitute all such groups with the actual values when '
752 'creating the check. In this way one rule can create several checks on a host.</p>'
753 '<p>If the pattern contains more groups than occurrences of <tt>%s</tt> in the service '
754 'description, only the first matching subexpressions are used for the service '
755 'descriptions. The matched substrings corresponding to the remaining groups '
756 'are nevertheless copied into the regular expression.</p>'
757 '<p>As an alternative to <tt>%s</tt> you may also use <tt>%1</tt>, <tt>%2</tt>, etc. '
758 'These expressions will be replaced by the first, second, ... matching group, allowing '
759 'you to reorder things.</p>'),
762 'match',
763 Alternative(
764 title=_("Task Matching"),
765 elements=[
766 TextAscii(
767 title=_("Exact name of the task"),
768 size=50,
770 Transform(
771 RegExp(
772 size=50,
773 mode=RegExp.prefix,
775 title=_("Regular expression matching command line"),
776 help=_("This regex must match the <i>beginning</i> of the task"),
777 forth=lambda x: x[1:], # remove ~
778 back=lambda x: "~" + x, # prefix ~
780 FixedValue(
781 None,
782 totext="",
783 title=_("Match all tasks"),
786 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0),
787 default_value='foo')),
788 ('levels',
789 Tuple(
790 title=_('Levels'),
791 help=
792 _("Please note that if you specify and also if you modify levels here, the change is "
793 "activated only during an inventory. Saving this rule is not enough. This is due to "
794 "the nature of inventory rules."),
795 elements=[
796 Integer(
797 title=_("Critical below"),
798 unit=_("processes"),
799 default_value=1,
801 Integer(
802 title=_("Warning below"),
803 unit=_("processes"),
804 default_value=1,
806 Integer(
807 title=_("Warning above"),
808 unit=_("processes"),
809 default_value=1,
811 Integer(
812 title=_("Critical above"),
813 unit=_("processes"),
814 default_value=1,
819 required_keys=['match', 'levels', 'descr'],
821 match='all',
824 register_rule(
825 RulespecGroupCheckParametersDiscovery,
826 varname="inventory_sap_values",
827 title=_('SAP R/3 Single Value Inventory'),
828 valuespec=Dictionary(
829 elements=[
831 'match',
832 Alternative(
833 title=_("Node Path Matching"),
834 elements=[
835 TextAscii(
836 title=_("Exact path of the node"),
837 size=100,
839 Transform(
840 RegExp(
841 size=100,
842 mode=RegExp.prefix,
844 title=_("Regular expression matching the path"),
845 help=_("This regex must match the <i>beginning</i> of the complete "
846 "path of the node as reported by the agent"),
847 forth=lambda x: x[1:], # remove ~
848 back=lambda x: "~" + x, # prefix ~
850 FixedValue(
851 None,
852 totext="",
853 title=_("Match all nodes"),
856 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0),
857 default_value=
858 'SAP CCMS Monitor Templates/Dialog Overview/Dialog Response Time/ResponseTime')
860 ('limit_item_levels',
861 Integer(
862 title=_("Limit Path Levels for Service Names"),
863 unit=_('path levels'),
864 minvalue=1,
865 help=
866 _("The service descriptions of the inventorized services are named like the paths "
867 "in SAP. You can use this option to let the inventory function only use the last "
868 "x path levels for naming."),
871 optional_keys=['limit_item_levels'],
873 match='all',
876 register_rule(
877 RulespecGroupCheckParametersDiscovery,
878 varname="sap_value_groups",
879 title=_('SAP Value Grouping Patterns'),
880 help=_('The check <tt>sap.value</tt> normally creates one service for each SAP value. '
881 'By defining grouping patterns, you can switch to the check <tt>sap.value-groups</tt>. '
882 'That check monitors a list of SAP values at once.'),
883 valuespec=ListOf(
884 Tuple(
885 help=_("This defines one value grouping pattern"),
886 show_titles=True,
887 orientation="horizontal",
888 elements=[
889 TextAscii(title=_("Name of group"),),
890 Tuple(
891 show_titles=True,
892 orientation="vertical",
893 elements=[
894 RegExpUnicode(
895 title=_("Include Pattern"),
896 mode=RegExp.prefix,
898 RegExpUnicode(
899 title=_("Exclude Pattern"),
900 mode=RegExp.prefix,
906 add_label=_("Add pattern group"),
908 match='all',
911 register_rule(
912 RulespecGroupCheckParametersDiscovery,
913 varname="inventory_heartbeat_crm_rules",
914 title=_("Heartbeat CRM Discovery"),
915 valuespec=Dictionary(
916 elements=[
917 ("naildown_dc",
918 Checkbox(
919 title=_("Naildown the DC"),
920 label=_("Mark the currently distinguished controller as preferred one"),
921 help=_(
922 "Nails down the DC to the node which is the DC during discovery. The check "
923 "will report CRITICAL when another node becomes the DC during later checks."))
925 ("naildown_resources",
926 Checkbox(
927 title=_("Naildown the resources"),
928 label=_("Mark the nodes of the resources as preferred one"),
929 help=_(
930 "Nails down the resources to the node which is holding them during discovery. "
931 "The check will report CRITICAL when another holds the resource during later checks."
932 ))),
934 help=_('This rule can be used to control the discovery for Heartbeat CRM checks.'),
935 optional_keys=[],
937 match='dict',
940 register_rule(
941 RulespecGroupCheckParametersDiscovery,
942 varname="inventory_df_rules",
943 title=_("Discovery parameters for filesystem checks"),
944 valuespec=Dictionary(
945 elements=[
946 ("include_volume_name", Checkbox(title=_("Include Volume name in item"))),
947 ("ignore_fs_types",
948 ListChoice(
949 title=_("Filesystem types to ignore"),
950 choices=[
951 ("tmpfs", "tmpfs"),
952 ("nfs", "nfs"),
953 ("smbfs", "smbfs"),
954 ("cifs", "cifs"),
955 ("iso9660", "iso9660"),
957 default_value=["tmpfs", "nfs", "smbfs", "cifs", "iso9660"])),
958 ("never_ignore_mountpoints",
959 ListOf(
960 TextUnicode(),
961 title=_(u"Mountpoints to never ignore"),
962 help=_(
963 u"Regardless of filesystem type, these mountpoints will always be discovered."
964 u"Globbing or regular expressions are currently not supported."),
966 ],),
967 match="dict",
970 register_rule(
971 RulespecGroupCheckParametersDiscovery,
972 varname="inventory_mssql_counters_rules",
973 title=_("Include MSSQL Counters services"),
974 valuespec=Dictionary(
975 elements=[
976 ("add_zero_based_services", Checkbox(title=_("Include service with zero base."))),
978 optional_keys=[]),
979 match="dict",
982 register_rule(
983 RulespecGroupCheckParametersDiscovery,
984 varname="inventory_fujitsu_ca_ports",
985 title=_("Discovery of Fujtsu storage CA ports"),
986 valuespec=Dictionary(
987 elements=[
988 ("indices", ListOfStrings(title=_("CA port indices"))),
989 ("modes",
990 DualListChoice(
991 title=_("CA port modes"),
992 choices=[
993 ("CA", _("CA")),
994 ("RA", _("RA")),
995 ("CARA", _("CARA")),
996 ("Initiator", _("Initiator")),
998 row=4,
999 size=30,
1001 ],),
1002 match="dict",
1005 register_rule(
1006 RulespecGroupCheckParametersDiscovery,
1007 varname="discovery_mssql_backup",
1008 title=_("Discovery of MSSQL backup"),
1009 valuespec=Dictionary(
1010 elements=[
1011 ("mode",
1012 DropdownChoice(
1013 title=_("Backup modes"),
1014 choices=[
1015 ("summary", _("Create a service for each instance")),
1016 ("per_type", _("Create a service for each instance and backup type")),
1017 ])),
1018 ],),
1019 match="dict",
1023 # .--Applications--------------------------------------------------------.
1024 # | _ _ _ _ _ |
1025 # | / \ _ __ _ __ | (_) ___ __ _| |_(_) ___ _ __ ___ |
1026 # | / _ \ | '_ \| '_ \| | |/ __/ _` | __| |/ _ \| '_ \/ __| |
1027 # | / ___ \| |_) | |_) | | | (_| (_| | |_| | (_) | | | \__ \ |
1028 # | /_/ \_\ .__/| .__/|_|_|\___\__,_|\__|_|\___/|_| |_|___/ |
1029 # | |_| |_| |
1030 # '----------------------------------------------------------------------'
1032 register_rule(
1033 RulespecGroupCheckParametersApplications,
1034 varname="logwatch_rules",
1035 title=_('Logwatch Patterns'),
1036 valuespec=Transform(
1037 Dictionary(
1038 elements=[
1039 ("reclassify_patterns",
1040 ListOf(
1041 Tuple(
1042 help=_("This defines one logfile pattern rule"),
1043 show_titles=True,
1044 orientation="horizontal",
1045 elements=[
1046 DropdownChoice(
1047 title=_("State"),
1048 choices=[
1049 ('C', _('CRITICAL')),
1050 ('W', _('WARNING')),
1051 ('O', _('OK')),
1052 ('I', _('IGNORE')),
1055 RegExpUnicode(
1056 title=_("Pattern (Regex)"),
1057 size=40,
1058 mode=RegExp.infix,
1060 TextUnicode(
1061 title=_("Comment"),
1062 size=40,
1065 title=_("Reclassify state matching regex pattern"),
1066 help=
1067 _('<p>You can define one or several patterns (regular expressions) in each logfile pattern rule. '
1068 'These patterns are applied to the selected logfiles to reclassify the '
1069 'matching log messages. The first pattern which matches a line will '
1070 'be used for reclassifying a message. You can use the '
1071 '<a href="wato.py?mode=pattern_editor">Logfile Pattern Analyzer</a> '
1072 'to test the rules you defined here.</p>'
1073 '<p>Select "Ignore" as state to get the matching logs deleted. Other states will keep the '
1074 'log entries but reclassify the state of them.</p>'),
1075 add_label=_("Add pattern"),
1077 ("reclassify_states",
1078 Dictionary(
1079 title=_("Reclassify complete state"),
1080 help=_(
1081 "This setting allows you to convert all incoming states to another state. "
1082 "The option is applied before the state conversion via regexes. So the regex values can "
1083 "modify the state even further."),
1084 elements=[
1085 ("c_to",
1086 DropdownChoice(
1087 title=_("Change CRITICAL State to"),
1088 choices=[
1089 ('C', _('CRITICAL')),
1090 ('W', _('WARNING')),
1091 ('O', _('OK')),
1092 ('I', _('IGNORE')),
1093 ('.', _('Context Info')),
1095 default_value="C",
1097 ("w_to",
1098 DropdownChoice(
1099 title=_("Change WARNING State to"),
1100 choices=[
1101 ('C', _('CRITICAL')),
1102 ('W', _('WARNING')),
1103 ('O', _('OK')),
1104 ('I', _('IGNORE')),
1105 ('.', _('Context Info')),
1107 default_value="W",
1109 ("o_to",
1110 DropdownChoice(
1111 title=_("Change OK State to"),
1112 choices=[
1113 ('C', _('CRITICAL')),
1114 ('W', _('WARNING')),
1115 ('O', _('OK')),
1116 ('I', _('IGNORE')),
1117 ('.', _('Context Info')),
1119 default_value="O",
1121 ("._to",
1122 DropdownChoice(
1123 title=_("Change Context Info to"),
1124 choices=[
1125 ('C', _('CRITICAL')),
1126 ('W', _('WARNING')),
1127 ('O', _('OK')),
1128 ('I', _('IGNORE')),
1129 ('.', _('Context Info')),
1131 default_value=".",
1134 optional_keys=False,
1137 optional_keys=["reclassify_states"],
1139 forth=lambda x: isinstance(x, dict) and x or {"reclassify_patterns": x}),
1140 itemtype='item',
1141 itemname='Logfile',
1142 itemhelp=_("Put the item names of the logfiles here. For example \"System$\" "
1143 "to select the service \"LOG System\". You can use regular "
1144 "expressions which must match the beginning of the logfile name."),
1145 match='all',
1149 # .--Environment---------------------------------------------------------.
1150 # | _____ _ _ |
1151 # | | ____|_ ____ _(_)_ __ ___ _ __ _ __ ___ ___ _ __ | |_ |
1152 # | | _| | '_ \ \ / / | '__/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| |
1153 # | | |___| | | \ V /| | | | (_) | | | | | | | | | __/ | | | |_ |
1154 # | |_____|_| |_|\_/ |_|_| \___/|_| |_|_| |_| |_|\___|_| |_|\__| |
1155 # | |
1156 # '----------------------------------------------------------------------'
1158 register_check_parameters(
1159 RulespecGroupCheckParametersEnvironment,
1160 "voltage",
1161 _("Voltage Sensor"),
1162 Dictionary(
1163 title=_("Voltage Sensor"),
1164 optional_keys=True,
1165 elements=[
1166 ("levels",
1167 Tuple(
1168 title=_("Upper Levels for Voltage"),
1169 elements=[
1170 Float(title=_("Warning at"), default_value=15.00, unit="V"),
1171 Float(title=_("Critical at"), default_value=16.00, unit="V"),
1172 ])),
1173 ("levels_lower",
1174 Tuple(
1175 title=_("Lower Levels for Voltage"),
1176 elements=[
1177 Float(title=_("Warning below"), default_value=10.00, unit="V"),
1178 Float(title=_("Critical below"), default_value=9.00, unit="V"),
1179 ])),
1181 TextAscii(title=_("Sensor Description and Index"),),
1182 match_type="dict",
1185 register_check_parameters(
1186 RulespecGroupCheckParametersEnvironment,
1187 "fan_failures",
1188 _("Number of fan failures"),
1189 Tuple(
1190 title=_("Number of fan failures"),
1191 elements=[
1192 Integer(title="Warning at", default_value=1),
1193 Integer(title="Critical at", default_value=2),
1195 None,
1196 "first",
1199 register_check_parameters(
1200 RulespecGroupCheckParametersEnvironment,
1201 "pll_lock_voltage",
1202 _("Lock Voltage for PLLs"),
1203 Dictionary(
1204 help=_("PLL lock voltages by freqency"),
1205 elements=[
1206 ("rx",
1207 ListOf(
1208 Tuple(
1209 elements=[
1210 Float(title=_("Frequencies up to"), unit=u"MHz"),
1211 Float(title=_("Warning below"), unit=u"V"),
1212 Float(title=_("Critical below"), unit=u"V"),
1213 Float(title=_("Warning at or above"), unit=u"V"),
1214 Float(title=_("Critical at or above"), unit=u"V"),
1215 ],),
1216 title=_("Lock voltages for RX PLL"),
1217 help=_("Specify frequency ranges by the upper boundary of the range "
1218 "to which the voltage levels are to apply. The list is sorted "
1219 "automatically when saving."),
1220 movable=False)),
1221 ("tx",
1222 ListOf(
1223 Tuple(
1224 elements=[
1225 Float(title=_("Frequencies up to"), unit=u"MHz"),
1226 Float(title=_("Warning below"), unit=u"V"),
1227 Float(title=_("Critical below"), unit=u"V"),
1228 Float(title=_("Warning at or above"), unit=u"V"),
1229 Float(title=_("Critical at or above"), unit=u"V"),
1230 ],),
1231 title=_("Lock voltages for TX PLL"),
1232 help=_("Specify frequency ranges by the upper boundary of the range "
1233 "to which the voltage levels are to apply. The list is sorted "
1234 "automatically when saving."),
1235 movable=False)),
1237 optional_keys=["rx", "tx"],
1239 DropdownChoice(title=_("RX/TX"), choices=[("RX", _("RX")), ("TX", _("TX"))]),
1240 match_type="dict",
1243 register_check_parameters(
1244 RulespecGroupCheckParametersEnvironment,
1245 "ipmi",
1246 _("IPMI sensors"),
1247 Dictionary(
1248 elements=[
1249 ("sensor_states",
1250 ListOf(
1251 Tuple(elements=[TextAscii(), MonitoringState()]),
1252 title=_("Set states of IPMI sensor status texts"),
1253 help=_("The pattern specified here must match exactly the beginning of "
1254 "the sensor state (case sensitive)."),
1255 orientation="horizontal",
1257 ("ignored_sensors",
1258 ListOfStrings(
1259 title=_("Ignore the following IPMI sensors"),
1260 help=_("Names of IPMI sensors that should be ignored during discovery "
1261 "and when summarizing."
1262 "The pattern specified here must match exactly the beginning of "
1263 "the actual sensor name (case sensitive)."),
1264 orientation="horizontal")),
1265 ("ignored_sensorstates",
1266 ListOfStrings(
1267 title=_("Ignore the following IPMI sensor states"),
1268 help=_("IPMI sensors with these states that should be ignored during discovery "
1269 "and when summarizing."
1270 "The pattern specified here must match exactly the beginning of "
1271 "the actual sensor name (case sensitive)."),
1272 orientation="horizontal",
1273 default_value=["nr", "ns"])),
1274 ("numerical_sensor_levels",
1275 ListOf(
1276 Tuple(
1277 elements=[
1278 TextAscii(
1279 title=_("Sensor name (only summary)"),
1280 help=_(
1281 "In summary mode you have to state the sensor name. "
1282 "In single mode the sensor name comes from service description.")),
1283 Dictionary(elements=[
1284 ("lower",
1285 Tuple(title=_("Lower levels"), elements=[Float(), Float()])),
1286 ("upper",
1287 Tuple(title=_("Upper levels"), elements=[Float(), Float()])),
1289 ],),
1290 title=_("Set lower and upper levels for numerical sensors"))),
1292 ignored_keys=["ignored_sensors", "ignored_sensor_states"],
1294 TextAscii(title=_("The sensor name")),
1295 "dict",
1298 register_check_parameters(
1299 RulespecGroupCheckParametersEnvironment,
1300 "ps_voltage",
1301 _("Output Voltage of Power Supplies"),
1302 Tuple(
1303 elements=[
1304 Float(title=_("Warning below"), unit=u"V"),
1305 Float(title=_("Critical below"), unit=u"V"),
1306 Float(title=_("Warning at or above"), unit=u"V"),
1307 Float(title=_("Critical at or above"), unit=u"V"),
1308 ],),
1309 None,
1310 match_type="first",
1313 bvip_link_states = [
1314 (0, "No Link"),
1315 (1, "10 MBit - HalfDuplex"),
1316 (2, "10 MBit - FullDuplex"),
1317 (3, "100 Mbit - HalfDuplex"),
1318 (4, "100 Mbit - FullDuplex"),
1319 (5, "1 Gbit - FullDuplex"),
1320 (7, "Wifi"),
1323 register_check_parameters(
1324 RulespecGroupCheckParametersEnvironment,
1325 "bvip_link",
1326 _("Allowed Network states on Bosch IP Cameras"),
1327 Dictionary(
1328 title=_("Update State"),
1329 elements=[
1330 ("ok_states",
1331 ListChoice(
1332 title=_("States which result in OK"),
1333 choices=bvip_link_states,
1334 default_value=[0, 4, 5])),
1335 ("warn_states",
1336 ListChoice(
1337 title=_("States which result in Warning"),
1338 choices=bvip_link_states,
1339 default_value=[7])),
1340 ("crit_states",
1341 ListChoice(
1342 title=_("States which result in Critical"),
1343 choices=bvip_link_states,
1344 default_value=[1, 2, 3])),
1346 optional_keys=None,
1348 None,
1349 match_type="dict",
1352 register_check_parameters(
1353 RulespecGroupCheckParametersEnvironment,
1354 "ocprot_current",
1355 _("Electrical Current of Overcurrent Protectors"),
1356 Tuple(
1357 elements=[
1358 Float(title=_("Warning at"), unit=u"A", default_value=14.0),
1359 Float(title=_("Critical at"), unit=u"A", default_value=15.0),
1360 ],),
1361 TextAscii(title=_("The Index of the Overcurrent Protector")),
1362 match_type="first",
1365 register_check_parameters(
1366 RulespecGroupCheckParametersEnvironment,
1367 'brightness',
1368 _("Brightness Levels"),
1369 Levels(
1370 title=_("Brightness"),
1371 unit=_("lx"),
1372 default_value=None,
1373 default_difference=(2.0, 4.0),
1374 default_levels=(50.0, 100.0),
1376 TextAscii(
1377 title=_("Sensor name"),
1378 help=_("The identifier of the sensor."),
1380 match_type="dict",
1383 register_check_parameters(
1384 RulespecGroupCheckParametersEnvironment,
1385 'motion',
1386 _("Motion Detectors"),
1387 Dictionary(elements=[
1388 ("time_periods",
1389 Dictionary(
1390 title=_("Time periods"),
1391 help=_("Specifiy time ranges during which no motion is expected. "
1392 "Outside these times, the motion detector will always be in "
1393 "state OK"),
1394 elements=[(day_id, ListOfTimeRanges(title=day_str))
1395 for day_id, day_str in defines.weekdays_by_name()],
1396 optional_keys=[])),
1398 TextAscii(
1399 title=_("Sensor name"),
1400 help=_("The identifier of the sensor."),
1402 match_type="dict")
1404 register_check_parameters(
1405 RulespecGroupCheckParametersEnvironment,
1406 'ewon',
1407 _("eWON SNMP Proxy"),
1408 Dictionary(
1409 title=_("Device Type"),
1410 help=_("The eWON router can act as a proxy to metrics from a secondary non-snmp device."
1411 "Here you can make settings to the monitoring of the proxied device."),
1412 elements=[("oxyreduct",
1413 Dictionary(
1414 title=_("Wagner OxyReduct"),
1415 elements=[("o2_levels",
1416 Tuple(
1417 title=_("O2 levels"),
1418 elements=[
1419 Percentage(title=_("Warning at"), default_value=16.0),
1420 Percentage(title=_("Critical at"), default_value=17.0),
1421 Percentage(title=_("Warning below"), default_value=14.0),
1422 Percentage(title=_("Critical below"), default_value=13.0),
1423 ]))]))]),
1424 TextAscii(
1425 title=_("Item name"),
1426 help=_("The item name. The meaning of this depends on the proxied device: "
1427 "- Wagner OxyReduct: Name of the room/protection zone")),
1428 match_type="dict")
1430 register_check_parameters(
1431 RulespecGroupCheckParametersEnvironment,
1432 "lamp_operation_time",
1433 _("Beamer lamp operation time"),
1434 Tuple(elements=[
1435 Age(title=_("Warning at"), default_value=1000 * 3600, display=["hours"]),
1436 Age(title=_("Critical at"), default_value=1500 * 3600, display=["hours"]),
1438 None,
1439 match_type="first",
1443 def transform_apc_symmetra(params):
1444 if isinstance(params, (list, tuple)):
1445 params = {"levels": params}
1447 if "levels" in params and len(params["levels"]) > 2:
1448 cap = float(params["levels"][0])
1449 params["capacity"] = (cap, cap)
1450 del params["levels"]
1452 if "output_load" in params:
1453 del params["output_load"]
1455 return params
1458 register_check_parameters(
1459 RulespecGroupCheckParametersEnvironment, "apc_symentra", _("APC Symmetra Checks"),
1460 Transform(
1461 Dictionary(
1462 elements=[
1463 ("capacity",
1464 Tuple(
1465 title=_("Levels of battery capacity"),
1466 elements=[
1467 Percentage(
1468 title=_("Warning below"),
1469 default_value=95.0,
1471 Percentage(
1472 title=_("Critical below"),
1473 default_value=90.0,
1475 ])),
1476 ("calibration_state",
1477 MonitoringState(
1478 title=_("State if calibration is invalid"),
1479 default_value=0,
1481 ("post_calibration_levels",
1482 Dictionary(
1483 title=_("Levels of battery parameters after calibration"),
1484 help=_(
1485 "After a battery calibration the battery capacity is reduced until the "
1486 "battery is fully charged again. Here you can specify an alternative "
1487 "lower level in this post-calibration phase. "
1488 "Since apc devices remember the time of the last calibration only "
1489 "as a date, the alternative lower level will be applied on the whole "
1490 "day of the calibration until midnight. You can extend this time period "
1491 "with an additional time span to make sure calibrations occuring just "
1492 "before midnight do not trigger false alarms."),
1493 elements=[
1494 ("altcapacity",
1495 Percentage(
1496 title=_("Alternative critical battery capacity after calibration"),
1497 default_value=50,
1499 ("additional_time_span",
1500 Integer(
1501 title=("Extend post-calibration phase by additional time span"),
1502 unit=_("minutes"),
1503 default_value=0,
1506 optional_keys=False,
1508 ("battime",
1509 Tuple(
1510 title=_("Time left on battery"),
1511 elements=[
1512 Age(title=_("Warning at"),
1513 help=
1514 _("Time left on Battery at and below which a warning state is triggered"
1516 default_value=0,
1517 display=["hours", "minutes"]),
1518 Age(title=_("Critical at"),
1519 help=
1520 _("Time Left on Battery at and below which a critical state is triggered"
1522 default_value=0,
1523 display=["hours", "minutes"]),
1526 ("battery_replace_state",
1527 MonitoringState(
1528 title=_("State if battery needs replacement"),
1529 default_value=1,
1532 optional_keys=['post_calibration_levels', 'output_load', 'battime'],
1534 forth=transform_apc_symmetra,
1535 ), None, "first")
1537 register_check_parameters(
1538 RulespecGroupCheckParametersEnvironment,
1539 'hw_psu',
1540 _("Power Supply Unit"),
1541 Dictionary(
1542 elements=[
1543 ("levels",
1544 Tuple(
1545 title=_("PSU Capacity Levels"),
1546 elements=[
1547 Percentage(title=_("Warning at"), default_value=80.0),
1548 Percentage(title=_("Critical at"), default_value=90.0),
1551 ],),
1552 TextAscii(title=_("PSU (Chassis/Bay)")),
1553 match_type="dict")
1556 # .--Storage-------------------------------------------------------------.
1557 # | ____ _ |
1558 # | / ___|| |_ ___ _ __ __ _ __ _ ___ |
1559 # | \___ \| __/ _ \| '__/ _` |/ _` |/ _ \ |
1560 # | ___) | || (_) | | | (_| | (_| | __/ |
1561 # | |____/ \__\___/|_| \__,_|\__, |\___| |
1562 # | |___/ |
1563 # '----------------------------------------------------------------------'
1565 register_check_parameters(
1566 RulespecGroupCheckParametersStorage,
1567 "disk_failures",
1568 _("Number of disk failures"),
1569 Tuple(
1570 title=_("Number of disk failures"),
1571 elements=[
1572 Integer(title="Warning at", default_value=1),
1573 Integer(title="Critical at", default_value=2),
1575 None,
1576 "first",
1579 register_check_parameters(
1580 RulespecGroupCheckParametersStorage, "ddn_s2a_port_errors", _("Port errors of DDN S2A devices"),
1581 Dictionary(
1582 elements=[
1583 ("link_failure_errs",
1584 Tuple(
1585 title=_(u"Link failure errors"),
1586 elements=[
1587 Integer(title=_(u"Warning at")),
1588 Integer(title=_(u"Critical at")),
1589 ])),
1590 ("lost_sync_errs",
1591 Tuple(
1592 title=_(u"Lost synchronization errors"),
1593 elements=[
1594 Integer(title=_(u"Warning at")),
1595 Integer(title=_(u"Critical at")),
1596 ])),
1597 ("loss_of_signal_errs",
1598 Tuple(
1599 title=_(u"Loss of signal errors"),
1600 elements=[
1601 Integer(title=_(u"Warning at")),
1602 Integer(title=_(u"Critical at")),
1603 ])),
1604 ("prim_seq_errs",
1605 Tuple(
1606 title=_(u"PrimSeq erros"),
1607 elements=[
1608 Integer(title=_(u"Warning at")),
1609 Integer(title=_(u"Critical at")),
1610 ])),
1611 ("crc_errs",
1612 Tuple(
1613 title=_(u"CRC errors"),
1614 elements=[
1615 Integer(title=_(u"Warning at")),
1616 Integer(title=_(u"Critical at")),
1617 ])),
1618 ("receive_errs",
1619 Tuple(
1620 title=_(u"Receive errors"),
1621 elements=[
1622 Integer(title=_(u"Warning at")),
1623 Integer(title=_(u"Critical at")),
1624 ])),
1625 ("ctio_timeouts",
1626 Tuple(
1627 title=_(u"CTIO timeouts"),
1628 elements=[
1629 Integer(title=_(u"Warning at")),
1630 Integer(title=_(u"Critical at")),
1631 ])),
1632 ("ctio_xmit_errs",
1633 Tuple(
1634 title=_(u"CTIO transmission errors"),
1635 elements=[
1636 Integer(title=_(u"Warning at")),
1637 Integer(title=_(u"Critical at")),
1638 ])),
1639 ("ctio_other_errs",
1640 Tuple(
1641 title=_(u"other CTIO errors"),
1642 elements=[
1643 Integer(title=_(u"Warning at")),
1644 Integer(title=_(u"Critical at")),
1645 ])),
1646 ],), TextAscii(title="Port index"), "dict")
1648 register_check_parameters(
1649 RulespecGroupCheckParametersStorage, "read_hits", _(u"Read prefetch hits for DDN S2A devices"),
1650 Tuple(
1651 title=_(u"Prefetch hits"),
1652 elements=[
1653 Float(title=_(u"Warning below"), default_value=95.0),
1654 Float(title=_(u"Critical below"), default_value=90.0),
1655 ]), TextAscii(title=_(u"Port index or 'Total'")), "first")
1657 register_check_parameters(
1658 RulespecGroupCheckParametersStorage, "storage_iops", _(u"I/O operations for DDN S2A devices"),
1659 Dictionary(elements=[
1660 ("read",
1661 Tuple(
1662 title=_(u"Read IO operations per second"),
1663 elements=[
1664 Float(title=_(u"Warning at"), unit="1/s"),
1665 Float(title=_(u"Critical at"), unit="1/s"),
1666 ])),
1667 ("write",
1668 Tuple(
1669 title=_(u"Write IO operations per second"),
1670 elements=[
1671 Float(title=_(u"Warning at"), unit="1/s"),
1672 Float(title=_(u"Critical at"), unit="1/s"),
1673 ])),
1674 ("total",
1675 Tuple(
1676 title=_(u"Total IO operations per second"),
1677 elements=[
1678 Float(title=_(u"Warning at"), unit="1/s"),
1679 Float(title=_(u"Critical at"), unit="1/s"),
1680 ])),
1681 ]), TextAscii(title=_(u"Port index or 'Total'")), "dict")
1683 register_check_parameters(
1684 RulespecGroupCheckParametersStorage, "storage_throughput", _(u"Throughput for DDN S2A devices"),
1685 Dictionary(elements=[
1686 ("read",
1687 Tuple(
1688 title=_(u"Read throughput per second"),
1689 elements=[
1690 Filesize(title=_(u"Warning at")),
1691 Filesize(title=_(u"Critical at")),
1692 ])),
1693 ("write",
1694 Tuple(
1695 title=_(u"Write throughput per second"),
1696 elements=[
1697 Filesize(title=_(u"Warning at")),
1698 Filesize(title=_(u"Critical at")),
1699 ])),
1700 ("total",
1701 Tuple(
1702 title=_(u"Total throughput per second"),
1703 elements=[
1704 Filesize(title=_(u"Warning at")),
1705 Filesize(title=_(u"Critical at")),
1706 ])),
1707 ]), TextAscii(title=_(u"Port index or 'Total'")), "dict")
1709 register_check_parameters(
1710 RulespecGroupCheckParametersStorage, "ddn_s2a_wait", _(u"Read/write wait for DDN S2A devices"),
1711 Dictionary(elements=[
1712 ("read_avg",
1713 Tuple(
1714 title=_(u"Read wait average"),
1715 elements=[
1716 Float(title=_(u"Warning at"), unit="s"),
1717 Float(title=_(u"Critical at"), unit="s"),
1718 ])),
1719 ("read_min",
1720 Tuple(
1721 title=_(u"Read wait minimum"),
1722 elements=[
1723 Float(title=_(u"Warning at"), unit="s"),
1724 Float(title=_(u"Critical at"), unit="s"),
1725 ])),
1726 ("read_max",
1727 Tuple(
1728 title=_(u"Read wait maximum"),
1729 elements=[
1730 Float(title=_(u"Warning at"), unit="s"),
1731 Float(title=_(u"Critical at"), unit="s"),
1732 ])),
1733 ("write_avg",
1734 Tuple(
1735 title=_(u"Write wait average"),
1736 elements=[
1737 Float(title=_(u"Warning at"), unit="s"),
1738 Float(title=_(u"Critical at"), unit="s"),
1739 ])),
1740 ("write_min",
1741 Tuple(
1742 title=_(u"Write wait minimum"),
1743 elements=[
1744 Float(title=_(u"Warning at"), unit="s"),
1745 Float(title=_(u"Critical at"), unit="s"),
1746 ])),
1747 ("write_max",
1748 Tuple(
1749 title=_(u"Write wait maximum"),
1750 elements=[
1751 Float(title=_(u"Warning at"), unit="s"),
1752 Float(title=_(u"Critical at"), unit="s"),
1753 ])),
1755 DropdownChoice(title=_(u"Host or Disk"), choices=[
1756 ("Disk", _(u"Disk")),
1757 ("Host", _(u"Host")),
1758 ]), "dict")
1760 register_check_parameters(
1761 RulespecGroupCheckParametersStorage,
1762 "blank_tapes",
1763 _("Remaining blank tapes in DIVA CSM Devices"),
1764 Tuple(
1765 elements=[
1766 Integer(title=_("Warning below"), default_value=5),
1767 Integer(title=_("Critical below"), default_value=1),
1768 ],),
1769 None,
1770 match_type="first",
1773 register_check_parameters(
1774 RulespecGroupCheckParametersStorage,
1775 "mongodb_flushing",
1776 _("MongoDB Flushes"),
1777 Dictionary(elements=[
1779 "average_time",
1780 Tuple(
1781 title=_("Average flush time"),
1782 elements=[
1783 Integer(title=_("Warning at"), unit="ms", default_value=50),
1784 Integer(title=_("Critical at"), unit="ms", default_value=100),
1785 Integer(title=_("Time interval"), unit="minutes", default_value=10),
1789 "last_time",
1790 Tuple(
1791 title=_("Last flush time"),
1792 elements=[
1793 Integer(title=_("Warning at"), unit="ms", default_value=50),
1794 Integer(title=_("Critical at"), unit="ms", default_value=100),
1798 None,
1799 match_type="dict")
1801 register_check_parameters(
1802 RulespecGroupCheckParametersStorage,
1803 "mongodb_asserts",
1804 _("MongoDB Assert Rates"),
1805 Dictionary(
1806 elements=[("%s_assert_rate" % what,
1807 Tuple(
1808 title=_("%s rate") % what.title(),
1809 elements=[
1810 Float(title=_("Warning at"), unit=_("Asserts / s"), default_value=1.0),
1811 Float(title=_("Critical at"), unit=_("Asserts / s"), default_value=2.0),
1812 ])) for what in ["msg", "rollovers", "regular", "warning", "user"]],),
1813 None,
1814 match_type="dict")
1816 register_check_parameters(
1817 RulespecGroupCheckParametersStorage,
1818 "mongodb_mem",
1819 _("MongoDB Memory"),
1820 Dictionary(
1821 title=_("MongoDB Memory"),
1822 elements=[
1823 ("resident_levels",
1824 Tuple(
1825 title=_("Resident memory usage"),
1826 help=
1827 _("The value of resident is roughly equivalent to the amount of RAM, "
1828 "currently used by the database process. In normal use this value tends to grow. "
1829 "In dedicated database servers this number tends to approach the total amount of system memory."
1831 elements=[
1832 Filesize(title=_("Warning at"), default_value=1 * 1024**3),
1833 Filesize(title=_("Critical at"), default_value=2 * 1024**3),
1836 ("mapped_levels",
1837 Tuple(
1838 title=_("Mapped memory usage"),
1839 help=_(
1840 "The value of mapped shows the amount of mapped memory by the database. "
1841 "Because MongoDB uses memory-mapped files, this value is likely to be to be "
1842 "roughly equivalent to the total size of your database or databases."),
1843 elements=[
1844 Filesize(title=_("Warning at"), default_value=1 * 1024**3),
1845 Filesize(title=_("Critical at"), default_value=2 * 1024**3),
1848 ("virtual_levels",
1849 Tuple(
1850 title=_("Virtual memory usage"),
1851 help=_(
1852 "Virtual displays the quantity of virtual memory used by the mongod process. "
1854 elements=[
1855 Filesize(title=_("Warning at"), default_value=2 * 1024**3),
1856 Filesize(title=_("Critical at"), default_value=4 * 1024**3),
1860 None,
1861 match_type="dict")
1863 register_check_parameters(
1864 RulespecGroupCheckParametersStorage,
1865 "openhardwaremonitor_smart",
1866 _("OpenHardwareMonitor S.M.A.R.T."),
1867 Dictionary(elements=[
1868 ("remaining_life",
1869 Tuple(
1870 title=_("Remaining Life"),
1871 help=_("Estimated remaining health of the disk based on other readings."),
1872 elements=[
1873 Percentage(title=_("Warning below"), default_value=30),
1874 Percentage(title=_("Critical below"), default_value=10),
1878 TextAscii(
1879 title=_("Device Name"),
1880 help=_("Name of the Hard Disk as reported by OHM: hdd0, hdd1, ..."),
1882 match_type="dict")
1884 register_check_parameters(
1885 RulespecGroupCheckParametersStorage,
1886 "mongodb_locks",
1887 _("MongoDB Locks"),
1888 Dictionary(
1889 elements=[("%s_locks" % what,
1890 Tuple(
1891 title=_("%s Locks") % what.title().replace("_", " "),
1892 elements=[
1893 Integer(title=_("Warning at"), minvalue=0),
1894 Integer(title=_("Critical at"), minvalue=0),
1895 ])) for what in [
1896 "clients_readers", "clients_writers", "clients_total", "queue_readers",
1897 "queue_writers", "queue_total"
1898 ]],),
1899 None,
1900 match_type="dict")
1902 register_check_parameters(
1903 RulespecGroupCheckParametersStorage,
1904 "prism_container",
1905 _("Nutanix Prism"),
1906 Dictionary(
1907 elements=[("levels",
1908 Alternative(
1909 title=_("Usage levels"),
1910 default_value=(80.0, 90.0),
1911 elements=[
1912 Tuple(
1913 title=_("Specify levels in percentage of total space"),
1914 elements=[
1915 Percentage(title=_("Warning at"), unit=_("%")),
1916 Percentage(title=_("Critical at"), unit=_("%"))
1918 Tuple(
1919 title=_("Specify levels in absolute usage"),
1920 elements=[
1921 Filesize(
1922 title=_("Warning at"), default_value=1000 * 1024 * 1024),
1923 Filesize(
1924 title=_("Critical at"), default_value=5000 * 1024 * 1024)
1926 ]))],
1927 optional_keys=[]),
1928 TextAscii(
1929 title=_("Container Name"),
1930 help=_("Name of the container"),
1932 match_type="dict")
1934 register_check_parameters(
1935 RulespecGroupCheckParametersStorage,
1936 "inotify",
1937 _("INotify Levels"),
1938 Dictionary(
1939 help=_("This rule allows you to set levels for specific Inotify changes. "
1940 "Keep in mind that you can only monitor operations which are actually "
1941 "enabled in the Inotify plugin. So it might be a good idea to cross check "
1942 "these levels here with the configuration rule in the agent bakery. "),
1943 elements=[
1944 ('age_last_operation',
1945 ListOf(
1946 Tuple(
1947 elements=[
1948 DropdownChoice(
1949 title=_("INotify Operation"),
1950 choices=[
1951 ("create", _("Create")),
1952 ("delete", _("Delete")),
1953 ("open", _("Open")),
1954 ("modify", _("Modify")),
1955 ("access", _("Access")),
1956 ("movedfrom", _("Moved from")),
1957 ("movedto", _("Moved to")),
1958 ("moveself", _("Move self")),
1960 Age(title=_("Warning at")),
1961 Age(title=_("Critical at")),
1962 ],),
1963 title=_("Age of last operation"),
1964 movable=False)),
1966 optional_keys=None,
1968 TextAscii(title=_("The filesystem path, prefixed with <i>File </i> or <i>Folder </i>"),),
1969 match_type="dict")
1971 register_check_parameters(
1972 RulespecGroupCheckParametersStorage,
1973 "emcvnx_disks",
1974 _("EMC VNX Enclosures"),
1975 Dictionary(elements=[
1976 ("state_read_error",
1977 Tuple(
1978 title=_("State on hard read error"),
1979 elements=[
1980 MonitoringState(
1981 title=_("State"),
1982 default_value=2,
1984 Integer(
1985 title=_("Minimum error count"),
1986 default_value=2,
1988 ])),
1989 ("state_write_error",
1990 Tuple(
1991 title=_("State on hard write error"),
1992 elements=[
1993 MonitoringState(
1994 title=_("State"),
1995 default_value=2,
1997 Integer(
1998 title=_("Minimum error count"),
1999 default_value=2,
2001 ])),
2002 ("state_rebuilding",
2003 MonitoringState(default_value=1, title=_("State when rebuildung enclosure"))),
2005 TextAscii(title=_("Enclosure ID"), allow_empty=True),
2006 match_type="dict",
2009 register_check_parameters(
2010 RulespecGroupCheckParametersStorage,
2011 "lvm_lvs_pools",
2012 _("Logical Volume Pools (LVM)"),
2013 Dictionary(elements=[
2015 "levels_meta",
2016 Tuple(
2017 title=_("Levels for Meta"),
2018 default_value=(80.0, 90.0),
2019 elements=[
2020 Percentage(title=_("Warning at"), unit=_("%")),
2021 Percentage(title=_("Critical at"), unit=_("%"))
2025 "levels_data",
2026 Tuple(
2027 title=_("Levels for Data"),
2028 default_value=(80.0, 90.0),
2029 elements=[
2030 Percentage(title=_("Warning at"), unit=_("%")),
2031 Percentage(title=_("Critical at"), unit=_("%"))
2035 TextAscii(
2036 title=_("Logical Volume Pool"),
2037 allow_empty=True,
2039 match_type="dict")
2041 register_check_parameters(
2042 RulespecGroupCheckParametersStorage,
2043 "emcvnx_storage_pools",
2044 _("EMC VNX storage pools"),
2045 Dictionary(elements=[
2046 ("percent_full",
2047 Tuple(
2048 title=_("Upper levels for physical capacity in percent"),
2049 elements=[
2050 Percentage(title=_("Warning at"), default_value=70.0),
2051 Percentage(title=_("Critical at"), default_value=90.0),
2052 ])),
2054 TextAscii(title=_("Pool name")),
2055 match_type="dict",
2058 register_check_parameters(
2059 RulespecGroupCheckParametersStorage,
2060 "emcvnx_storage_pools_tiering",
2061 _("EMC VNX storage pools tiering"),
2062 Dictionary(elements=[
2063 ("time_to_complete",
2064 Tuple(
2065 title=_("Upper levels for estimated time to complete"),
2066 elements=[
2067 Age(title=_("Warning at"), default_value=300 * 60 * 60),
2068 Age(title=_("Critical at"), default_value=350 * 60 * 60),
2069 ])),
2071 TextAscii(title=_("Pool name")),
2072 match_type="dict",
2075 register_check_parameters(
2076 RulespecGroupCheckParametersStorage,
2077 "filehandler",
2078 _("Filehandler"),
2079 Dictionary(elements=[
2081 "levels",
2082 Tuple(
2083 title=_("Levels"),
2084 default_value=(80.0, 90.0),
2085 elements=[
2086 Percentage(title=_("Warning at"), unit=_("%")),
2087 Percentage(title=_("Critical at"), unit=_("%"))
2091 None,
2092 match_type="dict")
2094 register_check_parameters(
2095 RulespecGroupCheckParametersStorage,
2096 "brocade_fcport",
2097 _("Brocade FibreChannel ports"),
2098 Dictionary(
2099 elements=[(
2100 "bw",
2101 Alternative(
2102 title=_("Throughput levels"),
2103 help=_("Please note: in a few cases the automatic detection of the link speed "
2104 "does not work. In these cases you have to set the link speed manually "
2105 "below if you want to monitor percentage values"),
2106 elements=[
2107 Tuple(
2108 title=_("Used bandwidth of port relative to the link speed"),
2109 elements=[
2110 Percentage(title=_("Warning at"), unit=_("percent")),
2111 Percentage(title=_("Critical at"), unit=_("percent")),
2113 Tuple(
2114 title=_("Used Bandwidth of port in megabyte/s"),
2115 elements=[
2116 Integer(title=_("Warning at"), unit=_("MByte/s")),
2117 Integer(title=_("Critical at"), unit=_("MByte/s")),
2119 ])),
2120 ("assumed_speed",
2121 Float(
2122 title=_("Assumed link speed"),
2123 help=_("If the automatic detection of the link speed does "
2124 "not work you can set the link speed here."),
2125 unit=_("GByte/s"))),
2126 ("rxcrcs",
2127 Tuple(
2128 title=_("CRC errors rate"),
2129 elements=[
2130 Percentage(title=_("Warning at"), unit=_("percent")),
2131 Percentage(title=_("Critical at"), unit=_("percent")),
2132 ])),
2133 ("rxencoutframes",
2134 Tuple(
2135 title=_("Enc-Out frames rate"),
2136 elements=[
2137 Percentage(title=_("Warning at"), unit=_("percent")),
2138 Percentage(title=_("Critical at"), unit=_("percent")),
2139 ])),
2140 ("rxencinframes",
2141 Tuple(
2142 title=_("Enc-In frames rate"),
2143 elements=[
2144 Percentage(title=_("Warning at"), unit=_("percent")),
2145 Percentage(title=_("Critical at"), unit=_("percent")),
2146 ])),
2147 ("notxcredits",
2148 Tuple(
2149 title=_("No-TxCredits errors"),
2150 elements=[
2151 Percentage(title=_("Warning at"), unit=_("percent")),
2152 Percentage(title=_("Critical at"), unit=_("percent")),
2153 ])),
2154 ("c3discards",
2155 Tuple(
2156 title=_("C3 discards"),
2157 elements=[
2158 Percentage(title=_("Warning at"), unit=_("percent")),
2159 Percentage(title=_("Critical at"), unit=_("percent")),
2160 ])),
2161 ("average",
2162 Integer(
2163 title=_("Averaging"),
2164 help=_(
2165 "If this parameter is set, all throughputs will be averaged "
2166 "over the specified time interval before levels are being applied. Per "
2167 "default, averaging is turned off. "),
2168 unit=_("minutes"),
2169 minvalue=1,
2170 default_value=60,
2172 ("phystate",
2173 Optional(
2174 ListChoice(
2175 title=_("Allowed states (otherwise check will be critical)"),
2176 choices=[
2177 (1, _("noCard")),
2178 (2, _("noTransceiver")),
2179 (3, _("laserFault")),
2180 (4, _("noLight")),
2181 (5, _("noSync")),
2182 (6, _("inSync")),
2183 (7, _("portFault")),
2184 (8, _("diagFault")),
2185 (9, _("lockRef")),
2187 title=_("Physical state of port"),
2188 negate=True,
2189 label=_("ignore physical state"),
2191 ("opstate",
2192 Optional(
2193 ListChoice(
2194 title=_("Allowed states (otherwise check will be critical)"),
2195 choices=[
2196 (0, _("unknown")),
2197 (1, _("online")),
2198 (2, _("offline")),
2199 (3, _("testing")),
2200 (4, _("faulty")),
2202 title=_("Operational state"),
2203 negate=True,
2204 label=_("ignore operational state"),
2206 ("admstate",
2207 Optional(
2208 ListChoice(
2209 title=_("Allowed states (otherwise check will be critical)"),
2210 choices=[
2211 (1, _("online")),
2212 (2, _("offline")),
2213 (3, _("testing")),
2214 (4, _("faulty")),
2216 title=_("Administrative state"),
2217 negate=True,
2218 label=_("ignore administrative state"),
2219 ))]),
2220 TextAscii(
2221 title=_("port name"),
2222 help=_("The name of the switch port"),
2224 match_type="dict",
2227 register_check_parameters(
2228 RulespecGroupCheckParametersStorage, "brocade_sfp", _("Brocade SFPs"),
2229 Dictionary(elements=[
2230 ("rx_power",
2231 Tuple(
2232 title=_("Rx power level"),
2233 elements=[
2234 Float(title=_("Critical below"), unit=_("dBm")),
2235 Float(title=_("Warning below"), unit=_("dBm")),
2236 Float(title=_("Warning at"), unit=_("dBm")),
2237 Float(title=_("Critical at"), unit=_("dBm"))
2238 ])),
2239 ("tx_power",
2240 Tuple(
2241 title=_("Tx power level"),
2242 elements=[
2243 Float(title=_("Critical below"), unit=_("dBm")),
2244 Float(title=_("Warning below"), unit=_("dBm")),
2245 Float(title=_("Warning at"), unit=_("dBm")),
2246 Float(title=_("Critical at"), unit=_("dBm"))
2247 ])),
2248 ]), TextAscii(title=_("Port index")), "dict")
2250 register_check_parameters(
2251 RulespecGroupCheckParametersStorage, "fcport_words", _("Atto Fibrebridge FC port"),
2252 Dictionary(
2253 title=_("Levels for transmitted and received words"),
2254 elements=[
2255 ("fc_tx_words", Levels(title=_("Tx"), unit=_("words/s"))),
2256 ("fc_rx_words", Levels(title=_("Rx"), unit=_("words/s"))),
2258 ), TextAscii(title=_("Port index"),), "dict")
2260 register_check_parameters(
2261 RulespecGroupCheckParametersStorage, "fs_mount_options",
2262 _("Filesystem mount options (Linux/UNIX)"),
2263 ListOfStrings(
2264 title=_("Expected mount options"),
2265 help=_("Specify all expected mount options here. If the list of "
2266 "actually found options differs from this list, the check will go "
2267 "warning or critical. Just the option <tt>commit</tt> is being "
2268 "ignored since it is modified by the power saving algorithms."),
2269 valuespec=TextUnicode(),
2270 ), TextAscii(title=_("Mount point"), allow_empty=False), "first")
2272 register_check_parameters(
2273 RulespecGroupCheckParametersStorage, "storcli_vdrives", _("LSI RAID VDrives (StorCLI)"),
2274 Dictionary(
2275 title=_("Evaluation of VDrive States"),
2276 elements=[
2277 ("Optimal", MonitoringState(
2278 title=_("State for <i>Optimal</i>"),
2279 default_value=0,
2281 ("Partially Degraded",
2282 MonitoringState(
2283 title=_("State for <i>Partially Degraded</i>"),
2284 default_value=1,
2286 ("Degraded", MonitoringState(
2287 title=_("State for <i>Degraded</i>"),
2288 default_value=2,
2290 ("Offline", MonitoringState(
2291 title=_("State for <i>Offline</i>"),
2292 default_value=1,
2294 ("Recovery", MonitoringState(
2295 title=_("State for <i>Recovery</i>"),
2296 default_value=1,
2298 ]), TextAscii(
2299 title=_("Virtual Drive"),
2300 allow_empty=False,
2301 ), "dict")
2303 register_check_parameters(
2304 RulespecGroupCheckParametersStorage, "storcli_pdisks", _("LSI RAID physical disks (StorCLI)"),
2305 Dictionary(
2306 title=_("Evaluation of PDisk States"),
2307 elements=[
2308 ("Dedicated Hot Spare",
2309 MonitoringState(
2310 title=_("State for <i>Dedicated Hot Spare</i>"),
2311 default_value=0,
2313 ("Global Hot Spare",
2314 MonitoringState(
2315 title=_("State for <i>Global Hot Spare</i>"),
2316 default_value=0,
2318 ("Unconfigured Good",
2319 MonitoringState(
2320 title=_("State for <i>Unconfigured Good</i>"),
2321 default_value=0,
2323 ("Unconfigured Bad",
2324 MonitoringState(
2325 title=_("State for <i>Unconfigured Bad</i>"),
2326 default_value=1,
2328 ("Online", MonitoringState(
2329 title=_("State for <i>Online</i>"),
2330 default_value=0,
2332 ("Offline", MonitoringState(
2333 title=_("State for <i>Offline</i>"),
2334 default_value=2,
2336 ]), TextAscii(
2337 title=_("PDisk EID:Slot-Device"),
2338 allow_empty=False,
2339 ), "dict")
2341 register_check_parameters(
2342 RulespecGroupCheckParametersStorage,
2343 "veeam_tapejobs",
2344 _("VEEAM tape backup jobs"),
2345 Tuple(
2346 title=_("Levels for duration of backup job"),
2347 elements=[
2348 Age(title="Warning at"),
2349 Age(title="Critical at"),
2352 TextAscii(title=_("Name of the tape job"),),
2353 "first",
2357 def ceph_epoch_element(title):
2358 return [("epoch",
2359 Tuple(
2360 title=title,
2361 elements=[
2362 Float(title=_("Warning at")),
2363 Float(title=_("Critical at")),
2364 Integer(title=_("Average interval"), unit=_("minutes")),
2365 ]))]
2368 register_check_parameters(
2369 RulespecGroupCheckParametersStorage,
2370 "ceph_status",
2371 _("Ceph Status"),
2372 Dictionary(elements=ceph_epoch_element(_("Status epoch levels and average")),),
2373 None,
2374 "dict",
2377 register_check_parameters(
2378 RulespecGroupCheckParametersStorage,
2379 "ceph_osds",
2380 _("Ceph OSDs"),
2381 Dictionary(
2382 elements=[
2383 ("num_out_osds",
2384 Tuple(
2385 title=_("Upper levels for number of OSDs which are out"),
2386 elements=[
2387 Percentage(title=_("Warning at")),
2388 Percentage(title=_("Critical at")),
2389 ])),
2390 ("num_down_osds",
2391 Tuple(
2392 title=_("Upper levels for number of OSDs which are down"),
2393 elements=[
2394 Percentage(title=_("Warning at")),
2395 Percentage(title=_("Critical at")),
2396 ])),
2397 ] + ceph_epoch_element(_("OSDs epoch levels and average")),),
2398 None,
2399 "dict",
2402 register_check_parameters(
2403 RulespecGroupCheckParametersStorage,
2404 "ceph_mgrs",
2405 _("Ceph MGRs"),
2406 Dictionary(elements=ceph_epoch_element(_("MGRs epoch levels and average")),),
2407 None,
2408 "dict",
2411 register_check_parameters(
2412 RulespecGroupCheckParametersStorage,
2413 "quantum_storage_status",
2414 _("Quantum Storage Status"),
2415 Dictionary(elements=[
2416 ("map_states",
2417 Dictionary(
2418 elements=[
2419 ("unavailable", MonitoringState(title=_("Device unavailable"), default_value=2)),
2420 ("available", MonitoringState(title=_("Device available"), default_value=0)),
2421 ("online", MonitoringState(title=_("Device online"), default_value=0)),
2422 ("offline", MonitoringState(title=_("Device offline"), default_value=2)),
2423 ("going online", MonitoringState(title=_("Device going online"), default_value=1)),
2424 ("state not available",
2425 MonitoringState(title=_("Device state not available"), default_value=3)),
2427 title=_('Map Device States'),
2428 optional_keys=[],
2431 None,
2432 "dict",
2435 register_check_parameters(
2436 RulespecGroupCheckParametersEnvironment, "apc_system_events", _("APC Inrow System Events"),
2437 Dictionary(
2438 title=_("System Events on APX Inrow Devices"),
2439 elements=[
2440 ("state", MonitoringState(
2441 title=_("State during active system events"),
2442 default_value=2,
2444 ]), None, "dict")
2446 # Note: This hack is only required on very old filesystem checks (prior August 2013)
2447 fs_levels_elements_hack = [
2448 # Beware: this is a nasty hack that helps us to detect new-style parameters.
2449 # Something hat has todo with float/int conversion and has not been documented
2450 # by the one who implemented this.
2451 ("flex_levels", FixedValue(
2452 None,
2453 totext="",
2454 title="",
2459 # Match and transform functions for level configurations like
2460 # -- used absolute, positive int (2, 4)
2461 # -- used percentage, positive float (2.0, 4.0)
2462 # -- available absolute, negative int (-2, -4)
2463 # -- available percentage, negative float (-2.0, -4.0)
2464 # (4 alternatives)
2465 def match_dual_level_type(value):
2466 if isinstance(value, list):
2467 for entry in value:
2468 if entry[1][0] < 0 or entry[1][1] < 0:
2469 return 1
2470 return 0
2471 if value[0] < 0 or value[1] < 0:
2472 return 1
2473 return 0
2476 def get_free_used_dynamic_valuespec(what, name, default_value=(80.0, 90.0)):
2477 if what == "used":
2478 title = _("used space")
2479 course = _("above")
2480 else:
2481 title = _("free space")
2482 course = _("below")
2484 vs_subgroup = [
2485 Tuple(
2486 title=_("Percentage %s") % title,
2487 elements=[
2488 Percentage(title=_("Warning if %s") % course, unit="%", minvalue=0.0),
2489 Percentage(title=_("Critical if %s") % course, unit="%", minvalue=0.0),
2491 Tuple(
2492 title=_("Absolute %s") % title,
2493 elements=[
2494 Integer(title=_("Warning if %s") % course, unit=_("MB"), minvalue=0),
2495 Integer(title=_("Critical if %s") % course, unit=_("MB"), minvalue=0),
2499 def validate_dynamic_levels(value, varprefix):
2500 if [v for v in value if v[0] < 0]:
2501 raise MKUserError(varprefix, _("You need to specify levels " "of at least 0 bytes."))
2503 return Alternative(
2504 title=_("Levels for %s %s") % (name, title),
2505 style="dropdown",
2506 show_alternative_title=True,
2507 default_value=default_value,
2508 elements=vs_subgroup + [
2509 ListOf(
2510 Tuple(
2511 orientation="horizontal",
2512 elements=[
2513 Filesize(title=_("%s larger than") % name.title()),
2514 Alternative(elements=vs_subgroup)
2516 title=_('Dynamic levels'),
2517 allow_empty=False,
2518 validate=validate_dynamic_levels,
2524 def transform_filesystem_free(value):
2525 tuple_convert = lambda val: tuple(-x for x in val)
2527 if isinstance(value, tuple):
2528 return tuple_convert(value)
2530 result = []
2531 for item in value:
2532 result.append((item[0], tuple_convert(item[1])))
2533 return result
2536 fs_levels_elements = [("levels",
2537 Alternative(
2538 title=_("Levels for filesystem"),
2539 show_alternative_title=True,
2540 default_value=(80.0, 90.0),
2541 match=match_dual_level_type,
2542 elements=[
2543 get_free_used_dynamic_valuespec("used", "filesystem"),
2544 Transform(
2545 get_free_used_dynamic_valuespec(
2546 "free", "filesystem", default_value=(20.0, 10.0)),
2547 title=_("Levels for filesystem free space"),
2548 allow_empty=False,
2549 forth=transform_filesystem_free,
2550 back=transform_filesystem_free)
2551 ])),
2552 ("show_levels",
2553 DropdownChoice(
2554 title=_("Display warn/crit levels in check output..."),
2555 choices=[
2556 ("onproblem", _("Only if the status is non-OK")),
2557 ("onmagic", _("If the status is non-OK or a magic factor is set")),
2558 ("always", _("Always")),
2560 default_value="onmagic",
2563 fs_reserved_elements = [
2564 ("show_reserved",
2565 DropdownChoice(
2566 title=_("Show space reserved for the <tt>root</tt> user"),
2567 help=
2568 _("Check_MK treats space that is reserved for the <tt>root</tt> user on Linux and Unix as "
2569 "used space. Usually, 5% are being reserved for root when a new filesystem is being created. "
2570 "With this option you can have Check_MK display the current amount of reserved but yet unused "
2571 "space."),
2572 choices=[
2573 (True, _("Show reserved space")),
2574 (False, _("Do now show reserved space")),
2575 ])),
2576 ("subtract_reserved",
2577 DropdownChoice(
2578 title=_(
2579 "Exclude space reserved for the <tt>root</tt> user from calculation of used space"),
2580 help=
2581 _("By default Check_MK treats space that is reserved for the <tt>root</tt> user on Linux and Unix as "
2582 "used space. Usually, 5% are being reserved for root when a new filesystem is being created. "
2583 "With this option you can have Check_MK exclude the current amount of reserved but yet unused "
2584 "space from the calculations regarding the used space percentage."),
2585 choices=[
2586 (False, _("Include reserved space")),
2587 (True, _("Exclude reserved space")),
2588 ])),
2591 fs_inodes_elements = [
2592 ("inodes_levels",
2593 Alternative(
2594 title=_("Levels for Inodes"),
2595 help=_("The number of remaining inodes on the filesystem. "
2596 "Please note that this setting has no effect on some filesystem checks."),
2597 elements=[
2598 Tuple(
2599 title=_("Percentage free"),
2600 elements=[
2601 Percentage(title=_("Warning if less than")),
2602 Percentage(title=_("Critical if less than")),
2604 Tuple(
2605 title=_("Absolute free"),
2606 elements=[
2607 Integer(
2608 title=_("Warning if less than"),
2609 size=10,
2610 unit=_("inodes"),
2611 minvalue=0,
2612 default_value=10000),
2613 Integer(
2614 title=_("Critical if less than"),
2615 size=10,
2616 unit=_("inodes"),
2617 minvalue=0,
2618 default_value=5000),
2621 default_value=(10.0, 5.0),
2623 ("show_inodes",
2624 DropdownChoice(
2625 title=_("Display inode usage in check output..."),
2626 choices=[
2627 ("onproblem", _("Only in case of a problem")),
2628 ("onlow", _("Only in case of a problem or if inodes are below 50%")),
2629 ("always", _("Always")),
2631 default_value="onlow",
2635 fs_magic_elements = [
2636 ("magic",
2637 Float(
2638 title=_("Magic factor (automatic level adaptation for large filesystems)"),
2639 default_value=0.8,
2640 minvalue=0.1,
2641 maxvalue=1.0)),
2642 ("magic_normsize",
2643 Integer(
2644 title=_("Reference size for magic factor"), default_value=20, minvalue=1, unit=_("GB"))),
2645 ("levels_low",
2646 Tuple(
2647 title=_("Minimum levels if using magic factor"),
2648 help=_("The filesystem levels will never fall below these values, when using "
2649 "the magic factor and the filesystem is very small."),
2650 elements=[
2651 Percentage(title=_("Warning at"), unit=_("% usage"), allow_int=True, default_value=50),
2652 Percentage(
2653 title=_("Critical at"), unit=_("% usage"), allow_int=True, default_value=60)
2657 size_trend_elements = [
2658 ("trend_range",
2659 Optional(
2660 Integer(
2661 title=_("Time Range for trend computation"),
2662 default_value=24,
2663 minvalue=1,
2664 unit=_("hours")),
2665 title=_("Trend computation"),
2666 label=_("Enable trend computation"))),
2667 ("trend_mb",
2668 Tuple(
2669 title=_("Levels on trends in MB per time range"),
2670 elements=[
2671 Integer(title=_("Warning at"), unit=_("MB / range"), default_value=100),
2672 Integer(title=_("Critical at"), unit=_("MB / range"), default_value=200)
2673 ])),
2674 ("trend_perc",
2675 Tuple(
2676 title=_("Levels for the percentual growth per time range"),
2677 elements=[
2678 Percentage(
2679 title=_("Warning at"),
2680 unit=_("% / range"),
2681 default_value=5,
2683 Percentage(
2684 title=_("Critical at"),
2685 unit=_("% / range"),
2686 default_value=10,
2688 ])),
2689 ("trend_timeleft",
2690 Tuple(
2691 title=_("Levels on the time left until full"),
2692 elements=[
2693 Integer(
2694 title=_("Warning if below"),
2695 unit=_("hours"),
2696 default_value=12,
2698 Integer(
2699 title=_("Critical if below"),
2700 unit=_("hours"),
2701 default_value=6,
2703 ])),
2704 ("trend_showtimeleft",
2705 Checkbox(
2706 title=_("Display time left in check output"),
2707 label=_("Enable"),
2708 help=_("Normally, the time left until the disk is full is only displayed when "
2709 "the configured levels have been breached. If you set this option "
2710 "the check always reports this information"))),
2711 ("trend_perfdata",
2712 Checkbox(
2713 title=_("Trend performance data"),
2714 label=_("Enable generation of performance data from trends"))),
2717 filesystem_elements = fs_levels_elements + fs_levels_elements_hack + fs_reserved_elements + fs_inodes_elements + fs_magic_elements + size_trend_elements
2720 def vs_filesystem(extra_elements=None):
2721 if extra_elements is None:
2722 extra_elements = []
2723 return Dictionary(
2724 help=_("This ruleset allows to set parameters for space and inodes usage"),
2725 elements=filesystem_elements + extra_elements,
2726 hidden_keys=["flex_levels"],
2727 ignored_keys=["patterns"],
2731 register_check_parameters(
2732 RulespecGroupCheckParametersStorage, "filesystem", _("Filesystems (used space and growth)"),
2733 vs_filesystem(),
2734 TextAscii(
2735 title=_("Mount point"),
2736 help=_("For Linux/UNIX systems, specify the mount point, for Windows systems "
2737 "the drive letter uppercase followed by a colon and a slash, e.g. <tt>C:/</tt>"),
2738 allow_empty=False), "dict")
2740 register_check_parameters(
2741 RulespecGroupCheckParametersStorage, "threepar_capacity",
2742 _("3Par Capacity (used space and growth)"),
2743 vs_filesystem([
2745 "failed_capacity_levels",
2746 Tuple(
2747 title=_("Levels for failed capacity in percent"),
2748 elements=[
2749 Percentage(title=_("Warning at"), default=0.0),
2750 Percentage(title=_("Critical at"), default=0.0),
2754 ]), TextAscii(title=_("Device type"), allow_empty=False), "dict")
2756 register_check_parameters(RulespecGroupCheckParametersStorage, "threepar_cpgs",
2757 _("3Par CPG (used space and growth)"), vs_filesystem(),
2758 TextAscii(title=_("CPG member name"), allow_empty=False), "dict")
2760 register_check_parameters(
2761 RulespecGroupCheckParametersStorage,
2762 "nfsiostats",
2763 _("NFS IO Statistics"),
2764 Dictionary(
2765 title=_("NFS IO Statistics"),
2766 optional_keys=True,
2767 elements=[
2768 ("op_s",
2769 Tuple(
2770 title=_("Operations"),
2771 elements=[
2772 Float(title=_("Warning at"), default_value=None, unit="1/s"),
2773 Float(title=_("Critical at"), default_value=None, unit="1/s"),
2774 ])),
2775 ("rpc_backlog",
2776 Tuple(
2777 title=_("RPC Backlog"),
2778 elements=[
2779 Float(title=_("Warning below"), default_value=None, unit="queue"),
2780 Float(title=_("Critical below"), default_value=None, unit="queue"),
2781 ])),
2782 ("read_ops",
2783 Tuple(
2784 title=_("Read Operations /s"),
2785 elements=[
2786 Float(title=_("Warning at"), default_value=None, unit="1/s"),
2787 Float(title=_("Critical at"), default_value=None, unit="1/s"),
2788 ])),
2789 ("read_b_s",
2790 Tuple(
2791 title=_("Reads size /s"),
2792 elements=[
2793 Float(title=_("Warning at"), default_value=None, unit="bytes/s"),
2794 Float(title=_("Critical at"), default_value=None, unit="bytes/s"),
2795 ])),
2796 ("read_b_op",
2797 Tuple(
2798 title=_("Read bytes per operation"),
2799 elements=[
2800 Float(title=_("Warning at"), default_value=None, unit="bytes/op"),
2801 Float(title=_("Critical at"), default_value=None, unit="bytes/op"),
2802 ])),
2803 ("read_retrans",
2804 Tuple(
2805 title=_("Read Retransmissions"),
2806 elements=[
2807 Percentage(title=_("Warning at"), default_value=None),
2808 Percentage(title=_("Critical at"), default_value=None),
2809 ])),
2810 ("read_avg_rtt_ms",
2811 Tuple(
2812 title=_("Read Average RTT (ms)"),
2813 elements=[
2814 Float(title=_("Warning at"), default_value=None, unit="ms"),
2815 Float(title=_("Critical at"), default_value=None, unit="ms"),
2816 ])),
2817 ("read_avg_exe_ms",
2818 Tuple(
2819 title=_("Read Average Executions (ms)"),
2820 elements=[
2821 Float(title=_("Warning at"), default_value=None, unit="ms"),
2822 Float(title=_("Critical at"), default_value=None, unit="ms"),
2823 ])),
2824 ("write_ops_s",
2825 Tuple(
2826 title=_("Write Operations/s"),
2827 elements=[
2828 Float(title=_("Warning at"), default_value=None, unit="1/s"),
2829 Float(title=_("Critical at"), default_value=None, unit="1/s"),
2830 ])),
2831 ("write_b_s",
2832 Tuple(
2833 title=_("Write size /s"),
2834 elements=[
2835 Float(title=_("Warning at"), default_value=None, unit="bytes/s"),
2836 Float(title=_("Critical at"), default_value=None, unit="bytes/s"),
2837 ])),
2838 ("write_b_op",
2839 Tuple(
2840 title=_("Write bytes per operation"),
2841 elements=[
2842 Float(title=_("Warning at"), default_value=None, unit="bytes/s"),
2843 Float(title=_("Critical at"), default_value=None, unit="bytes/s"),
2844 ])),
2845 ("write_retrans",
2846 Tuple(
2847 title=_("Write Retransmissions"),
2848 elements=[
2849 Percentage(title=_("Warning at"), default_value=None),
2850 Percentage(title=_("Critical at"), default_value=None),
2851 ])),
2852 ("write_avg_rtt_ms",
2853 Tuple(
2854 title=_("Write Avg RTT (ms)"),
2855 elements=[
2856 Float(title=_("Warning at"), default_value=None, unit="ms"),
2857 Float(title=_("Critical at"), default_value=None, unit="ms"),
2858 ])),
2859 ("write_avg_exe_ms",
2860 Tuple(
2861 title=_("Write Avg exe (ms)"),
2862 elements=[
2863 Float(title=_("Warning at"), default_value=None, unit="ms"),
2864 Float(title=_("Critical at"), default_value=None, unit="ms"),
2865 ])),
2867 TextAscii(title=_("NFS IO Statistics"),),
2868 match_type="dict",
2872 # .--Printing------------------------------------------------------------.
2873 # | ____ _ _ _ |
2874 # | | _ \ _ __(_)_ __ | |_(_)_ __ __ _ |
2875 # | | |_) | '__| | '_ \| __| | '_ \ / _` | |
2876 # | | __/| | | | | | | |_| | | | | (_| | |
2877 # | |_| |_| |_|_| |_|\__|_|_| |_|\__, | |
2878 # | |___/ |
2879 # '----------------------------------------------------------------------'
2882 def transform_printer_supply(params):
2883 if isinstance(params, tuple):
2884 if len(params) == 2:
2885 return {"levels": params}
2886 return {"levels": params[:2], "upturn_toner": params[2]}
2887 return params
2890 register_check_parameters(
2891 RulespecGroupCheckParametersPrinters,
2892 "printer_supply",
2893 _("Printer cartridge levels"),
2894 Transform(
2895 Dictionary(elements=[
2896 ("levels",
2897 Tuple(
2898 title=_("Levels for remaining supply"),
2899 elements=[
2900 Percentage(
2901 title=_("Warning level for remaining"),
2902 allow_int=True,
2903 default_value=20.0,
2904 help=_("For consumable supplies, this is configured as the percentage of "
2905 "remaining capacity. For supplies that fill up, this is configured "
2906 "as remaining space."),
2908 Percentage(
2909 title=_("Critical level for remaining"),
2910 allow_int=True,
2911 default_value=10.0,
2912 help=_("For consumable supplies, this is configured as the percentage of "
2913 "remaining capacity. For supplies that fill up, this is configured "
2914 "as remaining space."),
2916 ])),
2917 ("some_remaining",
2918 MonitoringState(
2919 title=_("State for <i>some remaining</i>"),
2920 help=_("Some printers do not report a precise percentage but "
2921 "just <i>some remaining</i> at a low fill state. Here you "
2922 "can set the monitoring state for that situation"),
2923 default_value=1,
2925 ("upturn_toner",
2926 Checkbox(
2927 title=_("Upturn toner levels"),
2928 label=_("Printer sends <i>used</i> material instead of <i>remaining</i>"),
2929 help=_("Some Printers (eg. Konica for Drum Cartdiges) returning the available"
2930 " fuel instead of what is left. In this case it's possible"
2931 " to upturn the levels to handle this behavior"),
2934 forth=transform_printer_supply,
2936 TextAscii(title=_("cartridge specification"), allow_empty=True),
2937 match_type="first",
2940 register_check_parameters(
2941 RulespecGroupCheckParametersPrinters,
2942 "printer_input",
2943 _("Printer Input Units"),
2944 Dictionary(
2945 elements=[
2946 ('capacity_levels',
2947 Tuple(
2948 title=_('Capacity remaining'),
2949 elements=[
2950 Percentage(title=_("Warning at"), default_value=0.0),
2951 Percentage(title=_("Critical at"), default_value=0.0),
2955 default_keys=['capacity_levels'],
2957 TextAscii(title=_('Unit Name'), allow_empty=True),
2958 match_type="dict",
2961 register_check_parameters(
2962 RulespecGroupCheckParametersPrinters,
2963 "printer_output",
2964 _("Printer Output Units"),
2965 Dictionary(
2966 elements=[
2967 ('capacity_levels',
2968 Tuple(
2969 title=_('Capacity filled'),
2970 elements=[
2971 Percentage(title=_("Warning at"), default_value=0.0),
2972 Percentage(title=_("Critical at"), default_value=0.0),
2976 default_keys=['capacity_levels'],
2978 TextAscii(title=_('Unit Name'), allow_empty=True),
2979 match_type="dict",
2982 register_check_parameters(
2983 RulespecGroupCheckParametersPrinters,
2984 "cups_queues",
2985 _("CUPS Queue"),
2986 Dictionary(
2987 elements=[
2988 ("job_count",
2989 Tuple(
2990 title=_("Levels of current jobs"),
2991 default_value=(5, 10),
2992 elements=[Integer(title=_("Warning at")),
2993 Integer(title=_("Critical at"))])),
2994 ("job_age",
2995 Tuple(
2996 title=_("Levels for age of jobs"),
2997 help=_("A value in seconds"),
2998 default_value=(360, 720),
2999 elements=[Integer(title=_("Warning at")),
3000 Integer(title=_("Critical at"))])),
3001 ("is_idle", MonitoringState(
3002 title=_("State for 'is idle'"),
3003 default_value=0,
3005 ("now_printing", MonitoringState(
3006 title=_("State for 'now printing'"),
3007 default_value=0,
3009 ("disabled_since",
3010 MonitoringState(
3011 title=_("State for 'disabled since'"),
3012 default_value=2,
3014 ],),
3015 TextAscii(title=_("CUPS Queue")),
3016 "dict",
3020 # .--Os------------------------------------------------------------------.
3021 # | ___ |
3022 # | / _ \ ___ |
3023 # | | | | / __| |
3024 # | | |_| \__ \ |
3025 # | \___/|___/ |
3026 # | |
3027 # '----------------------------------------------------------------------'
3029 register_check_parameters(
3030 RulespecGroupCheckParametersOperatingSystem,
3031 "uptime",
3032 _("Uptime since last reboot"),
3033 Dictionary(elements=[
3034 ("min",
3035 Tuple(
3036 title=_("Minimum required uptime"),
3037 elements=[
3038 Age(title=_("Warning if below")),
3039 Age(title=_("Critical if below")),
3040 ])),
3041 ("max",
3042 Tuple(
3043 title=_("Maximum allowed uptime"),
3044 elements=[
3045 Age(title=_("Warning at")),
3046 Age(title=_("Critical at")),
3047 ])),
3049 None,
3050 match_type="dict",
3053 register_check_parameters(
3054 RulespecGroupCheckParametersOperatingSystem, "systemtime", _("Windows system time offset"),
3055 Tuple(
3056 title=_("Time offset"),
3057 elements=[
3058 Integer(title=_("Warning at"), unit=_("Seconds")),
3059 Integer(title=_("Critical at"), unit=_("Seconds")),
3060 ]), None, "first")
3063 # .--Unsorted--(Don't create new stuff here!)----------------------------.
3064 # | _ _ _ _ |
3065 # | | | | |_ __ ___ ___ _ __| |_ ___ __| | |
3066 # | | | | | '_ \/ __|/ _ \| '__| __/ _ \/ _` | |
3067 # | | |_| | | | \__ \ (_) | | | || __/ (_| | |
3068 # | \___/|_| |_|___/\___/|_| \__\___|\__,_| |
3069 # | |
3070 # +----------------------------------------------------------------------+
3071 # | All these rules have not been moved into their according sections. |
3072 # | Please move them as you come along - but beware of dependecies! |
3073 # | Remove this section as soon as it's empty. |
3074 # '----------------------------------------------------------------------'
3076 register_check_parameters(
3077 RulespecGroupCheckParametersEnvironment, "ups_test", _("Time since last UPS selftest"),
3078 Tuple(
3079 title=_("Time since last UPS selftest"),
3080 elements=[
3081 Integer(
3082 title=_("Warning Level for time since last self test"),
3083 help=_("Warning Level for time since last diagnostic test of the device. "
3084 "For a value of 0 the warning level will not be used"),
3085 unit=_("days"),
3086 default_value=0,
3088 Integer(
3089 title=_("Critical Level for time since last self test"),
3090 help=_("Critical Level for time since last diagnostic test of the device. "
3091 "For a value of 0 the critical level will not be used"),
3092 unit=_("days"),
3093 default_value=0,
3095 ]), None, "first")
3097 register_check_parameters(
3098 RulespecGroupCheckParametersEnvironment,
3099 "apc_power",
3100 _("APC Power Consumption"),
3101 Tuple(
3102 title=_("Power Comsumption of APC Devices"),
3103 elements=[
3104 Integer(
3105 title=_("Warning below"),
3106 unit=_("W"),
3107 default_value=20,
3109 Integer(
3110 title=_("Critical below"),
3111 unit=_("W"),
3112 default_value=1,
3115 TextAscii(
3116 title=_("Phase"),
3117 help=_("The identifier of the phase the power is related to."),
3119 match_type="first")
3121 register_check_parameters(
3122 RulespecGroupCheckParametersStorage,
3123 "fileinfo",
3124 _("Size and age of single files"),
3125 Dictionary(elements=[
3126 ("minage",
3127 Tuple(
3128 title=_("Minimal age"),
3129 elements=[
3130 Age(title=_("Warning if younger than")),
3131 Age(title=_("Critical if younger than")),
3132 ])),
3133 ("maxage",
3134 Tuple(
3135 title=_("Maximal age"),
3136 elements=[
3137 Age(title=_("Warning if older than")),
3138 Age(title=_("Critical if older than")),
3139 ])),
3140 ("minsize",
3141 Tuple(
3142 title=_("Minimal size"),
3143 elements=[
3144 Filesize(title=_("Warning if below")),
3145 Filesize(title=_("Critical if below")),
3146 ])),
3147 ("maxsize",
3148 Tuple(
3149 title=_("Maximal size"),
3150 elements=[
3151 Filesize(title=_("Warning at")),
3152 Filesize(title=_("Critical at")),
3153 ])),
3154 ("timeofday",
3155 ListOfTimeRanges(
3156 title=_("Only check during the following times of the day"),
3157 help=_("Outside these ranges the check will always be OK"),
3159 ("state_missing", MonitoringState(default_value=3, title=_("State when file is missing"))),
3161 TextAscii(title=_("File name"), allow_empty=True),
3162 match_type="dict",
3165 register_rule(
3166 RulespecGroupCheckParametersStorage,
3167 varname="filesystem_groups",
3168 title=_('Filesystem grouping patterns'),
3169 help=_('Normally the filesystem checks (<tt>df</tt>, <tt>hr_fs</tt> and others) '
3170 'will create a single service for each filesystem. '
3171 'By defining grouping '
3172 'patterns you can handle groups of filesystems like one filesystem. '
3173 'For each group you can define one or several patterns. '
3174 'The filesystems matching one of the patterns '
3175 'will be monitored like one big filesystem in a single service.'),
3176 valuespec=ListOf(
3177 Tuple(
3178 show_titles=True,
3179 orientation="horizontal",
3180 elements=[
3181 TextAscii(title=_("Name of group"),),
3182 TextAscii(
3183 title=_("Pattern for mount point (using * and ?)"),
3184 help=_("You can specify one or several patterns containing "
3185 "<tt>*</tt> and <tt>?</tt>, for example <tt>/spool/tmpspace*</tt>. "
3186 "The filesystems matching the patterns will be monitored "
3187 "like one big filesystem in a single service."),
3190 add_label=_("Add pattern"),
3192 match='all',
3195 register_rule(
3196 RulespecGroupCheckParametersStorage,
3197 varname="fileinfo_groups",
3198 title=_('File Grouping Patterns'),
3199 help=_('The check <tt>fileinfo</tt> monitors the age and size of '
3200 'a single file. Each file information that is sent '
3201 'by the agent will create one service. By defining grouping '
3202 'patterns you can switch to the check <tt>fileinfo.groups</tt>. '
3203 'That check monitors a list of files at once. You can set levels '
3204 'not only for the total size and the age of the oldest/youngest '
3205 'file but also on the count. You can define one or several '
3206 'patterns for a group containing <tt>*</tt> and <tt>?</tt>, for example '
3207 '<tt>/var/log/apache/*.log</tt>. Please see Python\'s fnmatch for more '
3208 'information regarding globbing patterns and special characters. '
3209 'If the pattern begins with a tilde then this pattern is interpreted as '
3210 'a regular expression instead of as a filename globbing pattern and '
3211 '<tt>*</tt> and <tt>?</tt> are treated differently. '
3212 'For files contained in a group '
3213 'the discovery will automatically create a group service instead '
3214 'of single services for each file. This rule also applies when '
3215 'you use manually configured checks instead of inventorized ones. '
3216 'Furthermore, the current time/date in a configurable format '
3217 'may be included in the include pattern. The syntax is as follows: '
3218 '$DATE:format-spec$ or $YESTERDAY:format-spec$, where format-spec '
3219 'is a list of time format directives of the unix date command. '
3220 'Example: $DATE:%Y%m%d$ is todays date, e.g. 20140127. A pattern '
3221 'of /var/tmp/backups/$DATE:%Y%m%d$.txt would search for .txt files '
3222 'with todays date as name in the directory /var/tmp/backups. '
3223 'The YESTERDAY syntax simply subtracts one day from the reference time.'),
3224 valuespec=ListOf(
3225 Tuple(
3226 help=_("This defines one file grouping pattern."),
3227 show_titles=True,
3228 orientation="horizontal",
3229 elements=[
3230 TextAscii(
3231 title=_("Name of group"),
3232 size=10,
3234 Transform(
3235 Tuple(
3236 show_titles=True,
3237 orientation="vertical",
3238 elements=[
3239 TextAscii(title=_("Include Pattern"), size=40),
3240 TextAscii(title=_("Exclude Pattern"), size=40),
3243 forth=lambda params: isinstance(params, str) and (params, '') or params),
3246 add_label=_("Add pattern group"),
3248 match='all',
3251 register_check_parameters(
3252 RulespecGroupCheckParametersStorage,
3253 "fileinfo-groups",
3254 _("Size, age and count of file groups"),
3255 Dictionary(
3256 elements=[
3257 ("minage_oldest",
3258 Tuple(
3259 title=_("Minimal age of oldest file"),
3260 elements=[
3261 Age(title=_("Warning if younger than")),
3262 Age(title=_("Critical if younger than")),
3263 ])),
3264 ("maxage_oldest",
3265 Tuple(
3266 title=_("Maximal age of oldest file"),
3267 elements=[
3268 Age(title=_("Warning if older than")),
3269 Age(title=_("Critical if older than")),
3270 ])),
3271 ("minage_newest",
3272 Tuple(
3273 title=_("Minimal age of newest file"),
3274 elements=[
3275 Age(title=_("Warning if younger than")),
3276 Age(title=_("Critical if younger than")),
3277 ])),
3278 ("maxage_newest",
3279 Tuple(
3280 title=_("Maximal age of newest file"),
3281 elements=[
3282 Age(title=_("Warning if older than")),
3283 Age(title=_("Critical if older than")),
3284 ])),
3285 ("minsize_smallest",
3286 Tuple(
3287 title=_("Minimal size of smallest file"),
3288 elements=[
3289 Filesize(title=_("Warning if below")),
3290 Filesize(title=_("Critical if below")),
3291 ])),
3292 ("maxsize_smallest",
3293 Tuple(
3294 title=_("Maximal size of smallest file"),
3295 elements=[
3296 Filesize(title=_("Warning if above")),
3297 Filesize(title=_("Critical if above")),
3298 ])),
3299 ("minsize_largest",
3300 Tuple(
3301 title=_("Minimal size of largest file"),
3302 elements=[
3303 Filesize(title=_("Warning if below")),
3304 Filesize(title=_("Critical if below")),
3305 ])),
3306 ("maxsize_largest",
3307 Tuple(
3308 title=_("Maximal size of largest file"),
3309 elements=[
3310 Filesize(title=_("Warning if above")),
3311 Filesize(title=_("Critical if above")),
3312 ])),
3313 ("minsize",
3314 Tuple(
3315 title=_("Minimal size"),
3316 elements=[
3317 Filesize(title=_("Warning if below")),
3318 Filesize(title=_("Critical if below")),
3319 ])),
3320 ("maxsize",
3321 Tuple(
3322 title=_("Maximal size"),
3323 elements=[
3324 Filesize(title=_("Warning if above")),
3325 Filesize(title=_("Critical if above")),
3326 ])),
3327 ("mincount",
3328 Tuple(
3329 title=_("Minimal file count"),
3330 elements=[
3331 Integer(title=_("Warning if below")),
3332 Integer(title=_("Critical if below")),
3333 ])),
3334 ("maxcount",
3335 Tuple(
3336 title=_("Maximal file count"),
3337 elements=[
3338 Integer(title=_("Warning if above")),
3339 Integer(title=_("Critical if above")),
3340 ])),
3341 ("timeofday",
3342 ListOfTimeRanges(
3343 title=_("Only check during the following times of the day"),
3344 help=_("Outside these ranges the check will always be OK"),
3346 ("conjunctions",
3347 ListOf(
3348 Tuple(elements=[
3349 MonitoringState(title=_("Monitoring state"), default_value=2),
3350 ListOf(
3351 CascadingDropdown(
3352 orientation="hroizontal",
3353 choices=[
3354 ("count", _("File count at"), Integer()),
3355 ("count_lower", _("File count below"), Integer()),
3356 ("size", _("File size at"), Filesize()),
3357 ("size_lower", _("File size below"), Filesize()),
3358 ("largest_size", _("Largest file size at"), Filesize()),
3359 ("largest_size_lower", _("Largest file size below"), Filesize()),
3360 ("smallest_size", _("Smallest file size at"), Filesize()),
3361 ("smallest_size_lower", _("Smallest file size below"), Filesize()),
3362 ("oldest_age", _("Oldest file age at"), Age()),
3363 ("oldest_age_lower", _("Oldest file age below"), Age()),
3364 ("newest_age", _("Newest file age at"), Age()),
3365 ("newest_age_lower", _("Newest file age below"), Age()),
3367 magic="@#@#",
3370 title=_("Level conjunctions"),
3371 help=
3372 _("In order to check dependent file group statistics you can configure "
3373 "conjunctions of single levels now. A conjunction consists of a monitoring state "
3374 "and any number of upper or lower levels. If all of the configured levels within "
3375 "a conjunction are reached then the related state is reported."),
3378 ignored_keys=["precompiled_patterns"]),
3379 TextAscii(
3380 title=_("File Group Name"),
3381 help=_(
3382 "This name must match the name of the group defined "
3383 "in the <a href=\"wato.py?mode=edit_ruleset&varname=fileinfo_groups\">%s</a> ruleset.")
3384 % (_('File Grouping Patterns')),
3385 allow_empty=True),
3386 match_type="dict",
3389 register_check_parameters(
3390 RulespecGroupCheckParametersStorage,
3391 "netapp_fcportio",
3392 _("Netapp FC Port throughput"),
3393 Dictionary(elements=[("read",
3394 Tuple(
3395 title=_("Read"),
3396 elements=[
3397 Filesize(title=_("Warning if below")),
3398 Filesize(title=_("Critical if below")),
3399 ])),
3400 ("write",
3401 Tuple(
3402 title=_("Write"),
3403 elements=[
3404 Filesize(title=_("Warning at")),
3405 Filesize(title=_("Critical at")),
3406 ]))]),
3407 TextAscii(title=_("File name"), allow_empty=True),
3408 match_type="dict",
3411 register_check_parameters(
3412 RulespecGroupCheckParametersOperatingSystem,
3413 "memory_pagefile_win",
3414 _("Memory and pagefile levels for Windows"),
3415 Dictionary(elements=[
3417 "memory",
3418 Alternative(
3419 title=_("Memory Levels"),
3420 style="dropdown",
3421 elements=[
3422 Tuple(
3423 title=_("Memory usage in percent"),
3424 elements=[
3425 Percentage(title=_("Warning at")),
3426 Percentage(title=_("Critical at")),
3429 Transform(
3430 Tuple(
3431 title=_("Absolute free memory"),
3432 elements=[
3433 Filesize(title=_("Warning if less than")),
3434 Filesize(title=_("Critical if less than")),
3436 # Note: Filesize values lesser 1MB will not work
3437 # -> need hide option in filesize valuespec
3438 back=lambda x: (x[0] / 1024 / 1024, x[1] / 1024 / 1024),
3439 forth=lambda x: (x[0] * 1024 * 1024, x[1] * 1024 * 1024)),
3440 PredictiveLevels(unit=_("GB"), default_difference=(0.5, 1.0))
3442 default_value=(80.0, 90.0))),
3444 "pagefile",
3445 Alternative(
3446 title=_("Pagefile Levels"),
3447 style="dropdown",
3448 elements=[
3449 Tuple(
3450 title=_("Pagefile usage in percent"),
3451 elements=[
3452 Percentage(title=_("Warning at")),
3453 Percentage(title=_("Critical at")),
3455 Transform(
3456 Tuple(
3457 title=_("Absolute free pagefile"),
3458 elements=[
3459 Filesize(title=_("Warning if less than")),
3460 Filesize(title=_("Critical if less than")),
3462 # Note: Filesize values lesser 1MB will not work
3463 # -> need hide option in filesize valuespec
3464 back=lambda x: (x[0] / 1024 / 1024, x[1] / 1024 / 1024),
3465 forth=lambda x: (x[0] * 1024 * 1024, x[1] * 1024 * 1024)),
3466 PredictiveLevels(
3467 title=_("Predictive levels"), unit=_("GB"), default_difference=(0.5, 1.0))
3469 default_value=(80.0, 90.0))),
3470 ("average",
3471 Integer(
3472 title=_("Averaging"),
3473 help=_("If this parameter is set, all measured values will be averaged "
3474 "over the specified time interval before levels are being applied. Per "
3475 "default, averaging is turned off. "),
3476 unit=_("minutes"),
3477 minvalue=1,
3478 default_value=60,
3481 None,
3482 "dict")
3484 register_check_parameters(
3485 RulespecGroupCheckParametersApplications,
3486 "apache_status",
3487 ("Apache Status"),
3488 Dictionary(elements=[
3489 ("OpenSlots",
3490 Tuple(
3491 title=_("Remaining Open Slots"),
3492 help=_("Here you can set the number of remaining open slots"),
3493 elements=[
3494 Integer(title=_("Warning below"), label=_("slots")),
3495 Integer(title=_("Critical below"), label=_("slots"))
3496 ])),
3497 ("BusyWorkers",
3498 Tuple(
3499 title=_("Busy workers"),
3500 help=_("Here you can set upper levels of busy workers"),
3501 elements=[
3502 Integer(title=_("Warning at"), label=_("busy workers")),
3503 Integer(title=_("Critical at"), label=_("busy workers"))
3504 ])),
3506 TextAscii(
3507 title=_("Apache Server"),
3508 help=_("A string-combination of servername and port, e.g. 127.0.0.1:5000.")),
3509 match_type="dict",
3512 register_check_parameters(
3513 RulespecGroupCheckParametersApplications,
3514 "saprouter_cert_age",
3515 _("SAP router certificate time settings"),
3516 Dictionary(elements=[
3517 ("validity_age",
3518 Tuple(
3519 title=_('Lower levels for certificate age'),
3520 elements=[
3521 Age(title=_("Warning below"), default_value=30 * 86400),
3522 Age(title=_("Critical below"), default_value=7 * 86400),
3523 ])),
3525 None,
3526 "dict",
3529 register_check_parameters(
3530 RulespecGroupCheckParametersApplications,
3531 "sap_dialog",
3532 ("SAP Dialog"),
3533 Dictionary(elements=[
3534 ("UsersLoggedIn",
3535 Tuple(
3536 title=_("Number of Loggedin Users"),
3537 elements=[
3538 Integer(title=_("Warning at"), label=_("Users")),
3539 Integer(title=_("Critical at"), label=_("Users"))
3540 ])),
3541 ("FrontEndNetTime",
3542 Tuple(
3543 title=_("Frontend net time"),
3544 elements=[
3545 Float(title=_("Warning at"), unit=_('ms')),
3546 Float(title=_("Critical at"), unit=_('ms'))
3547 ])),
3548 ("ResponseTime",
3549 Tuple(
3550 title=_("Response Time"),
3551 elements=[
3552 Float(title=_("Warning at"), unit=_('ms')),
3553 Float(title=_("Critical at"), unit=_('ms'))
3554 ])),
3556 TextAscii(
3557 title=_("System ID"),
3558 help=_("The SAP system ID."),
3560 match_type="dict",
3563 register_check_parameters(
3564 RulespecGroupCheckParametersApplications,
3565 "nginx_status",
3566 ("Nginx Status"),
3567 Dictionary(elements=[("active_connections",
3568 Tuple(
3569 title=_("Active Connections"),
3570 help=_("You can configure upper thresholds for the currently active "
3571 "connections handled by the web server."),
3572 elements=[
3573 Integer(title=_("Warning at"), unit=_("connections")),
3574 Integer(title=_("Critical at"), unit=_("connections"))
3575 ]))]),
3576 TextAscii(
3577 title=_("Nginx Server"),
3578 help=_("A string-combination of servername and port, e.g. 127.0.0.1:80.")),
3579 match_type="dict",
3582 register_check_parameters(
3583 RulespecGroupCheckParametersApplications,
3584 "sles_license",
3585 ("SLES License"),
3586 Dictionary(elements=[
3587 ("status",
3588 DropdownChoice(
3589 title=_("Status"),
3590 help=_("Status of the SLES license"),
3591 choices=[
3592 ('Registered', _('Registered')),
3593 ('Ignore', _('Do not check')),
3594 ])),
3595 ("subscription_status",
3596 DropdownChoice(
3597 title=_("Subscription"),
3598 help=_("Status of the SLES subscription"),
3599 choices=[
3600 ('ACTIVE', _('ACTIVE')),
3601 ('Ignore', _('Do not check')),
3602 ])),
3603 ("days_left",
3604 Tuple(
3605 title=_("Time until license expiration"),
3606 help=_("Remaining days until the SLES license expires"),
3607 elements=[
3608 Integer(title=_("Warning at"), unit=_("days")),
3609 Integer(title=_("Critical at"), unit=_("days"))
3610 ])),
3612 None,
3613 match_type="dict",
3616 register_check_parameters(
3617 RulespecGroupCheckParametersNetworking,
3618 "viprinet_router",
3619 _("Viprinet router"),
3620 Dictionary(elements=[
3621 ("expect_mode",
3622 DropdownChoice(
3623 title=_("Set expected router mode"),
3624 choices=[
3625 ("inv", _("Mode found during inventory")),
3626 ("0", _("Node")),
3627 ("1", _("Hub")),
3628 ("2", _("Hub running as HotSpare")),
3629 ("3", _("Hotspare-Hub replacing another router")),
3630 ])),
3632 None,
3633 match_type="dict",
3636 register_check_parameters(
3637 RulespecGroupCheckParametersNetworking, 'docsis_channels_upstream',
3638 _("Docsis Upstream Channels"),
3639 Dictionary(elements=[
3640 ('signal_noise',
3641 Tuple(
3642 title=_("Levels for signal/noise ratio"),
3643 elements=[
3644 Float(title=_("Warning at or below"), unit="dB", default_value=10.0),
3645 Float(title=_("Critical at or below"), unit="dB", default_value=5.0),
3646 ])),
3647 ('correcteds',
3648 Tuple(
3649 title=_("Levels for rate of corrected errors"),
3650 elements=[
3651 Percentage(title=_("Warning at"), default_value=5.0),
3652 Percentage(title=_("Critical at"), default_value=8.0),
3653 ])),
3654 ('uncorrectables',
3655 Tuple(
3656 title=_("Levels for rate of uncorrectable errors"),
3657 elements=[
3658 Percentage(title=_("Warning at"), default_value=1.0),
3659 Percentage(title=_("Critical at"), default_value=2.0),
3660 ])),
3661 ]), TextAscii(title=_("ID of the channel (usually ranging from 1)")), "dict")
3663 register_check_parameters(
3664 RulespecGroupCheckParametersNetworking, "docsis_channels_downstream",
3665 _("Docsis Downstream Channels"),
3666 Dictionary(elements=[
3667 ("power",
3668 Tuple(
3669 title=_("Transmit Power"),
3670 help=_("The operational transmit power"),
3671 elements=[
3672 Float(title=_("warning at or below"), unit="dBmV", default_value=5.0),
3673 Float(title=_("critical at or below"), unit="dBmV", default_value=1.0),
3674 ])),
3675 ]), TextAscii(title=_("ID of the channel (usually ranging from 1)")), "dict")
3677 register_check_parameters(
3678 RulespecGroupCheckParametersNetworking, "docsis_cm_status", _("Docsis Cable Modem Status"),
3679 Dictionary(elements=[
3680 ("error_states",
3681 ListChoice(
3682 title=_("Modem States that lead to a critical state"),
3683 help=_(
3684 "If one of the selected states occurs the check will repsond with a critical state "
3686 choices=[
3687 (1, "other"),
3688 (2, "notReady"),
3689 (3, "notSynchronized"),
3690 (4, "phySynchronized"),
3691 (5, "usParametersAcquired"),
3692 (6, "rangingComplete"),
3693 (7, "ipComplete"),
3694 (8, "todEstablished"),
3695 (9, "securityEstablished"),
3696 (10, "paramTransferComplete"),
3697 (11, "registrationComplete"),
3698 (12, "operational"),
3699 (13, "accessDenied"),
3701 default_value=[1, 2, 13],
3703 ("tx_power",
3704 Tuple(
3705 title=_("Transmit Power"),
3706 help=_("The operational transmit power"),
3707 elements=[
3708 Float(title=_("warning at"), unit="dBmV", default_value=20.0),
3709 Float(title=_("critical at"), unit="dBmV", default_value=10.0),
3710 ])),
3711 ]), TextAscii(title=_("ID of the Entry")), "dict")
3713 register_check_parameters(
3714 RulespecGroupCheckParametersNetworking,
3715 "vpn_tunnel",
3716 _("VPN Tunnel"),
3717 Dictionary(
3718 elements=[
3719 ("tunnels",
3720 ListOf(
3721 Tuple(
3722 title=("VPN Tunnel Endpoints"),
3723 elements=[
3724 IPv4Address(
3725 title=_("IP-Address or Name of Tunnel Endpoint"),
3726 help=_(
3727 "The configured value must match a tunnel reported by the monitored "
3728 "device."),
3729 allow_empty=False,
3731 TextUnicode(
3732 title=_("Tunnel Alias"),
3733 help=_(
3734 "You can configure an individual alias here for the tunnel matching "
3735 "the IP-Address or Name configured in the field above."),
3737 MonitoringState(
3738 default_value=2,
3739 title=_("State if tunnel is not found"),
3742 add_label=_("Add tunnel"),
3743 movable=False,
3744 title=_("VPN tunnel specific configuration"),
3746 ("state",
3747 MonitoringState(
3748 title=_("Default state to report when tunnel can not be found anymore"),
3749 help=_("Default state if a tunnel, which is not listed above in this rule, "
3750 "can no longer be found."),
3752 ],),
3753 TextAscii(title=_("IP-Address of Tunnel Endpoint")),
3754 match_type="dict",
3757 register_check_parameters(
3758 RulespecGroupCheckParametersNetworking, "lsnat", _("Enterasys LSNAT Bindings"),
3759 Dictionary(
3760 elements=[
3761 ("current_bindings",
3762 Tuple(
3763 title=_("Number of current LSNAT bindings"),
3764 elements=[
3765 Integer(title=_("Warning at"), size=10, unit=_("bindings")),
3766 Integer(title=_("Critical at"), size=10, unit=_("bindings")),
3767 ])),
3769 optional_keys=False,
3770 ), None, "dict")
3772 register_check_parameters(
3773 RulespecGroupCheckParametersNetworking, "enterasys_powersupply",
3774 _("Enterasys Power Supply Settings"),
3775 Dictionary(
3776 elements=[
3777 ("redundancy_ok_states",
3778 ListChoice(
3779 title=_("States treated as OK"),
3780 choices=[
3781 (1, 'redundant'),
3782 (2, 'notRedundant'),
3783 (3, 'notSupported'),
3785 default_value=[1],
3788 optional_keys=False,
3789 ), TextAscii(title=_("Number of Powersupply"),), "dict")
3791 hivemanger_states = [
3792 ("Critical", "Critical"),
3793 ("Maybe", "Maybe"),
3794 ("Major", "Major"),
3795 ("Minor", "Minor"),
3797 register_check_parameters(
3798 RulespecGroupCheckParametersNetworking,
3799 "hivemanager_devices",
3800 _("Hivemanager Devices"),
3801 Dictionary(elements=[
3802 ('max_clients',
3803 Tuple(
3804 title=_("Number of clients"),
3805 help=_("Number of clients connected to a Device."),
3806 elements=[
3807 Integer(title=_("Warning at"), unit=_("clients")),
3808 Integer(title=_("Critical at"), unit=_("clients")),
3809 ])),
3810 ('max_uptime',
3811 Tuple(
3812 title=_("Maximum uptime of Device"),
3813 elements=[
3814 Age(title=_("Warning at")),
3815 Age(title=_("Critical at")),
3816 ])),
3817 ('alert_on_loss', FixedValue(
3818 False,
3819 totext="",
3820 title=_("Do not alert on connection loss"),
3822 ("warn_states",
3823 ListChoice(
3824 title=_("States treated as warning"),
3825 choices=hivemanger_states,
3826 default_value=['Maybe', 'Major', 'Minor'],
3828 ("crit_states",
3829 ListChoice(
3830 title=_("States treated as critical"),
3831 choices=hivemanger_states,
3832 default_value=['Critical'],
3835 TextAscii(title=_("Hostname of the Device")),
3836 match_type="dict",
3839 register_check_parameters(
3840 RulespecGroupCheckParametersNetworking,
3841 "hivemanager_ng_devices",
3842 _("HiveManager NG Devices"),
3843 Dictionary(elements=[
3844 ('max_clients',
3845 Tuple(
3846 title=_("Number of clients"),
3847 help=_("Number of clients connected to a Device."),
3848 elements=[
3849 Integer(title=_("Warning at"), unit=_("clients")),
3850 Integer(title=_("Critical at"), unit=_("clients")),
3851 ])),
3853 TextAscii(title=_("Hostname of the Device")),
3854 match_type="dict",
3857 register_check_parameters(
3858 RulespecGroupCheckParametersNetworking,
3859 "wlc_clients",
3860 _("WLC WiFi client connections"),
3861 Transform(
3862 Dictionary(
3863 title = _("Number of connections"),
3864 elements = [
3865 ("levels",
3866 Tuple(
3867 title = _("Upper levels"),
3868 elements = [
3869 Integer(title = _("Warning at"), unit=_("connections")),
3870 Integer(title = _("Critical at"), unit=_("connections")),
3873 ("levels_lower",
3874 Tuple(
3875 title = _("Lower levels"),
3876 elements= [
3877 Integer(title = _("Critical if below"), unit=_("connections")),
3878 Integer(title = _("Warning if below"), unit=_("connections")),
3883 # old params = (crit_low, warn_low, warn, crit)
3884 forth = lambda v: isinstance(v, tuple) and { "levels" : (v[2], v[3]), "levels_lower" : (v[1], v[0]) } or v,
3886 TextAscii( title = _("Name of Wifi")),
3887 "first"
3890 register_check_parameters(
3891 RulespecGroupCheckParametersNetworking,
3892 "cisco_wlc",
3893 _("Cisco WLAN AP"),
3894 Dictionary(
3895 help=_("Here you can set which alert type is set when the given "
3896 "access point is missing (might be powered off). The access point "
3897 "can be specified by the AP name or the AP model"),
3898 elements=[("ap_name",
3899 ListOf(
3900 Tuple(elements=[
3901 TextAscii(title=_("AP name")),
3902 MonitoringState(title=_("State when missing"), default_value=2)
3904 title=_("Access point name"),
3905 add_label=_("Add name")))]),
3906 TextAscii(title=_("Access Point")),
3907 match_type="dict",
3910 register_check_parameters(
3911 RulespecGroupCheckParametersNetworking,
3912 "tcp_conn_stats",
3913 _("TCP connection statistics"),
3914 Dictionary(elements=[
3915 ("ESTABLISHED",
3916 Tuple(
3917 title=_("ESTABLISHED"),
3918 help=_("connection up and passing data"),
3919 elements=[
3920 Integer(title=_("Warning at"), label=_("connections")),
3921 Integer(title=_("Critical at"), label=_("connections"))
3922 ])),
3923 ("SYN_SENT",
3924 Tuple(
3925 title=_("SYN_SENT"),
3926 help=_("session has been requested by us; waiting for reply from remote endpoint"),
3927 elements=[
3928 Integer(title=_("Warning at"), label=_("connections")),
3929 Integer(title=_("Critical at"), label=_("connections"))
3930 ])),
3931 ("SYN_RECV",
3932 Tuple(
3933 title=_("SYN_RECV"),
3934 help=_("session has been requested by a remote endpoint "
3935 "for a socket on which we were listening"),
3936 elements=[
3937 Integer(title=_("Warning at"), label=_("connections")),
3938 Integer(title=_("Critical at"), label=_("connections"))
3939 ])),
3940 ("LAST_ACK",
3941 Tuple(
3942 title=_("LAST_ACK"),
3943 help=_("our socket is closed; remote endpoint has also shut down; "
3944 " we are waiting for a final acknowledgement"),
3945 elements=[
3946 Integer(title=_("Warning at"), label=_("connections")),
3947 Integer(title=_("Critical at"), label=_("connections"))
3948 ])),
3949 ("CLOSE_WAIT",
3950 Tuple(
3951 title=_("CLOSE_WAIT"),
3952 help=_("remote endpoint has shut down; the kernel is waiting "
3953 "for the application to close the socket"),
3954 elements=[
3955 Integer(title=_("Warning at"), label=_("connections")),
3956 Integer(title=_("Critical at"), label=_("connections"))
3957 ])),
3958 ("TIME_WAIT",
3959 Tuple(
3960 title=_("TIME_WAIT"),
3961 help=_("socket is waiting after closing for any packets left on the network"),
3962 elements=[
3963 Integer(title=_("Warning at"), label=_("connections")),
3964 Integer(title=_("Critical at"), label=_("connections"))
3965 ])),
3966 ("CLOSED",
3967 Tuple(
3968 title=_("CLOSED"),
3969 help=_("socket is not being used"),
3970 elements=[
3971 Integer(title=_("Warning at"), label=_("connections")),
3972 Integer(title=_("Critical at"), label=_("connections"))
3973 ])),
3974 ("CLOSING",
3975 Tuple(
3976 title=_("CLOSING"),
3977 help=_("our socket is shut down; remote endpoint is shut down; "
3978 "not all data has been sent"),
3979 elements=[
3980 Integer(title=_("Warning at"), label=_("connections")),
3981 Integer(title=_("Critical at"), label=_("connections"))
3982 ])),
3983 ("FIN_WAIT1",
3984 Tuple(
3985 title=_("FIN_WAIT1"),
3986 help=_("our socket has closed; we are in the process of "
3987 "tearing down the connection"),
3988 elements=[
3989 Integer(title=_("Warning at"), label=_("connections")),
3990 Integer(title=_("Critical at"), label=_("connections"))
3991 ])),
3992 ("FIN_WAIT2",
3993 Tuple(
3994 title=_("FIN_WAIT2"),
3995 help=_("the connection has been closed; our socket is waiting "
3996 "for the remote endpoint to shutdown"),
3997 elements=[
3998 Integer(title=_("Warning at"), label=_("connections")),
3999 Integer(title=_("Critical at"), label=_("connections"))
4000 ])),
4001 ("LISTEN",
4002 Tuple(
4003 title=_("LISTEN"),
4004 help=_("represents waiting for a connection request from any remote TCP and port"),
4005 elements=[
4006 Integer(title=_("Warning at"), label=_("connections")),
4007 Integer(title=_("Critical at"), label=_("connections"))
4008 ])),
4009 ("BOUND",
4010 Tuple(
4011 title=_("BOUND"),
4012 help=_("the socket has been created and an address assigned "
4013 "to with bind(). The TCP stack is not active yet. "
4014 "This state is only reported on Solaris."),
4015 elements=[
4016 Integer(title=_("Warning at"), label=_("connections")),
4017 Integer(title=_("Critical at"), label=_("connections"))
4018 ])),
4019 ("IDLE",
4020 Tuple(
4021 title=_("IDLE"),
4022 help=_("a TCP session that is active but that has no data being "
4023 "transmitted by either device for a prolonged period of time"),
4024 elements=[
4025 Integer(title=_("Warning at"), label=_("connections")),
4026 Integer(title=_("Critical at"), label=_("connections"))
4027 ])),
4029 None,
4030 match_type="dict",
4033 register_check_parameters(
4034 RulespecGroupCheckParametersNetworking,
4035 "tcp_connections",
4036 _("Monitor specific TCP/UDP connections and listeners"),
4037 Dictionary(
4038 help=_("This rule allows to monitor the existence of specific TCP connections or "
4039 "TCP/UDP listeners."),
4040 elements=[
4042 "proto",
4043 DropdownChoice(
4044 title=_("Protocol"),
4045 choices=[("TCP", _("TCP")), ("UDP", _("UDP"))],
4046 default_value="TCP",
4050 "state",
4051 DropdownChoice(
4052 title=_("State"),
4053 choices=[
4054 ("ESTABLISHED", "ESTABLISHED"),
4055 ("LISTENING", "LISTENING"),
4056 ("SYN_SENT", "SYN_SENT"),
4057 ("SYN_RECV", "SYN_RECV"),
4058 ("LAST_ACK", "LAST_ACK"),
4059 ("CLOSE_WAIT", "CLOSE_WAIT"),
4060 ("TIME_WAIT", "TIME_WAIT"),
4061 ("CLOSED", "CLOSED"),
4062 ("CLOSING", "CLOSING"),
4063 ("FIN_WAIT1", "FIN_WAIT1"),
4064 ("FIN_WAIT2", "FIN_WAIT2"),
4065 ("BOUND", "BOUND"),
4068 ("local_ip", IPv4Address(title=_("Local IP address"))),
4069 ("local_port", Integer(
4070 title=_("Local port number"),
4071 minvalue=1,
4072 maxvalue=65535,
4074 ("remote_ip", IPv4Address(title=_("Remote IP address"))),
4075 ("remote_port", Integer(
4076 title=_("Remote port number"),
4077 minvalue=1,
4078 maxvalue=65535,
4080 ("max_states",
4081 Tuple(
4082 title=_("Maximum number of connections or listeners"),
4083 elements=[
4084 Integer(title=_("Warning at")),
4085 Integer(title=_("Critical at")),
4088 ("min_states",
4089 Tuple(
4090 title=_("Minimum number of connections or listeners"),
4091 elements=[
4092 Integer(title=_("Warning if below")),
4093 Integer(title=_("Critical if below")),
4097 TextAscii(
4098 title=_("Connection name"),
4099 help=_("Specify an arbitrary name of this connection here"),
4100 allow_empty=False),
4101 "dict",
4102 has_inventory=False,
4105 register_check_parameters(
4106 RulespecGroupCheckParametersApplications,
4107 'msx_info_store',
4108 _("MS Exchange Information Store"),
4109 Dictionary(
4110 title=_("Set Levels"),
4111 elements=[('store_latency',
4112 Tuple(
4113 title=_("Average latency for store requests"),
4114 elements=[
4115 Float(title=_("Warning at"), unit=_('ms'), default_value=40.0),
4116 Float(title=_("Critical at"), unit=_('ms'), default_value=50.0)
4117 ])),
4118 ('clienttype_latency',
4119 Tuple(
4120 title=_("Average latency for client type requests"),
4121 elements=[
4122 Float(title=_("Warning at"), unit=_('ms'), default_value=40.0),
4123 Float(title=_("Critical at"), unit=_('ms'), default_value=50.0)
4124 ])),
4125 ('clienttype_requests',
4126 Tuple(
4127 title=_("Maximum number of client type requests per second"),
4128 elements=[
4129 Integer(title=_("Warning at"), unit=_('requests'), default_value=60),
4130 Integer(title=_("Critical at"), unit=_('requests'), default_value=70)
4131 ]))],
4132 optional_keys=[]),
4133 TextAscii(
4134 title=_("Store"),
4135 help=_("Specify the name of a store (This is either a mailbox or public folder)")),
4136 match_type='dict')
4138 register_check_parameters(
4139 RulespecGroupCheckParametersApplications,
4140 'msx_rpcclientaccess',
4141 _("MS Exchange RPC Client Access"),
4142 Dictionary(
4143 title=_("Set Levels"),
4144 elements=[('latency',
4145 Tuple(
4146 title=_("Average latency for RPC requests"),
4147 elements=[
4148 Float(title=_("Warning at"), unit=_('ms'), default_value=200.0),
4149 Float(title=_("Critical at"), unit=_('ms'), default_value=250.0)
4150 ])),
4151 ('requests',
4152 Tuple(
4153 title=_("Maximum number of RPC requests per second"),
4154 elements=[
4155 Integer(title=_("Warning at"), unit=_('requests'), default_value=30),
4156 Integer(title=_("Critical at"), unit=_('requests'), default_value=40)
4157 ]))],
4158 optional_keys=[]),
4159 None,
4160 match_type='dict')
4162 register_check_parameters(
4163 RulespecGroupCheckParametersApplications,
4164 'msx_database',
4165 _("MS Exchange Database"),
4166 Dictionary(
4167 title=_("Set Levels"),
4168 elements=[
4169 ('read_attached_latency',
4170 Tuple(
4171 title=_("I/O Database Reads (Attached) Average Latency"),
4172 elements=[
4173 Float(title=_("Warning at"), unit=_('ms'), default_value=200.0),
4174 Float(title=_("Critical at"), unit=_('ms'), default_value=250.0)
4175 ])),
4176 ('read_recovery_latency',
4177 Tuple(
4178 title=_("I/O Database Reads (Recovery) Average Latency"),
4179 elements=[
4180 Float(title=_("Warning at"), unit=_('ms'), default_value=150.0),
4181 Float(title=_("Critical at"), unit=_('ms'), default_value=200.0)
4182 ])),
4183 ('write_latency',
4184 Tuple(
4185 title=_("I/O Database Writes (Attached) Average Latency"),
4186 elements=[
4187 Float(title=_("Warning at"), unit=_('ms'), default_value=40.0),
4188 Float(title=_("Critical at"), unit=_('ms'), default_value=50.0)
4189 ])),
4190 ('log_latency',
4191 Tuple(
4192 title=_("I/O Log Writes Average Latency"),
4193 elements=[
4194 Float(title=_("Warning at"), unit=_('ms'), default_value=5.0),
4195 Float(title=_("Critical at"), unit=_('ms'), default_value=10.0)
4196 ])),
4198 optional_keys=[]),
4199 TextAscii(
4200 title=_("Database Name"),
4201 help=_("Specify database names that the rule should apply to"),
4203 match_type='dict')
4206 def transform_msx_queues(params):
4207 if isinstance(params, tuple):
4208 return {"levels": (params[0], params[1])}
4209 return params
4212 register_check_parameters(
4213 RulespecGroupCheckParametersApplications, "msx_queues", _("MS Exchange Message Queues"),
4214 Transform(
4215 Dictionary(
4216 title=_("Set Levels"),
4217 elements=[
4218 ('levels',
4219 Tuple(
4220 title=_("Maximum Number of E-Mails in Queue"),
4221 elements=[
4222 Integer(title=_("Warning at"), unit=_("E-Mails")),
4223 Integer(title=_("Critical at"), unit=_("E-Mails"))
4224 ])),
4225 ('offset',
4226 Integer(
4227 title=_("Offset"),
4228 help=
4229 _("Use this only if you want to overwrite the postion of the information in the agent "
4230 "output. Also refer to the rule <i>Microsoft Exchange Queues Discovery</i> "
4231 ))),
4233 optional_keys=["offset"],
4235 forth=transform_msx_queues,
4237 TextAscii(
4238 title=_("Explicit Queue Names"),
4239 help=_("Specify queue names that the rule should apply to"),
4240 ), "first")
4242 register_check_parameters(
4243 RulespecGroupCheckParametersApplications, "msexch_copyqueue", _("MS Exchange DAG CopyQueue"),
4244 Tuple(
4245 title=_("Upper Levels for CopyQueue Length"),
4246 help=_("This rule sets upper levels to the number of transaction logs waiting to be copied "
4247 "and inspected on your Exchange Mailbox Servers in a Database Availability Group "
4248 "(DAG). This is also known as the CopyQueue length."),
4249 elements=[Integer(title=_("Warning at")),
4250 Integer(title=_("Critical at"))],
4251 ), TextAscii(
4252 title=_("Database Name"),
4253 help=_("The database name on the Mailbox Server."),
4254 ), "first")
4256 register_check_parameters(RulespecGroupCheckParametersStorage, "mongodb_collections",
4257 _("MongoDB Collection Size"),
4258 Dictionary(elements=fs_levels_elements + size_trend_elements),
4259 TextAscii(title=_("Collection name"),), "dict")
4261 register_check_parameters(
4262 RulespecGroupCheckParametersStorage, "volume_groups", _("Volume Groups (LVM)"),
4263 Dictionary(
4264 elements=[
4265 ("levels",
4266 Alternative(
4267 title=_("Levels for volume group"),
4268 show_alternative_title=True,
4269 default_value=(80.0, 90.0),
4270 match=match_dual_level_type,
4271 elements=[
4272 get_free_used_dynamic_valuespec("used", "volume group"),
4273 Transform(
4274 get_free_used_dynamic_valuespec(
4275 "free", "volume group", default_value=(20.0, 10.0)),
4276 title=_("Levels for volume group free space"),
4277 allow_empty=False,
4278 forth=transform_filesystem_free,
4279 back=transform_filesystem_free)
4280 ])),
4282 optional_keys=False), TextAscii(title=_("Volume Group"), allow_empty=False), "dict")
4284 register_check_parameters(
4285 RulespecGroupCheckParametersStorage, "ibm_svc_mdiskgrp", _("IBM SVC Pool Capacity"),
4286 Dictionary(
4287 elements=filesystem_elements + [
4288 ("provisioning_levels",
4289 Tuple(
4290 title=_("Provisioning Levels"),
4291 help=_("A provisioning of over 100% means over provisioning."),
4292 elements=[
4293 Percentage(
4294 title=_("Warning at a provisioning of"),
4295 default_value=110.0,
4296 maxvalue=None),
4297 Percentage(
4298 title=_("Critical at a provisioning of"),
4299 default_value=120.0,
4300 maxvalue=None),
4301 ])),
4303 hidden_keys=["flex_levels"],
4304 ), TextAscii(title=_("Name of the pool"), allow_empty=False), "dict")
4306 register_check_parameters(
4307 RulespecGroupCheckParametersOperatingSystem,
4308 "sp_util",
4309 _("Storage Processor Utilization"),
4310 Tuple(
4311 title=_("Specify levels in percentage of storage processor usage"),
4312 elements=[
4313 Percentage(title=_("Warning at"), default_value=50.0),
4314 Percentage(title=_("Critical at"), default_value=60.0),
4316 None,
4317 "first",
4320 register_check_parameters(
4321 RulespecGroupCheckParametersStorage, "esx_vsphere_datastores",
4322 _("ESX Datastores (used space and growth)"),
4323 Dictionary(
4324 elements=filesystem_elements + [
4325 ("provisioning_levels",
4326 Tuple(
4327 title=_("Provisioning Levels"),
4328 help=
4329 _("A provisioning of more than 100% is called "
4330 "over provisioning and can be a useful strategy for saving disk space. But you cannot guarantee "
4331 "any longer that every VM can really use all space that it was assigned. Here you can "
4332 "set levels for the maximum provisioning. A warning level of 150% will warn at 50% over provisioning."
4334 elements=[
4335 Percentage(
4336 title=_("Warning at a provisioning of"),
4337 maxvalue=None,
4338 default_value=120.0),
4339 Percentage(
4340 title=_("Critical at a provisioning of"),
4341 maxvalue=None,
4342 default_value=150.0),
4343 ])),
4345 hidden_keys=["flex_levels"],
4346 ), TextAscii(title=_("Datastore Name"), help=_("The name of the Datastore"), allow_empty=False),
4347 "dict")
4349 register_check_parameters(
4350 RulespecGroupCheckParametersStorage, "esx_hostystem_maintenance",
4351 _("ESX Hostsystem Maintenance Mode"),
4352 Dictionary(
4353 elements=[
4354 ("target_state",
4355 DropdownChoice(
4356 title=_("Target State"),
4357 help=_("Configure the target mode for the system."),
4358 choices=[
4359 ('true', "System should be in Maintenance Mode"),
4360 ('false', "System not should be in Maintenance Mode"),
4361 ])),
4362 ],), None, "dict")
4364 register_check_parameters(
4365 RulespecGroupCheckParametersNetworking, "bonding", _("Status of Linux bonding interfaces"),
4366 Dictionary(elements=[
4367 ("expect_active",
4368 DropdownChoice(
4369 title=_("Warn on unexpected active interface"),
4370 choices=[
4371 ("ignore", _("ignore which one is active")),
4372 ("primary", _("require primary interface to be active")),
4373 ("lowest", _("require interface that sorts lowest alphabetically")),
4375 default_value="ignore",
4377 ("ieee_302_3ad_agg_id_missmatch_state",
4378 MonitoringState(
4379 title=_("State for missmatching Aggregator IDs for LACP"),
4380 default_state=1,
4382 ]), TextAscii(title=_("Name of the bonding interface"),), "dict")
4385 def vs_interface_traffic():
4386 def vs_abs_perc():
4387 return CascadingDropdown(
4388 orientation="horizontal",
4389 choices=[("perc", _("Percentual levels (in relation to port speed)"),
4390 Tuple(
4391 orientation="float",
4392 show_titles=False,
4393 elements=[
4394 Percentage(label=_("Warning at")),
4395 Percentage(label=_("Critical at")),
4396 ])),
4397 ("abs", _("Absolute levels in bits or bytes per second"),
4398 Tuple(
4399 orientation="float",
4400 show_titles=False,
4401 elements=[
4402 Integer(label=_("Warning at")),
4403 Integer(label=_("Critical at")),
4404 ])), ("predictive", _("Predictive Levels"), PredictiveLevels())])
4406 return CascadingDropdown(
4407 orientation="horizontal",
4408 choices=[
4409 ("upper", _("Upper"), vs_abs_perc()),
4410 ("lower", _("Lower"), vs_abs_perc()),
4414 def transform_if(v):
4415 new_traffic = []
4417 if 'traffic' in v and not isinstance(v['traffic'], list):
4418 warn, crit = v['traffic']
4419 if isinstance(warn, int):
4420 new_traffic.append(('both', ('upper', ('abs', (warn, crit)))))
4421 elif isinstance(warn, float):
4422 new_traffic.append(('both', ('upper', ('perc', (warn, crit)))))
4424 if 'traffic_minimum' in v:
4425 warn, crit = v['traffic_minimum']
4426 if isinstance(warn, int):
4427 new_traffic.append(('both', ('lower', ('abs', (warn, crit)))))
4428 elif isinstance(warn, float):
4429 new_traffic.append(('both', ('lower', ('perc', (warn, crit)))))
4430 del v['traffic_minimum']
4432 if new_traffic:
4433 v['traffic'] = new_traffic
4435 return v
4438 register_check_parameters(
4439 RulespecGroupCheckParametersNetworking,
4440 "if",
4441 _("Network interfaces and switch ports"),
4442 # Transform old traffic related levels which used "traffic" and "traffic_minimum"
4443 # keys where each was configured with an Alternative valuespec
4444 Transform(
4445 Dictionary(
4446 ignored_keys=["aggregate"], # Created by discovery when using interface grouping
4447 elements=[
4448 ("errors",
4449 Alternative(
4450 title=_("Levels for error rates"),
4451 help=
4452 _("These levels make the check go warning or critical whenever the "
4453 "<b>percentual error rate</b> or the <b>absolute error rate</b> of the monitored interface reaches "
4454 "the given bounds. The percentual error rate is computed by dividing number of "
4455 "errors by the total number of packets (successful plus errors)."),
4456 elements=[
4457 Tuple(
4458 title=_("Percentual levels for error rates"),
4459 elements=[
4460 Percentage(
4461 title=_("Warning at"),
4462 unit=_("percent errors"),
4463 default_value=0.01,
4464 display_format='%.3f'),
4465 Percentage(
4466 title=_("Critical at"),
4467 unit=_("percent errors"),
4468 default_value=0.1,
4469 display_format='%.3f')
4471 Tuple(
4472 title=_("Absolute levels for error rates"),
4473 elements=[
4474 Integer(title=_("Warning at"), unit=_("errors")),
4475 Integer(title=_("Critical at"), unit=_("errors"))
4477 ])),
4478 ("speed",
4479 OptionalDropdownChoice(
4480 title=_("Operating speed"),
4481 help=_("If you use this parameter then the check goes warning if the "
4482 "interface is not operating at the expected speed (e.g. it "
4483 "is working with 100Mbit/s instead of 1Gbit/s.<b>Note:</b> "
4484 "some interfaces do not provide speed information. In such cases "
4485 "this setting is used as the assumed speed when it comes to "
4486 "traffic monitoring (see below)."),
4487 choices=[
4488 (None, _("ignore speed")),
4489 (10000000, "10 Mbit/s"),
4490 (100000000, "100 Mbit/s"),
4491 (1000000000, "1 Gbit/s"),
4492 (10000000000, "10 Gbit/s"),
4494 otherlabel=_("specify manually ->"),
4495 explicit=Integer(
4496 title=_("Other speed in bits per second"), label=_("Bits per second")))),
4497 ("state",
4498 Optional(
4499 ListChoice(
4500 title=_("Allowed states:"), choices=defines.interface_oper_states()),
4501 title=_("Operational state"),
4502 help=
4503 _("If you activate the monitoring of the operational state (<tt>ifOperStatus</tt>) "
4504 "the check will get warning or critical if the current state "
4505 "of the interface does not match one of the expected states. Note: the status 9 (<i>admin down</i>) "
4506 "is only visible if you activate this status during switch port inventory or if you manually "
4507 "use the check plugin <tt>if64adm</tt> instead of <tt>if64</tt>."),
4508 label=_("Ignore the operational state"),
4509 none_label=_("ignore"),
4510 negate=True)),
4511 ("map_operstates",
4512 ListOf(
4513 Tuple(
4514 orientation="horizontal",
4515 elements=[
4516 DropdownChoice(choices=defines.interface_oper_states()),
4517 MonitoringState()
4519 title=_('Map operational states'),
4521 ("assumed_speed_in",
4522 OptionalDropdownChoice(
4523 title=_("Assumed input speed"),
4524 help=_(
4525 "If the automatic detection of the link speed does not work "
4526 "or the switch's capabilities are throttled because of the network setup "
4527 "you can set the assumed speed here."),
4528 choices=[
4529 (None, _("ignore speed")),
4530 (10000000, "10 Mbit/s"),
4531 (100000000, "100 Mbit/s"),
4532 (1000000000, "1 Gbit/s"),
4533 (10000000000, "10 Gbit/s"),
4535 otherlabel=_("specify manually ->"),
4536 default_value=16000000,
4537 explicit=Integer(
4538 title=_("Other speed in bits per second"),
4539 label=_("Bits per second"),
4540 size=10))),
4541 ("assumed_speed_out",
4542 OptionalDropdownChoice(
4543 title=_("Assumed output speed"),
4544 help=_(
4545 "If the automatic detection of the link speed does not work "
4546 "or the switch's capabilities are throttled because of the network setup "
4547 "you can set the assumed speed here."),
4548 choices=[
4549 (None, _("ignore speed")),
4550 (10000000, "10 Mbit/s"),
4551 (100000000, "100 Mbit/s"),
4552 (1000000000, "1 Gbit/s"),
4553 (10000000000, "10 Gbit/s"),
4555 otherlabel=_("specify manually ->"),
4556 default_value=1500000,
4557 explicit=Integer(
4558 title=_("Other speed in bits per second"),
4559 label=_("Bits per second"),
4560 size=12))),
4561 ("unit",
4562 RadioChoice(
4563 title=_("Measurement unit"),
4564 help=_("Here you can specifiy the measurement unit of the network interface"),
4565 default_value="byte",
4566 choices=[
4567 ("bit", _("Bits")),
4568 ("byte", _("Bytes")),
4571 ("infotext_format",
4572 DropdownChoice(
4573 title=_("Change infotext in check output"),
4574 help=
4575 _("This setting allows you to modify the information text which is displayed between "
4576 "the two brackets in the check output. Please note that this setting does not work for "
4577 "grouped interfaces, since the additional information of grouped interfaces is different"
4579 choices=[
4580 ("alias", _("Show alias")),
4581 ("description", _("Show description")),
4582 ("alias_and_description", _("Show alias and description")),
4583 ("alias_or_description", _("Show alias if set, else description")),
4584 ("desription_or_alias", _("Show description if set, else alias")),
4585 ("hide", _("Hide infotext")),
4586 ])),
4587 ("traffic",
4588 ListOf(
4589 CascadingDropdown(
4590 title=_("Direction"),
4591 orientation="horizontal",
4592 choices=[
4593 ('both', _("In / Out"), vs_interface_traffic()),
4594 ('in', _("In"), vs_interface_traffic()),
4595 ('out', _("Out"), vs_interface_traffic()),
4597 title=_("Used bandwidth (minimum or maximum traffic)"),
4598 help=_("Setting levels on the used bandwidth is optional. If you do set "
4599 "levels you might also consider using averaging."),
4602 "nucasts",
4603 Tuple(
4604 title=_("Non-unicast packet rates"),
4605 help=_(
4606 "Setting levels on non-unicast packet rates is optional. This may help "
4607 "to detect broadcast storms and other unwanted traffic."),
4608 elements=[
4609 Integer(title=_("Warning at"), unit=_("pkts / sec")),
4610 Integer(title=_("Critical at"), unit=_("pkts / sec")),
4613 ("discards",
4614 Tuple(
4615 title=_("Absolute levels for discards rates"),
4616 elements=[
4617 Integer(title=_("Warning at"), unit=_("discards")),
4618 Integer(title=_("Critical at"), unit=_("discards"))
4619 ])),
4620 ("average",
4621 Integer(
4622 title=_("Average values"),
4623 help=_("By activating the computation of averages, the levels on "
4624 "errors and traffic are applied to the averaged value. That "
4625 "way you can make the check react only on long-time changes, "
4626 "not on one-minute events."),
4627 unit=_("minutes"),
4628 minvalue=1,
4629 default_value=15,
4632 forth=transform_if,
4634 TextAscii(title=_("port specification"), allow_empty=False),
4635 "dict",
4638 register_check_parameters(
4639 RulespecGroupCheckParametersNetworking,
4640 "fcp",
4641 _("Fibrechannel Interfaces"),
4642 Dictionary(elements=[
4643 ("speed",
4644 OptionalDropdownChoice(
4645 title=_("Operating speed"),
4646 help=_("If you use this parameter then the check goes warning if the "
4647 "interface is not operating at the expected speed (e.g. it "
4648 "is working with 8Gbit/s instead of 16Gbit/s)."),
4649 choices=[
4650 (None, _("ignore speed")),
4651 (4000000000, "4 Gbit/s"),
4652 (8000000000, "8 Gbit/s"),
4653 (16000000000, "16 Gbit/s"),
4655 otherlabel=_("specify manually ->"),
4656 explicit=Integer(
4657 title=_("Other speed in bits per second"), label=_("Bits per second")))),
4658 ("traffic",
4659 ListOf(
4660 CascadingDropdown(
4661 title=_("Direction"),
4662 orientation="horizontal",
4663 choices=[
4664 ('both', _("In / Out"), vs_interface_traffic()),
4665 ('in', _("In"), vs_interface_traffic()),
4666 ('out', _("Out"), vs_interface_traffic()),
4668 title=_("Used bandwidth (minimum or maximum traffic)"),
4669 help=_("Setting levels on the used bandwidth is optional. If you do set "
4670 "levels you might also consider using averaging."),
4672 ("read_latency",
4673 Levels(
4674 title=_("Read latency"),
4675 unit=_("ms"),
4676 default_value=None,
4677 default_levels=(50.0, 100.0))),
4678 ("write_latency",
4679 Levels(
4680 title=_("Write latency"),
4681 unit=_("ms"),
4682 default_value=None,
4683 default_levels=(50.0, 100.0))),
4684 ("latency",
4685 Levels(
4686 title=_("Overall latency"),
4687 unit=_("ms"),
4688 default_value=None,
4689 default_levels=(50.0, 100.0))),
4691 TextAscii(title=_("Port specification"), allow_empty=False),
4692 "dict",
4695 register_check_parameters(
4696 RulespecGroupCheckParametersNetworking,
4697 "signal_quality",
4698 _("Signal quality of Wireless device"),
4699 Tuple(elements=[
4700 Percentage(title=_("Warning if under"), maxvalue=100),
4701 Percentage(title=_("Critical if under"), maxvalue=100),
4703 TextAscii(title=_("Network specification"), allow_empty=True),
4704 "first",
4707 register_check_parameters(
4708 RulespecGroupCheckParametersNetworking,
4709 "cisco_ip_sla",
4710 _("Cisco IP SLA"),
4711 Dictionary(elements=[
4712 ("rtt_type",
4713 DropdownChoice(
4714 title=_("RTT type"),
4715 choices=[
4716 ('echo', _("echo")),
4717 ('path echo', _("path echo")),
4718 ('file IO', _("file IO")),
4719 ('UDP echo', _("UDP echo")),
4720 ('TCP connect', _("TCP connect")),
4721 ('HTTP', _("HTTP")),
4722 ('DNS', _("DNS")),
4723 ('jitter', _("jitter")),
4724 ('DLSw', _("DLSw")),
4725 ('DHCP', _("DHCP")),
4726 ('FTP', _("FTP")),
4727 ('VoIP', _("VoIP")),
4728 ('RTP', _("RTP")),
4729 ('LSP group', _("LSP group")),
4730 ('ICMP jitter', _("ICMP jitter")),
4731 ('LSP ping', _("LSP ping")),
4732 ('LSP trace', _("LSP trace")),
4733 ('ethernet ping', _("ethernet ping")),
4734 ('ethernet jitter', _("ethernet jitter")),
4735 ('LSP ping pseudowire', _("LSP ping pseudowire")),
4737 default_value="echo",
4739 ("threshold",
4740 Integer(
4741 title=_("Treshold"),
4742 help=_("Depending on the precision the unit can be "
4743 "either milliseconds or micoseconds."),
4744 unit=_("ms/us"),
4745 minvalue=1,
4746 default_value=5000,
4748 ("state",
4749 DropdownChoice(
4750 title=_("State"),
4751 choices=[
4752 ('active', _("active")),
4753 ('inactive', _("inactive")),
4754 ('reset', _("reset")),
4755 ('orderly stop', _("orderly stop")),
4756 ('immediate stop', _("immediate stop")),
4757 ('pending', _("pending")),
4758 ('restart', _("restart")),
4760 default_value="active",
4762 ("connection_lost_occured",
4763 DropdownChoice(
4764 title=_("Connection lost occured"),
4765 choices=[
4766 ("yes", _("yes")),
4767 ("no", _("no")),
4769 default_value="no",
4771 ("timeout_occured",
4772 DropdownChoice(
4773 title=_("Timeout occured"),
4774 choices=[
4775 ("yes", _("yes")),
4776 ("no", _("no")),
4778 default_value="no",
4780 ("completion_time_over_treshold_occured",
4781 DropdownChoice(
4782 title=_("Completion time over treshold occured"),
4783 choices=[
4784 ("yes", _("yes")),
4785 ("no", _("no")),
4787 default_value="no",
4789 ("latest_rtt_completion_time",
4790 Tuple(
4791 title=_("Latest RTT completion time"),
4792 help=_("Depending on the precision the unit can be "
4793 "either milliseconds or micoseconds."),
4794 elements=[
4795 Integer(
4796 title=_("Warning at"),
4797 unit=_("ms/us"),
4798 minvalue=1,
4799 default_value=100,
4801 Integer(
4802 title=_("Critical at"),
4803 unit=_("ms/us"),
4804 minvalue=1,
4805 default_value=200,
4807 ])),
4808 ("latest_rtt_state",
4809 DropdownChoice(
4810 title=_("Latest RTT state"),
4811 choices=[
4812 ('ok', _("OK")),
4813 ('disconnected', _("disconnected")),
4814 ('over treshold', _("over treshold")),
4815 ('timeout', _("timeout")),
4816 ('other', _("other")),
4818 default_value="ok",
4821 TextAscii(
4822 title=_("RTT row index of the service"),
4823 allow_empty=True,
4825 "dict",
4828 register_check_parameters(
4829 RulespecGroupCheckParametersNetworking,
4830 "cisco_qos",
4831 _("Cisco quality of service"),
4832 Dictionary(elements=[
4833 ("unit",
4834 RadioChoice(
4835 title=_("Measurement unit"),
4836 help=_("Here you can specifiy the measurement unit of the network interface"),
4837 default_value="bit",
4838 choices=[
4839 ("bit", _("Bits")),
4840 ("byte", _("Bytes")),
4843 ("post",
4844 Alternative(
4845 title=_("Used bandwidth (traffic)"),
4846 help=_("Settings levels on the used bandwidth is optional. If you do set "
4847 "levels you might also consider using averaging."),
4848 elements=[
4849 Tuple(
4850 title=_("Percentual levels (in relation to policy speed)"),
4851 elements=[
4852 Percentage(
4853 title=_("Warning at"), maxvalue=1000, label=_("% of port speed")),
4854 Percentage(
4855 title=_("Critical at"), maxvalue=1000, label=_("% of port speed")),
4857 Tuple(
4858 title=_("Absolute levels in bits or bytes per second"),
4859 help=
4860 _("Depending on the measurement unit (defaults to bit) the absolute levels are set in bit or byte"
4862 elements=[
4863 Integer(
4864 title=_("Warning at"), size=10, label=_("bits / bytes per second")),
4865 Integer(
4866 title=_("Critical at"), size=10, label=_("bits / bytes per second")),
4868 ])),
4869 ("average",
4870 Integer(
4871 title=_("Average values"),
4872 help=_("By activating the computation of averages, the levels on "
4873 "errors and traffic are applied to the averaged value. That "
4874 "way you can make the check react only on long-time changes, "
4875 "not on one-minute events."),
4876 unit=_("minutes"),
4877 minvalue=1,
4879 ("drop",
4880 Alternative(
4881 title=_("Number of dropped bits or bytes per second"),
4882 help=_(
4883 "Depending on the measurement unit (defaults to bit) you can set the warn and crit "
4884 "levels for the number of dropped bits or bytes"),
4885 elements=[
4886 Tuple(
4887 title=_("Percentual levels (in relation to policy speed)"),
4888 elements=[
4889 Percentage(
4890 title=_("Warning at"), maxvalue=1000, label=_("% of port speed")),
4891 Percentage(
4892 title=_("Critical at"), maxvalue=1000, label=_("% of port speed")),
4894 Tuple(elements=[
4895 Integer(title=_("Warning at"), size=8, label=_("bits / bytes per second")),
4896 Integer(title=_("Critical at"), size=8, label=_("bits / bytes per second")),
4898 ])),
4900 TextAscii(title=_("port specification"), allow_empty=False),
4901 "dict",
4904 register_check_parameters(
4905 RulespecGroupCheckParametersOperatingSystem, "innovaphone_mem", _("Innovaphone Memory Usage"),
4906 Tuple(
4907 title=_("Specify levels in percentage of total RAM"),
4908 elements=[
4909 Percentage(title=_("Warning at a usage of"), unit=_("% of RAM")),
4910 Percentage(title=_("Critical at a usage of"), unit=_("% of RAM")),
4911 ]), None, "first")
4913 register_check_parameters(
4914 RulespecGroupCheckParametersOperatingSystem, "mem_pages", _("Memory Pages Statistics"),
4915 Dictionary(elements=[(
4916 "pages_per_second",
4917 Tuple(
4918 title=_("Pages per second"),
4919 elements=[
4920 Integer(title=_("Warning at"), unit=_("pages/s")),
4921 Integer(title=_("Critical at"), unit=_("pages/s")),
4923 )]), None, "dict")
4925 register_check_parameters(
4926 RulespecGroupCheckParametersOperatingSystem,
4927 "statgrab_mem",
4928 _("Statgrab Memory Usage"),
4929 Alternative(elements=[
4930 Tuple(
4931 title=_("Specify levels in percentage of total RAM"),
4932 elements=[
4933 Percentage(title=_("Warning at a usage of"), unit=_("% of RAM"), maxvalue=None),
4934 Percentage(title=_("Critical at a usage of"), unit=_("% of RAM"), maxvalue=None)
4936 Tuple(
4937 title=_("Specify levels in absolute usage values"),
4938 elements=[
4939 Integer(title=_("Warning at"), unit=_("MB")),
4940 Integer(title=_("Critical at"), unit=_("MB"))
4943 None,
4944 "first",
4945 deprecated=True,
4948 register_check_parameters(
4949 RulespecGroupCheckParametersOperatingSystem,
4950 "cisco_mem",
4951 _("Cisco Memory Usage"),
4952 Transform(
4953 Dictionary(elements=[
4954 ("levels",
4955 Alternative(
4956 title=_("Levels for memory usage"),
4957 elements=[
4958 Tuple(
4959 title=_("Specify levels in percentage of total RAM"),
4960 elements=[
4961 Percentage(
4962 title=_("Warning at a usage of"),
4963 unit=_("% of RAM"),
4964 maxvalue=None),
4965 Percentage(
4966 title=_("Critical at a usage of"),
4967 unit=_("% of RAM"),
4968 maxvalue=None)
4970 Tuple(
4971 title=_("Specify levels in absolute usage values"),
4972 elements=[
4973 Integer(title=_("Warning at"), unit=_("MB")),
4974 Integer(title=_("Critical at"), unit=_("MB"))
4976 ])),
4977 ] + size_trend_elements),
4978 forth=lambda spec: spec if isinstance(spec, dict) else {"levels": spec},
4980 TextAscii(title=_("Memory Pool Name"), allow_empty=False),
4981 match_type="first",
4984 register_check_parameters(
4985 RulespecGroupCheckParametersOperatingSystem, "juniper_mem", _("Juniper Memory Usage"),
4986 Tuple(
4987 title=_("Specify levels in percentage of total memory usage"),
4988 elements=[
4989 Percentage(
4990 title=_("Warning at a usage of"),
4991 unit=_("% of RAM"),
4992 default_value=80.0,
4993 maxvalue=100.0),
4994 Percentage(
4995 title=_("Critical at a usage of"),
4996 unit=_("% of RAM"),
4997 default_value=90.0,
4998 maxvalue=100.0)
4999 ]), None, "first")
5001 # TODO: Remove situations where a rule is used once with and once without items
5002 register_check_parameters(
5003 RulespecGroupCheckParametersOperatingSystem,
5004 "juniper_mem_modules",
5005 _("Juniper Modules Memory Usage"),
5006 Tuple(
5007 title=_("Specify levels in percentage of total memory usage"),
5008 elements=[
5009 Percentage(
5010 title=_("Warning at a usage of"),
5011 unit=_("% of RAM"),
5012 default_value=80.0,
5013 maxvalue=100.0),
5014 Percentage(
5015 title=_("Critical at a usage of"),
5016 unit=_("% of RAM"),
5017 default_value=90.0,
5018 maxvalue=100.0)
5020 TextAscii(
5021 title=_("Module Name"),
5022 help=_("The identificator of the module."),
5024 "first",
5027 register_check_parameters(
5028 RulespecGroupCheckParametersOperatingSystem,
5029 "juniper_cpu_util",
5030 _("Juniper Processor Utilization of Routing Engine"),
5031 Transform(
5032 Dictionary(
5033 help=_("CPU utilization of routing engine."),
5034 optional_keys=[],
5035 elements=[
5037 "levels",
5038 Tuple(
5039 title=_("Specify levels in percentage of processor routing engine usage"),
5040 elements=[
5041 Percentage(title=_("Warning at"), default_value=80.0),
5042 Percentage(title=_("Critical at"), default_value=90.0),
5047 forth=lambda old: not old and {'levels': (80.0, 90.0)} or old,
5049 TextAscii(title=_("Routing Engine"),),
5050 "dict",
5053 register_check_parameters(
5054 RulespecGroupCheckParametersOperatingSystem, "netscaler_mem", _("Netscaler Memory Usage"),
5055 Tuple(
5056 title=_("Specify levels in percentage of total memory usage"),
5057 elements=[
5058 Percentage(
5059 title=_("Warning at a usage of"),
5060 unit=_("% of RAM"),
5061 default_value=80.0,
5062 maxvalue=100.0),
5063 Percentage(
5064 title=_("Critical at a usage of"),
5065 unit=_("% of RAM"),
5066 default_value=90.0,
5067 maxvalue=100.0)
5068 ]), None, "first")
5070 register_check_parameters(
5071 RulespecGroupCheckParametersOperatingSystem, "netscaler_vserver", _("Netscaler VServer States"),
5072 Dictionary(elements=[
5073 ("health_levels",
5074 Tuple(
5075 title=_("Lower health levels"),
5076 elements=[
5077 Percentage(title=_("Warning below"), default_value=100.0),
5078 Percentage(title=_("Critical below"), default_value=0.1),
5079 ])),
5080 ]), TextAscii(title=_("Name of VServer")), "dict")
5082 register_check_parameters(
5083 RulespecGroupCheckParametersOperatingSystem,
5084 "general_flash_usage",
5085 _("Flash Space Usage"),
5086 Alternative(elements=[
5087 Tuple(
5088 title=_("Specify levels in percentage of total Flash"),
5089 elements=[
5090 Percentage(title=_("Warning at a usage of"), label=_("% of Flash"), maxvalue=None),
5091 Percentage(title=_("Critical at a usage of"), label=_("% of Flash"), maxvalue=None)
5093 Tuple(
5094 title=_("Specify levels in absolute usage values"),
5095 elements=[
5096 Integer(title=_("Warning at"), unit=_("MB")),
5097 Integer(title=_("Critical at"), unit=_("MB"))
5100 None,
5101 match_type="first",
5104 register_check_parameters(
5105 RulespecGroupCheckParametersOperatingSystem,
5106 "cisco_supervisor_mem",
5107 _("Cisco Nexus Supervisor Memory Usage"),
5108 Tuple(
5109 title=_("The average utilization of memory on the active supervisor"),
5110 elements=[
5111 Percentage(title=_("Warning at a usage of"), default_value=80.0, maxvalue=100.0),
5112 Percentage(title=_("Critical at a usage of"), default_value=90.0, maxvalue=100.0)
5114 None,
5115 match_type="first",
5119 def UsedSize(**args):
5120 GB = 1024 * 1024 * 1024
5121 return Tuple(
5122 elements=[
5123 Filesize(title=_("Warning at"), default_value=1 * GB),
5124 Filesize(title=_("Critical at"), default_value=2 * GB),
5126 **args)
5129 def FreeSize(**args):
5130 GB = 1024 * 1024 * 1024
5131 return Tuple(
5132 elements=[
5133 Filesize(title=_("Warning below"), default_value=2 * GB),
5134 Filesize(title=_("Critical below"), default_value=1 * GB),
5136 **args)
5139 def UsedPercentage(default_percents=None, of_what=None):
5140 if of_what:
5141 unit = _("%% of %s") % of_what
5142 maxvalue = None
5143 else:
5144 unit = "%"
5145 maxvalue = 101.0
5146 return Tuple(elements=[
5147 Percentage(
5148 title=_("Warning at"),
5149 default_value=default_percents and default_percents[0] or 80.0,
5150 unit=unit,
5151 maxvalue=maxvalue,
5153 Percentage(
5154 title=_("Critical at"),
5155 default_value=default_percents and default_percents[1] or 90.0,
5156 unit=unit,
5157 maxvalue=maxvalue),
5161 def FreePercentage(default_percents=None, of_what=None):
5162 if of_what:
5163 unit = _("%% of %s") % of_what
5164 else:
5165 unit = "%"
5166 return Tuple(elements=[
5167 Percentage(
5168 title=_("Warning below"),
5169 default_value=default_percents and default_percents[0] or 20.0,
5170 unit=unit),
5171 Percentage(
5172 title=_("Critical below"),
5173 default_value=default_percents and default_percents[1] or 10.0,
5174 unit=unit),
5178 def DualMemoryLevels(what, default_percents=None):
5179 return CascadingDropdown(
5180 title=_("Levels for %s") % what,
5181 choices=[
5182 ("perc_used", _("Percentual levels for used %s") % what,
5183 UsedPercentage(default_percents)),
5184 ("perc_free", _("Percentual levels for free %s") % what, FreePercentage()),
5185 ("abs_used", _("Absolute levels for used %s") % what, UsedSize()),
5186 ("abs_free", _("Absolute levels for free %s") % what, FreeSize()),
5187 # PredictiveMemoryChoice(_("used %s") % what), # not yet implemented
5188 ("ignore", _("Do not impose levels")),
5192 def UpperMemoryLevels(what, default_percents=None, of_what=None):
5193 return CascadingDropdown(
5194 title=_("Upper levels for %s") % what,
5195 choices=[
5196 ("perc_used", _("Percentual levels%s") % (of_what and
5197 (_(" in relation to %s") % of_what) or ""),
5198 UsedPercentage(default_percents, of_what)),
5199 ("abs_used", _("Absolute levels"), UsedSize()),
5200 # PredictiveMemoryChoice(what), # not yet implemented
5201 ("ignore", _("Do not impose levels")),
5205 def LowerMemoryLevels(what, default_percents=None, of_what=None, help_text=None):
5206 return CascadingDropdown(
5207 title=_("Lower levels for %s") % what,
5208 help=help_text,
5209 choices=[
5210 ("perc_free", _("Percentual levels"), FreePercentage(default_percents, of_what)),
5211 ("abs_free", _("Absolute levels"), FreeSize()),
5212 # PredictiveMemoryChoice(what), # not yet implemented
5213 ("ignore", _("Do not impose levels")),
5217 # Beware: This is not yet implemented in the check.
5218 # def PredictiveMemoryChoice(what):
5219 # return ( "predictive", _("Predictive levels for %s") % what,
5220 # PredictiveLevels(
5221 # unit = _("GB"),
5222 # default_difference = (0.5, 1.0)
5223 # ))
5225 register_check_parameters(
5226 RulespecGroupCheckParametersOperatingSystem,
5227 "memory_linux",
5228 _("Memory and Swap usage on Linux"),
5229 Dictionary(
5230 elements=[
5231 ("levels_ram", DualMemoryLevels(_("RAM"))),
5232 ("levels_swap", DualMemoryLevels(_("Swap"))),
5233 ("levels_virtual", DualMemoryLevels(_("Total virtual memory"), (80.0, 90.0))),
5234 ("levels_total",
5235 UpperMemoryLevels(_("Total Data in relation to RAM"), (120.0, 150.0), _("RAM"))),
5236 ("levels_shm", UpperMemoryLevels(_("Shared memory"), (20.0, 30.0), _("RAM"))),
5237 ("levels_pagetables", UpperMemoryLevels(_("Page tables"), (8.0, 16.0), _("RAM"))),
5238 ("levels_writeback", UpperMemoryLevels(_("Disk Writeback"))),
5239 ("levels_committed",
5240 UpperMemoryLevels(_("Committed memory"), (100.0, 150.0), _("RAM + Swap"))),
5241 ("levels_commitlimit",
5242 LowerMemoryLevels(_("Commit Limit"), (20.0, 10.0), _("RAM + Swap"))),
5243 ("levels_available",
5244 LowerMemoryLevels(
5245 _("Estimated RAM for new processes"), (20.0, 10.0), _("RAM"),
5246 _("If the host has a kernel of version 3.14 or newer, the information MemAvailable is provided: "
5247 "\"An estimate of how much memory is available for starting new "
5248 "applications, without swapping. Calculated from MemFree, "
5249 "SReclaimable, the size of the file LRU lists, and the low "
5250 "watermarks in each zone. "
5251 "The estimate takes into account that the system needs some "
5252 "page cache to function well, and that not all reclaimable "
5253 "slab will be reclaimable, due to items being in use. The "
5254 "impact of those factors will vary from system to system.\" "
5255 "(https://www.kernel.org/doc/Documentation/filesystems/proc.txt)"))),
5256 ("levels_vmalloc", LowerMemoryLevels(_("Largest Free VMalloc Chunk"))),
5257 ("handle_hw_corrupted_error",
5258 MonitoringState(
5259 title=_("Handle Hardware Corrupted Error"),
5260 default_value=2,
5262 ],),
5263 None,
5264 "dict",
5267 register_check_parameters(
5268 RulespecGroupCheckParametersOperatingSystem,
5269 "memory",
5270 _("Main memory usage (UNIX / Other Devices)"),
5271 Transform(
5272 Dictionary(
5273 elements=[
5275 "levels",
5276 Alternative(
5277 title=_("Levels for memory"),
5278 show_alternative_title=True,
5279 default_value=(150.0, 200.0),
5280 match=match_dual_level_type,
5281 help=
5282 _("The used and free levels for the memory on UNIX systems take into account the "
5283 "currently used memory (RAM or SWAP) by all processes and sets this in relation "
5284 "to the total RAM of the system. This means that the memory usage can exceed 100%. "
5285 "A usage of 200% means that the total size of all processes is twice as large as "
5286 "the main memory, so <b>at least</b> half of it is currently swapped out. For systems "
5287 "without Swap space you should choose levels below 100%."),
5288 elements=[
5289 Alternative(
5290 title=_("Levels for used memory"),
5291 style="dropdown",
5292 elements=[
5293 Tuple(
5294 title=_("Specify levels in percentage of total RAM"),
5295 elements=[
5296 Percentage(
5297 title=_("Warning at a usage of"), maxvalue=None),
5298 Percentage(
5299 title=_("Critical at a usage of"), maxvalue=None)
5301 Tuple(
5302 title=_("Specify levels in absolute values"),
5303 elements=[
5304 Integer(title=_("Warning at"), unit=_("MB")),
5305 Integer(title=_("Critical at"), unit=_("MB"))
5308 Transform(
5309 Alternative(
5310 style="dropdown",
5311 elements=[
5312 Tuple(
5313 title=_("Specify levels in percentage of total RAM"),
5314 elements=[
5315 Percentage(
5316 title=_("Warning if less than"), maxvalue=None),
5317 Percentage(
5318 title=_("Critical if less than"), maxvalue=None)
5320 Tuple(
5321 title=_("Specify levels in absolute values"),
5322 elements=[
5323 Integer(title=_("Warning if below"), unit=_("MB")),
5324 Integer(title=_("Critical if below"), unit=_("MB"))
5327 title=_("Levels for free memory"),
5328 help=
5329 _("Keep in mind that if you have 1GB RAM and 1GB SWAP you need to "
5330 "specify 120% or 1200MB to get an alert if there is only 20% free RAM available. "
5331 "The free memory levels do not work with the fortigate check, because it does "
5332 "not provide total memory data."),
5333 allow_empty=False,
5334 forth=lambda val: tuple(-x for x in val),
5335 back=lambda val: tuple(-x for x in val))
5338 ("average",
5339 Integer(
5340 title=_("Averaging"),
5341 help=_("If this parameter is set, all measured values will be averaged "
5342 "over the specified time interval before levels are being applied. Per "
5343 "default, averaging is turned off."),
5344 unit=_("minutes"),
5345 minvalue=1,
5346 default_value=60,
5349 optional_keys=["average"],
5351 forth=lambda t: isinstance(t, tuple) and {"levels": t} or t,
5353 None,
5354 match_type="first",
5357 register_check_parameters(
5358 RulespecGroupCheckParametersOperatingSystem, "memory_relative",
5359 _("Main memory usage for Brocade fibre channel switches"),
5360 OptionalDropdownChoice(
5361 title=_("Memory usage"),
5362 choices=[(None, _("Do not impose levels"))],
5363 otherlabel=_("Percentual levels ->"),
5364 explicit=Tuple(elements=[
5365 Integer(title=_("Warning at"), default_value=85, unit="%"),
5366 Integer(title=_("Critical at"), default_value=90, unit="%"),
5367 ])), None, "first")
5369 register_check_parameters(
5370 RulespecGroupCheckParametersOperatingSystem,
5371 "memory_simple",
5372 _("Main memory usage of simple devices"),
5373 Transform(
5374 Dictionary(
5375 help=_("Memory levels for simple devices not running more complex OSs"),
5376 elements=[
5377 ("levels",
5378 CascadingDropdown(
5379 title=_("Levels for memory usage"),
5380 choices=[
5381 ("perc_used", _("Percentual levels for used memory"),
5382 Tuple(elements=[
5383 Percentage(
5384 title=_("Warning at a memory usage of"),
5385 default_value=80.0,
5386 maxvalue=None),
5387 Percentage(
5388 title=_("Critical at a memory usage of"),
5389 default_value=90.0,
5390 maxvalue=None)
5391 ])),
5392 ("abs_free", _("Absolute levels for free memory"),
5393 Tuple(elements=[
5394 Filesize(title=_("Warning below")),
5395 Filesize(title=_("Critical below"))
5396 ])),
5397 ("ignore", _("Do not impose levels")),
5398 ])),
5400 optional_keys=[],
5402 # Convert default levels from discovered checks
5403 forth=lambda v: not isinstance(v, dict) and {"levels": ("perc_used", v)} or v,
5405 TextAscii(
5406 title=_("Module name or empty"),
5407 help=_("Leave this empty for systems without modules, which just "
5408 "have one global memory usage."),
5409 allow_empty=True,
5411 "dict",
5414 register_check_parameters(
5415 RulespecGroupCheckParametersOperatingSystem,
5416 "memory_multiitem",
5417 _("Main memory usage of devices with modules"),
5418 Dictionary(
5419 help=_(
5420 "The memory levels for one specific module of this host. This is relevant for hosts that have "
5421 "several distinct memory areas, e.g. pluggable cards"),
5422 elements=[
5423 ("levels",
5424 Alternative(
5425 title=_("Memory levels"),
5426 elements=[
5427 Tuple(
5428 title=_("Specify levels in percentage of total RAM"),
5429 elements=[
5430 Percentage(
5431 title=_("Warning at a memory usage of"),
5432 default_value=80.0,
5433 maxvalue=None),
5434 Percentage(
5435 title=_("Critical at a memory usage of"),
5436 default_value=90.0,
5437 maxvalue=None)
5439 Tuple(
5440 title=_("Specify levels in absolute usage values"),
5441 elements=[
5442 Filesize(title=_("Warning at")),
5443 Filesize(title=_("Critical at"))
5445 ])),
5447 optional_keys=[]),
5448 TextAscii(title=_("Module name"), allow_empty=False),
5449 "dict",
5452 register_check_parameters(
5453 RulespecGroupCheckParametersOperatingSystem,
5454 "memory_arbor",
5455 _("Memory and Swap usage on Arbor devices"),
5456 Dictionary(
5457 elements=[
5458 ("levels_ram", DualMemoryLevels(_("RAM"))),
5459 ("levels_swap", DualMemoryLevels(_("Swap"))),
5460 ],),
5461 None,
5462 "dict",
5465 register_check_parameters(
5466 RulespecGroupCheckParametersNetworking, "mem_cluster", _("Memory Usage of Clusters"),
5467 ListOf(
5468 Tuple(elements=[
5469 Integer(title=_("Equal or more than"), unit=_("nodes")),
5470 Tuple(
5471 title=_("Percentage of total RAM"),
5472 elements=[
5473 Percentage(title=_("Warning at a RAM usage of"), default_value=80.0),
5474 Percentage(title=_("Critical at a RAM usage of"), default_value=90.0),
5477 help=_("Here you can specify the total memory usage levels for clustered hosts."),
5478 title=_("Memory Usage"),
5479 add_label=_("Add limits")), None, "first", False)
5481 register_check_parameters(
5482 RulespecGroupCheckParametersNetworking, "cpu_utilization_cluster",
5483 _("CPU Utilization of Clusters"),
5484 ListOf(
5485 Tuple(elements=[
5486 Integer(title=_("Equal or more than"), unit=_("nodes")),
5487 Tuple(
5488 elements=[
5489 Percentage(title=_("Warning at a utilization of"), default_value=90.0),
5490 Percentage(title=_("Critical at a utilization of"), default_value=95.0)
5492 title=_("Alert on too high CPU utilization"),
5495 help=_(
5496 "Configure levels for averaged CPU utilization depending on number of cluster nodes. "
5497 "The CPU utilization sums up the percentages of CPU time that is used "
5498 "for user processes and kernel routines over all available cores within "
5499 "the last check interval. The possible range is from 0% to 100%"),
5500 title=_("Memory Usage"),
5501 add_label=_("Add limits")), None, "first", False)
5503 register_check_parameters(
5504 RulespecGroupCheckParametersOperatingSystem,
5505 "esx_host_memory",
5506 _("Main memory usage of ESX host system"),
5507 Tuple(
5508 title=_("Specify levels in percentage of total RAM"),
5509 elements=[
5510 Percentage(title=_("Warning at a RAM usage of"), default_value=80.0),
5511 Percentage(title=_("Critical at a RAM usage of"), default_value=90.0),
5513 None,
5514 match_type="first",
5517 register_check_parameters(
5518 RulespecGroupCheckParametersOperatingSystem,
5519 "vm_guest_tools",
5520 _("Virtual machine (for example ESX) guest tools status"),
5521 Dictionary(
5522 optional_keys=False,
5523 elements=[
5524 ("guestToolsCurrent",
5525 MonitoringState(
5526 title=_("VMware Tools is installed, and the version is current"),
5527 default_value=0,
5529 ("guestToolsNeedUpgrade",
5530 MonitoringState(
5531 title=_("VMware Tools is installed, but the version is not current"),
5532 default_value=1,
5534 ("guestToolsNotInstalled",
5535 MonitoringState(
5536 title=_("VMware Tools have never been installed"),
5537 default_value=2,
5539 ("guestToolsUnmanaged",
5540 MonitoringState(
5541 title=_("VMware Tools is installed, but it is not managed by VMWare"),
5542 default_value=1,
5545 None,
5546 "dict",
5548 register_check_parameters(
5549 RulespecGroupCheckParametersOperatingSystem,
5550 "vm_heartbeat",
5551 _("Virtual machine (for example ESX) heartbeat status"),
5552 Dictionary(
5553 optional_keys=False,
5554 elements=[
5555 ("heartbeat_missing",
5556 MonitoringState(
5557 title=_("No heartbeat"),
5558 help=_("Guest operating system may have stopped responding."),
5559 default_value=2,
5561 ("heartbeat_intermittend",
5562 MonitoringState(
5563 title=_("Intermittent heartbeat"),
5564 help=_("May be due to high guest load."),
5565 default_value=1,
5567 ("heartbeat_no_tools",
5568 MonitoringState(
5569 title=_("Heartbeat tools missing or not installed"),
5570 help=_("No VMWare Tools installed."),
5571 default_value=1,
5573 ("heartbeat_ok",
5574 MonitoringState(
5575 title=_("Heartbeat OK"),
5576 help=_("Guest operating system is responding normally."),
5577 default_value=0,
5580 None,
5581 "dict",
5584 register_check_parameters(
5585 RulespecGroupCheckParametersApplications, "services_summary", _("Windows Service Summary"),
5586 Dictionary(
5587 title=_('Autostart Services'),
5588 elements=[
5589 ('ignored',
5590 ListOfStrings(
5591 title=_("Ignored autostart services"),
5592 help=_('Regular expressions matching the begining of the internal name '
5593 'or the description of the service. '
5594 'If no name is given then this rule will match all services. The '
5595 'match is done on the <i>beginning</i> of the service name. It '
5596 'is done <i>case sensitive</i>. You can do a case insensitive match '
5597 'by prefixing the regular expression with <tt>(?i)</tt>. Example: '
5598 '<tt>(?i).*mssql</tt> matches all services which contain <tt>MSSQL</tt> '
5599 'or <tt>MsSQL</tt> or <tt>mssql</tt> or...'),
5600 orientation="horizontal",
5602 ('state_if_stopped',
5603 MonitoringState(
5604 title=_("Default state if stopped autostart services are found"),
5605 default_value=0,
5608 ), None, "dict")
5610 register_check_parameters(
5611 RulespecGroupCheckParametersApplications, "solaris_services_summary",
5612 _("Solaris Services Summary"),
5613 Dictionary(
5614 elements=[
5615 ('maintenance_state',
5616 MonitoringState(
5617 title=_("State if 'maintenance' services are found"),
5618 default_value=0,
5620 ],), None, "dict")
5622 register_check_parameters(
5623 RulespecGroupCheckParametersApplications,
5624 "esx_vsphere_objects",
5625 _("State of ESX hosts and virtual machines"),
5626 Dictionary(
5627 help=_("Usually the check goes to WARN if a VM or host is powered off and OK otherwise. "
5628 "You can change this behaviour on a per-state-basis here."),
5629 optional_keys=False,
5630 elements=[
5631 ("states",
5632 Dictionary(
5633 title=_("Target states"),
5634 optional_keys=False,
5635 elements=[
5636 ("poweredOn",
5637 MonitoringState(
5638 title=_("Powered ON"),
5639 help=_("Check result if the host or VM is powered on"),
5640 default_value=0,
5642 ("poweredOff",
5643 MonitoringState(
5644 title=_("Powered OFF"),
5645 help=_("Check result if the host or VM is powered off"),
5646 default_value=1,
5648 ("suspended",
5649 MonitoringState(
5650 title=_("Suspended"),
5651 help=_("Check result if the host or VM is suspended"),
5652 default_value=1,
5654 ("unknown",
5655 MonitoringState(
5656 title=_("Unknown"),
5657 help=_(
5658 "Check result if the host or VM state is reported as <i>unknown</i>"),
5659 default_value=3,
5661 ])),
5663 TextAscii(
5664 title=_("Name of the VM/HostSystem"),
5665 help=_(
5666 "Please do not forget to specify either <tt>VM</tt> or <tt>HostSystem</tt>. Example: <tt>VM abcsrv123</tt>. Also note, "
5667 "that we match the <i>beginning</i> of the name."),
5668 regex="(^VM|HostSystem)( .*|$)",
5669 regex_error=_("The name of the system must begin with <tt>VM</tt> or <tt>HostSystem</tt>."),
5670 allow_empty=False,
5672 "dict",
5675 register_check_parameters(
5676 RulespecGroupCheckParametersApplications,
5677 "esx_vsphere_objects_count",
5678 _("Distribution of virtual machines over ESX hosts"),
5679 Dictionary(
5680 optional_keys=False,
5681 elements=[
5682 ("distribution",
5683 ListOf(
5684 Dictionary(
5685 optional_keys=False,
5686 elements=[("vm_names", ListOfStrings(title=_("VMs"))),
5687 ("hosts_count", Integer(title=_("Number of hosts"),
5688 default_value=2)),
5689 ("state",
5690 MonitoringState(title=_("State if violated"), default_value=1))]),
5691 title=_("VM distribution"),
5692 help=_(
5693 "You can specify lists of VM names and a number of hosts,"
5694 " to make sure the specfied VMs are distributed across at least so many hosts."
5695 " E.g. provide two VM names and set 'Number of hosts' to two,"
5696 " to make sure those VMs are not running on the same host."))),
5698 None,
5699 "dict",
5703 def windows_printer_queues_forth(old):
5704 default = {
5705 "warn_states": [8, 11],
5706 "crit_states": [9, 10],
5708 if isinstance(old, tuple):
5709 default['levels'] = old
5710 if isinstance(old, dict):
5711 return old
5712 return default
5715 register_check_parameters(
5716 RulespecGroupCheckParametersPrinters,
5717 "windows_printer_queues",
5718 _("Number of open jobs of a printer on windows"),
5719 Transform(
5720 Dictionary(
5721 title=_("Windows Printer Configuration"),
5722 elements=[
5724 "levels",
5725 Tuple(
5726 title=_("Levels for the number of print jobs"),
5727 help=_("This rule is applied to the number of print jobs "
5728 "currently waiting in windows printer queue."),
5729 elements=[
5730 Integer(title=_("Warning at"), unit=_("jobs"), default_value=40),
5731 Integer(title=_("Critical at"), unit=_("jobs"), default_value=60),
5734 ("crit_states",
5735 ListChoice(
5736 title=_("States who should lead to critical"),
5737 choices=[
5738 (0, "Unkown"),
5739 (1, "Other"),
5740 (2, "No Error"),
5741 (3, "Low Paper"),
5742 (4, "No Paper"),
5743 (5, "Low Toner"),
5744 (6, "No Toner"),
5745 (7, "Door Open"),
5746 (8, "Jammed"),
5747 (9, "Offline"),
5748 (10, "Service Requested"),
5749 (11, "Output Bin Full"),
5751 default_value=[9, 10],
5753 ("warn_states",
5754 ListChoice(
5755 title=_("States who should lead to warning"),
5756 choices=[
5757 (0, "Unkown"),
5758 (1, "Other"),
5759 (2, "No Error"),
5760 (3, "Low Paper"),
5761 (4, "No Paper"),
5762 (5, "Low Toner"),
5763 (6, "No Toner"),
5764 (7, "Door Open"),
5765 (8, "Jammed"),
5766 (9, "Offline"),
5767 (10, "Service Requested"),
5768 (11, "Output Bin Full"),
5770 default_value=[8, 11],
5773 forth=windows_printer_queues_forth,
5775 TextAscii(title=_("Printer Name"), allow_empty=True),
5776 match_type="first",
5779 register_check_parameters(
5780 RulespecGroupCheckParametersPrinters,
5781 "printer_input",
5782 _("Printer Input Units"),
5783 Dictionary(
5784 elements=[
5785 ('capacity_levels',
5786 Tuple(
5787 title=_('Capacity remaining'),
5788 elements=[
5789 Percentage(title=_("Warning at"), default_value=0.0),
5790 Percentage(title=_("Critical at"), default_value=0.0),
5794 default_keys=['capacity_levels'],
5796 TextAscii(title=_('Unit Name'), allow_empty=True),
5797 match_type="dict",
5800 register_check_parameters(
5801 RulespecGroupCheckParametersPrinters,
5802 "printer_output",
5803 _("Printer Output Units"),
5804 Dictionary(
5805 elements=[
5806 ('capacity_levels',
5807 Tuple(
5808 title=_('Capacity filled'),
5809 elements=[
5810 Percentage(title=_("Warning at"), default_value=0.0),
5811 Percentage(title=_("Critical at"), default_value=0.0),
5815 default_keys=['capacity_levels'],
5817 TextAscii(title=_('Unit Name'), allow_empty=True),
5818 match_type="dict",
5821 register_check_parameters(
5822 RulespecGroupCheckParametersOperatingSystem,
5823 "cpu_load",
5824 _("CPU load (not utilization!)"),
5825 Levels(
5826 help=_("The CPU load of a system is the number of processes currently being "
5827 "in the state <u>running</u>, i.e. either they occupy a CPU or wait "
5828 "for one. The <u>load average</u> is the averaged CPU load over the last 1, "
5829 "5 or 15 minutes. The following levels will be applied on the average "
5830 "load. On Linux system the 15-minute average load is used when applying "
5831 "those levels. The configured levels are multiplied with the number of "
5832 "CPUs, so you should configure the levels based on the value you want to "
5833 "be warned \"per CPU\"."),
5834 unit="per core",
5835 default_difference=(2.0, 4.0),
5836 default_levels=(5.0, 10.0),
5838 None,
5839 match_type="first",
5842 register_check_parameters(
5843 RulespecGroupCheckParametersOperatingSystem,
5844 "cpu_utilization",
5845 _("CPU utilization for Appliances"),
5846 Optional(
5847 Tuple(elements=[
5848 Percentage(title=_("Warning at a utilization of")),
5849 Percentage(title=_("Critical at a utilization of"))
5851 label=_("Alert on too high CPU utilization"),
5852 help=_("The CPU utilization sums up the percentages of CPU time that is used "
5853 "for user processes and kernel routines over all available cores within "
5854 "the last check interval. The possible range is from 0% to 100%"),
5855 default_value=(90.0, 95.0)),
5856 None,
5857 match_type="first",
5860 register_check_parameters(
5861 RulespecGroupCheckParametersOperatingSystem,
5862 "cpu_utilization_multiitem",
5863 _("CPU utilization of Devices with Modules"),
5864 Dictionary(
5865 help=_("The CPU utilization sums up the percentages of CPU time that is used "
5866 "for user processes and kernel routines over all available cores within "
5867 "the last check interval. The possible range is from 0% to 100%"),
5868 elements=[
5870 "levels",
5871 Tuple(
5872 title=_("Alert on too high CPU utilization"),
5873 elements=[
5874 Percentage(title=_("Warning at a utilization of"), default_value=90.0),
5875 Percentage(title=_("Critical at a utilization of"), default_value=95.0)
5880 TextAscii(title=_("Module name"), allow_empty=False),
5881 match_type="dict",
5884 register_check_parameters(
5885 RulespecGroupCheckParametersOperatingSystem,
5886 "fpga_utilization",
5887 _("FPGA utilization"),
5888 Dictionary(
5889 help=_("Give FPGA utilization levels in percent. The possible range is from 0% to 100%."),
5890 elements=[
5892 "levels",
5893 Tuple(
5894 title=_("Alert on too high FPGA utilization"),
5895 elements=[
5896 Percentage(title=_("Warning at a utilization of"), default_value=80.0),
5897 Percentage(title=_("Critical at a utilization of"), default_value=90.0)
5902 TextAscii(title=_("FPGA"), allow_empty=False),
5903 match_type="dict",
5907 def transform_humidity(p):
5908 if isinstance(p, (list, tuple)):
5909 p = {
5910 "levels_lower": (float(p[1]), float(p[0])),
5911 "levels": (float(p[2]), float(p[3])),
5913 return p
5916 register_check_parameters(
5917 RulespecGroupCheckParametersEnvironment,
5918 "humidity",
5919 _("Humidity Levels"),
5920 Transform(
5921 Dictionary(
5922 help=_("This Ruleset sets the threshold limits for humidity sensors"),
5923 elements=[
5924 ("levels",
5925 Tuple(
5926 title=_("Upper levels"),
5927 elements=[
5928 Percentage(title=_("Warning at")),
5929 Percentage(title=_("Critical at")),
5930 ])),
5931 ("levels_lower",
5932 Tuple(
5933 title=_("Lower levels"),
5934 elements=[
5935 Percentage(title=_("Warning below")),
5936 Percentage(title=_("Critical below")),
5937 ])),
5939 forth=transform_humidity,
5941 TextAscii(
5942 title=_("Sensor name"),
5943 help=_("The identifier of the sensor."),
5945 match_type="dict",
5948 register_check_parameters(
5949 RulespecGroupCheckParametersEnvironment,
5950 "single_humidity",
5951 _("Humidity Levels for devices with a single sensor"),
5952 Tuple(
5953 help=_("This Ruleset sets the threshold limits for humidity sensors"),
5954 elements=[
5955 Integer(title=_("Critical at or below"), unit="%"),
5956 Integer(title=_("Warning at or below"), unit="%"),
5957 Integer(title=_("Warning at or above"), unit="%"),
5958 Integer(title=_("Critical at or above"), unit="%"),
5960 None,
5961 match_type="first",
5964 db_levels_common = [
5965 ("levels",
5966 Alternative(
5967 title=_("Levels for the Tablespace usage"),
5968 default_value=(10.0, 5.0),
5969 elements=[
5970 Tuple(
5971 title=_("Percentage free space"),
5972 elements=[
5973 Percentage(title=_("Warning if below"), unit=_("% free")),
5974 Percentage(title=_("Critical if below"), unit=_("% free")),
5976 Tuple(
5977 title=_("Absolute free space"),
5978 elements=[
5979 Integer(title=_("Warning if below"), unit=_("MB"), default_value=1000),
5980 Integer(title=_("Critical if below"), unit=_("MB"), default_value=500),
5982 ListOf(
5983 Tuple(
5984 orientation="horizontal",
5985 elements=[
5986 Filesize(title=_("Tablespace larger than")),
5987 Alternative(
5988 title=_("Levels for the Tablespace size"),
5989 elements=[
5990 Tuple(
5991 title=_("Percentage free space"),
5992 elements=[
5993 Percentage(title=_("Warning if below"), unit=_("% free")),
5994 Percentage(title=_("Critical if below"), unit=_("% free")),
5996 Tuple(
5997 title=_("Absolute free space"),
5998 elements=[
5999 Integer(title=_("Warning if below"), unit=_("MB")),
6000 Integer(title=_("Critical if below"), unit=_("MB")),
6005 title=_('Dynamic levels'),
6007 ])),
6008 ("magic",
6009 Float(
6010 title=_("Magic factor (automatic level adaptation for large tablespaces)"),
6011 help=_("This is only be used in case of percentual levels"),
6012 minvalue=0.1,
6013 maxvalue=1.0,
6014 default_value=0.9)),
6015 ("magic_normsize",
6016 Integer(
6017 title=_("Reference size for magic factor"), minvalue=1, default_value=1000, unit=_("MB"))),
6018 ("magic_maxlevels",
6019 Tuple(
6020 title=_("Maximum levels if using magic factor"),
6021 help=_("The tablespace levels will never be raise above these values, when using "
6022 "the magic factor and the tablespace is very small."),
6023 elements=[
6024 Percentage(
6025 title=_("Maximum warning level"),
6026 unit=_("% free"),
6027 allow_int=True,
6028 default_value=60.0),
6029 Percentage(
6030 title=_("Maximum critical level"),
6031 unit=_("% free"),
6032 allow_int=True,
6033 default_value=50.0)
6037 register_check_parameters(
6038 RulespecGroupCheckParametersApplications,
6039 "oracle_tablespaces",
6040 _("Oracle Tablespaces"),
6041 Dictionary(
6042 help=_("A tablespace is a container for segments (tables, indexes, etc). A "
6043 "database consists of one or more tablespaces, each made up of one or "
6044 "more data files. Tables and indexes are created within a particular "
6045 "tablespace. "
6046 "This rule allows you to define checks on the size of tablespaces."),
6047 elements=db_levels_common + [
6048 ("autoextend",
6049 DropdownChoice(
6050 title=_("Expected autoextend setting"),
6051 choices=[
6052 (True, _("Autoextend is expected to be ON")),
6053 (False, _("Autoextend is expected to be OFF")),
6054 (None, _("Autoextend will be ignored")),
6055 ])),
6056 ("autoextend_severity",
6057 MonitoringState(
6058 title=_("Severity of invalid autoextend setting"),
6059 default_value=2,
6061 ("defaultincrement",
6062 DropdownChoice(
6063 title=_("Default Increment"),
6064 choices=[
6065 (True, _("State is WARNING in case the next extent has the default size.")),
6066 (False, _("Ignore default increment")),
6067 ])),
6068 ("map_file_online_states",
6069 ListOf(
6070 Tuple(
6071 orientation="horizontal",
6072 elements=[
6073 DropdownChoice(choices=[
6074 ("RECOVER", _("Recover")),
6075 ("OFFLINE", _("Offline")),
6077 MonitoringState()
6079 title=_('Map file online states'),
6081 ("temptablespace",
6082 DropdownChoice(
6083 title=_("Monitor temporary Tablespace"),
6084 choices=[
6085 (False, _("Ignore temporary Tablespaces (Default)")),
6086 (True, _("Apply rule to temporary Tablespaces")),
6087 ])),
6090 TextAscii(
6091 title=_("Explicit tablespaces"),
6092 help=
6093 _("Here you can set explicit tablespaces by defining them via SID and the tablespace name, separated by a dot, for example <b>pengt.TEMP</b>"
6095 regex=r'.+\..+',
6096 allow_empty=False),
6097 match_type="dict",
6100 register_check_parameters(
6101 RulespecGroupCheckParametersApplications,
6102 "oracle_processes",
6103 _("Oracle Processes"),
6104 Dictionary(
6105 help=_(
6106 "Here you can override the default levels for the ORACLE Processes check. The levels "
6107 "are applied on the number of used processes in percentage of the configured limit."),
6108 elements=[
6109 ("levels",
6110 Tuple(
6111 title=_("Levels for used processes"),
6112 elements=[
6113 Percentage(title=_("Warning if more than"), default_value=70.0),
6114 Percentage(title=_("Critical if more than"), default_value=90.0)
6115 ])),
6117 optional_keys=False,
6119 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
6120 "dict",
6123 register_check_parameters(
6124 RulespecGroupCheckParametersApplications,
6125 "oracle_recovery_area",
6126 _("Oracle Recovery Area"),
6127 Dictionary(elements=[("levels",
6128 Tuple(
6129 title=_("Levels for used space (reclaimable is considered as free)"),
6130 elements=[
6131 Percentage(title=_("warning at"), default_value=70.0),
6132 Percentage(title=_("critical at"), default_value=90.0),
6133 ]))]),
6134 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
6135 "dict",
6138 register_check_parameters(
6139 RulespecGroupCheckParametersApplications,
6140 "oracle_dataguard_stats",
6141 _("Oracle Data-Guard Stats"),
6142 Dictionary(
6143 help=
6144 _("The Data-Guard statistics are available in Oracle Enterprise Edition with enabled Data-Guard. "
6145 "The <tt>init.ora</tt> parameter <tt>dg_broker_start</tt> must be <tt>TRUE</tt> for this check. "
6146 "The apply and transport lag can be configured with this rule."),
6147 elements=[
6148 ("apply_lag",
6149 Tuple(
6150 title=_("Apply Lag Maximum Time"),
6151 help=_("The maximum limit for the apply lag in <tt>v$dataguard_stats</tt>."),
6152 elements=[Age(title=_("Warning at"),),
6153 Age(title=_("Critical at"),)])),
6154 ("apply_lag_min",
6155 Tuple(
6156 title=_("Apply Lag Minimum Time"),
6157 help=_(
6158 "The minimum limit for the apply lag in <tt>v$dataguard_stats</tt>. "
6159 "This is only useful if also <i>Apply Lag Maximum Time</i> has been configured."
6161 elements=[Age(title=_("Warning at"),),
6162 Age(title=_("Critical at"),)])),
6163 ("transport_lag",
6164 Tuple(
6165 title=_("Transport Lag"),
6166 help=_("The limit for the transport lag in <tt>v$dataguard_stats</tt>"),
6167 elements=[Age(title=_("Warning at"),),
6168 Age(title=_("Critical at"),)])),
6170 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
6171 "dict",
6174 register_check_parameters(
6175 RulespecGroupCheckParametersApplications,
6176 "oracle_undostat",
6177 _("Oracle Undo Retention"),
6178 Dictionary(elements=[
6179 ("levels",
6180 Tuple(
6181 title=_("Levels for remaining undo retention"),
6182 elements=[
6183 Age(title=_("warning if less then"), default_value=600),
6184 Age(title=_("critical if less then"), default_value=300),
6185 ])),
6187 'nospaceerrcnt_state',
6188 MonitoringState(
6189 default_value=2,
6190 title=_("State in case of non space error count is greater then 0: "),
6194 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
6195 "dict",
6198 register_check_parameters(
6199 RulespecGroupCheckParametersApplications,
6200 "oracle_rman",
6201 _("Oracle RMAN Backups"),
6202 Dictionary(elements=[("levels",
6203 Tuple(
6204 title=_("Maximum Age for RMAN backups"),
6205 elements=[
6206 Age(title=_("warning if older than"), default_value=1800),
6207 Age(title=_("critical if older than"), default_value=3600),
6208 ]))]),
6209 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
6210 "dict",
6213 register_check_parameters(
6214 RulespecGroupCheckParametersApplications,
6215 "oracle_recovery_status",
6216 _("Oracle Recovery Status"),
6217 Dictionary(elements=[("levels",
6218 Tuple(
6219 title=_("Levels for checkpoint time"),
6220 elements=[
6221 Age(title=_("warning if higher then"), default_value=1800),
6222 Age(title=_("critical if higher then"), default_value=3600),
6223 ])),
6224 ("backup_age",
6225 Tuple(
6226 title=_("Levels for user managed backup files"),
6227 help=_("Important! This checks is only for monitoring of datafiles "
6228 "who were left in backup mode. "
6229 "(alter database datafile ... begin backup;) "),
6230 elements=[
6231 Age(title=_("warning if higher then"), default_value=1800),
6232 Age(title=_("critical if higher then"), default_value=3600),
6233 ]))]),
6234 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
6235 "dict",
6238 register_check_parameters(
6239 RulespecGroupCheckParametersApplications,
6240 "oracle_jobs",
6241 _("Oracle Scheduler Job"),
6242 Dictionary(
6243 help=_("A scheduler job is an object in an ORACLE database which could be "
6244 "compared to a cron job on Unix. "),
6245 elements=[
6246 ("run_duration",
6247 Tuple(
6248 title=_("Maximum run duration for last execution"),
6249 help=_("Here you can define an upper limit for the run duration of "
6250 "last execution of the job."),
6251 elements=[
6252 Age(title=_("warning at")),
6253 Age(title=_("critical at")),
6254 ])),
6255 ("disabled",
6256 DropdownChoice(
6257 title=_("Job State"),
6258 help=_("The state of the job is ignored per default."),
6259 totext="",
6260 choices=[
6261 (True, _("Ignore the state of the Job")),
6262 (False, _("Consider the state of the job")),
6265 ("status_disabled_jobs",
6266 MonitoringState(title="Status of service in case of disabled job", default_value=0)),
6267 ("status_missing_jobs",
6268 MonitoringState(
6269 title=_("Status of service in case of missing job."),
6270 default_value=2,
6273 TextAscii(
6274 title=_("Scheduler Job Name"),
6275 help=_("Here you can set explicit Scheduler-Jobs by defining them via SID, Job-Owner "
6276 "and Job-Name, separated by a dot, for example <tt>TUX12C.SYS.PURGE_LOG</tt>"),
6277 regex=r'.+\..+',
6278 allow_empty=False),
6279 match_type="dict",
6282 register_check_parameters(
6283 RulespecGroupCheckParametersApplications,
6284 "oracle_instance",
6285 _("Oracle Instance"),
6286 Dictionary(
6287 title=_("Consider state of Archivelogmode: "),
6288 elements=[
6289 ('archivelog',
6290 MonitoringState(
6291 default_value=0,
6292 title=_("State in case of Archivelogmode is enabled: "),
6295 'noarchivelog',
6296 MonitoringState(
6297 default_value=1,
6298 title=_("State in case of Archivelogmode is disabled: "),
6302 'forcelogging',
6303 MonitoringState(
6304 default_value=0,
6305 title=_("State in case of Force Logging is enabled: "),
6309 'noforcelogging',
6310 MonitoringState(
6311 default_value=1,
6312 title=_("State in case of Force Logging is disabled: "),
6316 'logins',
6317 MonitoringState(
6318 default_value=2,
6319 title=_("State in case of logins are not possible: "),
6323 'primarynotopen',
6324 MonitoringState(
6325 default_value=2,
6326 title=_("State in case of Database is PRIMARY and not OPEN: "),
6329 ('uptime_min',
6330 Tuple(
6331 title=_("Minimum required uptime"),
6332 elements=[
6333 Age(title=_("Warning if below")),
6334 Age(title=_("Critical if below")),
6335 ])),
6336 ('ignore_noarchivelog',
6337 Checkbox(
6338 title=_("Ignore state of no-archive log"),
6339 label=_("Enable"),
6340 help=_("If active, only a single summary item is displayed. The summary "
6341 "will explicitly mention sensors in warn/crit state but the "
6342 "sensors that are ok are aggregated."),
6343 default_value=False)),
6346 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
6347 match_type="dict",
6350 register_check_parameters(
6351 RulespecGroupCheckParametersApplications, "asm_diskgroup",
6352 _("ASM Disk Group (used space and growth)"),
6353 Dictionary(
6354 elements=filesystem_elements + [
6355 ("req_mir_free",
6356 DropdownChoice(
6357 title=_("Handling for required mirror space"),
6358 totext="",
6359 choices=[
6360 (False, _("Do not regard required mirror space as free space")),
6361 (True, _("Regard required mirror space as free space")),
6363 help=_(
6364 "ASM calculates the free space depending on free_mb or required mirror "
6365 "free space. Enable this option to set the check against required "
6366 "mirror free space. This only works for normal or high redundancy Disk Groups."
6367 ))),
6369 hidden_keys=["flex_levels"],
6371 TextAscii(
6372 title=_("ASM Disk Group"),
6373 help=_("Specify the name of the ASM Disk Group "),
6374 allow_empty=False), "dict")
6377 def _vs_mssql_backup_age(title):
6378 return Alternative(
6379 title=_("%s" % title),
6380 style="dropdown",
6381 elements=[
6382 Tuple(
6383 title=_("Set levels"),
6384 elements=[
6385 Age(title=_("Warning if older than")),
6386 Age(title=_("Critical if older than")),
6388 Tuple(
6389 title=_("No levels"),
6390 elements=[
6391 FixedValue(None, totext=""),
6392 FixedValue(None, totext=""),
6396 register_check_parameters(
6397 RulespecGroupCheckParametersApplications,
6398 "mssql_backup",
6399 _("MSSQL Backup summary"),
6400 Transform(
6401 Dictionary(
6402 help = _("This rule allows you to set limits on the age of backups for "
6403 "different backup types. If your agent does not support "
6404 "backup types (e.g. <i>Log Backup</i>, <i>Database Diff "
6405 "Backup</i>, etc.) you can use the option <i>Database Backup"
6406 "</i> to set a general limit"),
6407 elements = [
6408 ("database", _vs_mssql_backup_age("Database backup")),
6409 ("database_diff", _vs_mssql_backup_age("Database diff backup")),
6410 ("log", _vs_mssql_backup_age("Log backup")),
6411 ("file_or_filegroup", _vs_mssql_backup_age("File or filegroup backup")),
6412 ("file_diff", _vs_mssql_backup_age("File diff backup")),
6413 ("partial", _vs_mssql_backup_age("Partial backup")),
6414 ("partial_diff", _vs_mssql_backup_age("Partial diff backup")),
6415 ("unspecific", _vs_mssql_backup_age("Unspecific backup")),
6416 ("not_found", MonitoringState(title=_("State if no backup found"))),
6419 forth = lambda params: (params if isinstance(params, dict)
6420 else {'database': (params[0], params[1])})
6422 TextAscii(
6423 title = _("Service descriptions"),
6424 allow_empty = False),
6425 "first",
6428 register_check_parameters(
6429 RulespecGroupCheckParametersApplications,
6430 "mssql_backup_per_type",
6431 _("MSSQL Backup"),
6432 Dictionary(elements=[
6433 ("levels", _vs_mssql_backup_age("Upper levels for the backup age")),
6435 TextAscii(title=_("Backup name"), allow_empty=False),
6436 "dict",
6439 register_check_parameters(
6440 RulespecGroupCheckParametersApplications, "mssql_file_sizes",
6441 _("MSSQL Log and Data File Sizes"),
6442 Dictionary(
6443 title=_("File Size Levels"),
6444 elements=[
6445 ("data_files",
6446 Tuple(
6447 title=_("Levels for Datafiles"),
6448 elements=[
6449 Filesize(title=_("Warning at")),
6450 Filesize(title=_("Critical at")),
6451 ])),
6452 ("log_files",
6453 Tuple(
6454 title=_("Log files: Absolute upper thresholds"),
6455 elements=[Filesize(title=_("Warning at")),
6456 Filesize(title=_("Critical at"))])),
6457 ("log_files_used",
6458 Alternative(
6459 title=_("Levels for log files used"),
6460 elements=[
6461 Tuple(
6462 title=_("Upper absolute levels"),
6463 elements=[
6464 Filesize(title=_("Warning at")),
6465 Filesize(title=_("Critical at"))
6467 Tuple(
6468 title=_("Upper percentage levels"),
6469 elements=[
6470 Percentage(title=_("Warning at")),
6471 Percentage(title=_("Critical at"))
6473 ])),
6474 ]), TextAscii(title=_("Service descriptions"), allow_empty=False), "dict")
6476 register_check_parameters(
6477 RulespecGroupCheckParametersApplications,
6478 "mssql_tablespaces",
6479 _("MSSQL Size of Tablespace"),
6480 Dictionary(
6481 elements=[
6482 ("size",
6483 Tuple(
6484 title=_("Upper levels for size"),
6485 elements=[Filesize(title=_("Warning at")),
6486 Filesize(title=_("Critical at"))])),
6487 ("reserved",
6488 Alternative(
6489 title=_("Upper levels for reserved space"),
6490 elements=[
6491 Tuple(
6492 title=_("Absolute levels"),
6493 elements=[
6494 Filesize(title=_("Warning at")),
6495 Filesize(title=_("Critical at"))
6497 Tuple(
6498 title=_("Percentage levels"),
6499 elements=[
6500 Percentage(title=_("Warning at")),
6501 Percentage(title=_("Critical at"))
6503 ])),
6504 ("data",
6505 Alternative(
6506 title=_("Upper levels for data"),
6507 elements=[
6508 Tuple(
6509 title=_("Absolute levels"),
6510 elements=[
6511 Filesize(title=_("Warning at")),
6512 Filesize(title=_("Critical at"))
6514 Tuple(
6515 title=_("Percentage levels"),
6516 elements=[
6517 Percentage(title=_("Warning at")),
6518 Percentage(title=_("Critical at"))
6520 ])),
6521 ("indexes",
6522 Alternative(
6523 title=_("Upper levels for indexes"),
6524 elements=[
6525 Tuple(
6526 title=_("Absolute levels"),
6527 elements=[
6528 Filesize(title=_("Warning at")),
6529 Filesize(title=_("Critical at"))
6531 Tuple(
6532 title=_("Percentage levels"),
6533 elements=[
6534 Percentage(title=_("Warning at")),
6535 Percentage(title=_("Critical at"))
6537 ])),
6538 ("unused",
6539 Alternative(
6540 title=_("Upper levels for unused space"),
6541 elements=[
6542 Tuple(
6543 title=_("Absolute levels"),
6544 elements=[
6545 Filesize(title=_("Warning at")),
6546 Filesize(title=_("Critical at"))
6548 Tuple(
6549 title=_("Percentage levels"),
6550 elements=[
6551 Percentage(title=_("Warning at")),
6552 Percentage(title=_("Critical at"))
6554 ])),
6555 ("unallocated",
6556 Alternative(
6557 title=_("Lower levels for unallocated space"),
6558 elements=[
6559 Tuple(
6560 title=_("Absolute levels"),
6561 elements=[
6562 Filesize(title=_("Warning below")),
6563 Filesize(title=_("Critical below"))
6565 Tuple(
6566 title=_("Percentage levels"),
6567 elements=[
6568 Percentage(title=_("Warning below")),
6569 Percentage(title=_("Critical below"))
6571 ])),
6572 ],),
6573 TextAscii(title=_("Tablespace name"), allow_empty=False),
6574 match_type="dict",
6577 register_check_parameters(
6578 RulespecGroupCheckParametersApplications,
6579 "mssql_page_activity",
6580 _("MSSQL Page Activity"),
6581 Dictionary(
6582 title=_("Page Activity Levels"),
6583 elements=[
6584 ("page_reads/sec",
6585 Tuple(
6586 title=_("Reads/sec"),
6587 elements=[
6588 Float(title=_("warning at"), unit=_("/sec")),
6589 Float(title=_("critical at"), unit=_("/sec")),
6590 ])),
6591 ("page_writes/sec",
6592 Tuple(
6593 title=_("Writes/sec"),
6594 elements=[
6595 Float(title=_("warning at"), unit=_("/sec")),
6596 Float(title=_("critical at"), unit=_("/sec")),
6597 ])),
6598 ("page_lookups/sec",
6599 Tuple(
6600 title=_("Lookups/sec"),
6601 elements=[
6602 Float(title=_("warning at"), unit=_("/sec")),
6603 Float(title=_("critical at"), unit=_("/sec")),
6604 ])),
6606 TextAscii(title=_("Service descriptions"), allow_empty=False),
6607 match_type="dict")
6610 def levels_absolute_or_dynamic(name, value):
6611 return Alternative(
6612 title=_("Levels of %s %s") % (name, value),
6613 default_value=(80.0, 90.0),
6614 elements=[
6615 Tuple(
6616 title=_("Percentage %s space") % value,
6617 elements=[
6618 Percentage(title=_("Warning at"), unit=_("% used")),
6619 Percentage(title=_("Critical at"), unit=_("% used")),
6621 Tuple(
6622 title=_("Absolute %s space") % value,
6623 elements=[
6624 Integer(title=_("Warning at"), unit=_("MB"), default_value=500),
6625 Integer(title=_("Critical at"), unit=_("MB"), default_value=1000),
6627 ListOf(
6628 Tuple(
6629 orientation="horizontal",
6630 elements=[
6631 Filesize(title=_(" larger than")),
6632 Alternative(
6633 title=_("Levels for the %s %s size") % (name, value),
6634 elements=[
6635 Tuple(
6636 title=_("Percentage %s space") % value,
6637 elements=[
6638 Percentage(title=_("Warning at"), unit=_("% used")),
6639 Percentage(title=_("Critical at"), unit=_("% used")),
6641 Tuple(
6642 title=_("Absolute free space"),
6643 elements=[
6644 Integer(title=_("Warning at"), unit=_("MB")),
6645 Integer(title=_("Critical at"), unit=_("MB")),
6650 title=_('Dynamic levels'),
6655 register_check_parameters(
6656 RulespecGroupCheckParametersApplications, "mssql_transactionlogs",
6657 _("MSSQL Transactionlog Sizes"),
6658 Dictionary(
6659 title=_("File Size Levels"),
6660 help=_("Specify levels for transactionlogs of a database. Please note that relative "
6661 "levels will only work if there is a max_size set for the file on the database "
6662 "side."),
6663 elements=[
6664 ("used_levels", levels_absolute_or_dynamic(_("Transactionlog"), _("used"))),
6665 ("allocated_used_levels",
6666 levels_absolute_or_dynamic(_("Transactionlog"), _("used of allocation"))),
6667 ("allocated_levels", levels_absolute_or_dynamic(_("Transactionlog"), _("allocated"))),
6668 ]), TextAscii(title=_("Database Name"), allow_empty=False), "dict")
6670 register_check_parameters(
6671 RulespecGroupCheckParametersApplications, "mssql_datafiles", _("MSSQL Datafile Sizes"),
6672 Dictionary(
6673 title=_("File Size Levels"),
6674 help=_("Specify levels for datafiles of a database. Please note that relative "
6675 "levels will only work if there is a max_size set for the file on the database "
6676 "side."),
6677 elements=[
6678 ("used_levels", levels_absolute_or_dynamic(_("Datafile"), _("used"))),
6679 ("allocated_used_levels",
6680 levels_absolute_or_dynamic(_("Datafile"), _("used of allocation"))),
6681 ("allocated_levels", levels_absolute_or_dynamic(_("Datafile"), _("allocated"))),
6682 ]), TextAscii(title=_("Database Name"), allow_empty=False), "dict")
6684 register_check_parameters(
6685 RulespecGroupCheckParametersApplications,
6686 "vm_snapshots",
6687 _("Virtual Machine Snapshots"),
6688 Dictionary(elements=[
6689 ("age",
6690 Tuple(
6691 title=_("Age of the last snapshot"),
6692 elements=[
6693 Age(title=_("Warning if older than")),
6694 Age(title=_("Critical if older than"))
6695 ])),
6696 ("age_oldest",
6697 Tuple(
6698 title=_("Age of the oldest snapshot"),
6699 elements=[
6700 Age(title=_("Warning if older than")),
6701 Age(title=_("Critical if older than"))
6702 ])),
6704 None,
6705 match_type="dict",
6708 register_check_parameters(
6709 RulespecGroupCheckParametersApplications,
6710 "veeam_backup",
6711 _("Veeam: Time since last Backup"),
6712 Dictionary(elements=[("age",
6713 Tuple(
6714 title=_("Time since end of last backup"),
6715 elements=[
6716 Age(title=_("Warning if older than"), default_value=108000),
6717 Age(title=_("Critical if older than"), default_value=172800)
6718 ]))]),
6719 TextAscii(title=_("Job name")),
6720 match_type="dict",
6723 register_check_parameters(
6724 RulespecGroupCheckParametersApplications,
6725 "backup_timemachine",
6726 _("Age of timemachine backup"),
6727 Dictionary(elements=[("age",
6728 Tuple(
6729 title=_("Maximum age of latest timemachine backup"),
6730 elements=[
6731 Age(title=_("Warning if older than"), default_value=86400),
6732 Age(title=_("Critical if older than"), default_value=172800)
6733 ]))]),
6734 None,
6735 match_type="dict",
6738 register_check_parameters(
6739 RulespecGroupCheckParametersApplications,
6740 "job",
6741 _("Age of jobs controlled by mk-job"),
6742 Dictionary(elements=[
6743 ("age",
6744 Tuple(
6745 title=_("Maximum time since last start of job execution"),
6746 elements=[
6747 Age(title=_("Warning at"), default_value=0),
6748 Age(title=_("Critical at"), default_value=0)
6749 ])),
6750 ("outcome_on_cluster",
6751 DropdownChoice(
6752 title=_("Clusters: Prefered check result of local checks"),
6753 help=_("If you're running local checks on clusters via clustered services rule "
6754 "you can influence the check result with this rule. You can choose between "
6755 "best or worst state. Default setting is worst state."),
6756 choices=[
6757 ("worst", _("Worst state")),
6758 ("best", _("Best state")),
6760 default_value="worst")),
6762 TextAscii(title=_("Job name"),),
6763 match_type="dict",
6766 register_check_parameters(
6767 RulespecGroupCheckParametersApplications,
6768 "mssql_counters_locks",
6769 _("MSSQL Locks"),
6770 Dictionary(
6771 help=_("This check monitors locking related information of MSSQL tablespaces."),
6772 elements=[
6774 "lock_requests/sec",
6775 Tuple(
6776 title=_("Lock Requests / sec"),
6777 help=
6778 _("Number of new locks and lock conversions per second requested from the lock manager."
6780 elements=[
6781 Float(title=_("Warning at"), unit=_("requests/sec")),
6782 Float(title=_("Critical at"), unit=_("requests/sec")),
6787 "lock_timeouts/sec",
6788 Tuple(
6789 title=_("Lock Timeouts / sec"),
6790 help=
6791 _("Number of lock requests per second that timed out, including requests for NOWAIT locks."
6793 elements=[
6794 Float(title=_("Warning at"), unit=_("timeouts/sec")),
6795 Float(title=_("Critical at"), unit=_("timeouts/sec")),
6800 "number_of_deadlocks/sec",
6801 Tuple(
6802 title=_("Number of Deadlocks / sec"),
6803 help=_("Number of lock requests per second that resulted in a deadlock."),
6804 elements=[
6805 Float(title=_("Warning at"), unit=_("deadlocks/sec")),
6806 Float(title=_("Critical at"), unit=_("deadlocks/sec")),
6811 "lock_waits/sec",
6812 Tuple(
6813 title=_("Lock Waits / sec"),
6814 help=_("Number of lock requests per second that required the caller to wait."),
6815 elements=[
6816 Float(title=_("Warning at"), unit=_("waits/sec")),
6817 Float(title=_("Critical at"), unit=_("waits/sec")),
6822 TextAscii(title=_("Service descriptions"), allow_empty=False),
6823 match_type="dict",
6826 mssql_waittypes = [
6827 "ABR",
6828 "ASSEMBLY_LOAD",
6829 "ASYNC_DISKPOOL_LOCK",
6830 "ASYNC_IO_COMPLETION",
6831 "ASYNC_NETWORK_IO",
6832 "AUDIT_GROUPCACHE_LOCK",
6833 "AUDIT_LOGINCACHE_LOCK",
6834 "AUDIT_ON_DEMAND_TARGET_LOCK",
6835 "AUDIT_XE_SESSION_MGR",
6836 "BACKUP",
6837 "BACKUP_OPERATOR",
6838 "BACKUPBUFFER",
6839 "BACKUPIO",
6840 "BACKUPTHREAD",
6841 "BAD_PAGE_PROCESS",
6842 "BROKER_CONNECTION_RECEIVE_TASK",
6843 "BROKER_ENDPOINT_STATE_MUTEX",
6844 "BROKER_EVENTHANDLER",
6845 "BROKER_INIT",
6846 "BROKER_MASTERSTART",
6847 "BROKER_RECEIVE_WAITFOR",
6848 "BROKER_REGISTERALLENDPOINTS",
6849 "BROKER_SERVICE",
6850 "BROKER_SHUTDOWN",
6851 "BROKER_TASK_STOP",
6852 "BROKER_TO_FLUSH",
6853 "BROKER_TRANSMITTER",
6854 "BUILTIN_HASHKEY_MUTEX",
6855 "CHECK_PRINT_RECORD",
6856 "CHECKPOINT_QUEUE",
6857 "CHKPT",
6858 "CLEAR_DB",
6859 "CLR_AUTO_EVENT",
6860 "CLR_CRST",
6861 "CLR_JOIN",
6862 "CLR_MANUAL_EVENT",
6863 "CLR_MEMORY_SPY",
6864 "CLR_MONITOR",
6865 "CLR_RWLOCK_READER",
6866 "CLR_RWLOCK_WRITER",
6867 "CLR_SEMAPHORE",
6868 "CLR_TASK_START",
6869 "CLRHOST_STATE_ACCESS",
6870 "CMEMTHREAD",
6871 "CXCONSUMER",
6872 "CXPACKET",
6873 "CXROWSET_SYNC",
6874 "DAC_INIT",
6875 "DBMIRROR_DBM_EVENT",
6876 "DBMIRROR_DBM_MUTEX",
6877 "DBMIRROR_EVENTS_QUEUE",
6878 "DBMIRROR_SEND",
6879 "DBMIRROR_WORKER_QUEUE",
6880 "DBMIRRORING_CMD",
6881 "DEADLOCK_ENUM_MUTEX",
6882 "DEADLOCK_TASK_SEARCH",
6883 "DEBUG",
6884 "DISABLE_VERSIONING",
6885 "DISKIO_SUSPEND",
6886 "DISPATCHER_QUEUE_SEMAPHORE",
6887 "DLL_LOADING_MUTEX",
6888 "DROPTEMP",
6889 "DTC",
6890 "DTC_ABORT_REQUEST",
6891 "DTC_RESOLVE",
6892 "DTC_STATE",
6893 "DTC_TMDOWN_REQUEST",
6894 "DTC_WAITFOR_OUTCOME",
6895 "DUMP_LOG_COORDINATOR",
6896 "DUMPTRIGGER",
6897 "EC",
6898 "EE_PMOLOCK",
6899 "EE_SPECPROC_MAP_INIT",
6900 "ENABLE_VERSIONING",
6901 "ERROR_REPORTING_MANAGER",
6902 "EXCHANGE",
6903 "EXECSYNC",
6904 "EXECUTION_PIPE_EVENT_INTERNAL",
6905 "FAILPOINT",
6906 "FCB_REPLICA_READ",
6907 "FCB_REPLICA_WRITE",
6908 "FS_FC_RWLOCK",
6909 "FS_GARBAGE_COLLECTOR_SHUTDOWN",
6910 "FS_HEADER_RWLOCK",
6911 "FS_LOGTRUNC_RWLOCK",
6912 "FSA_FORCE_OWN_XACT",
6913 "FSAGENT",
6914 "FSTR_CONFIG_MUTEX",
6915 "FSTR_CONFIG_RWLOCK",
6916 "FT_COMPROWSET_RWLOCK",
6917 "FT_IFTS_RWLOCK",
6918 "FT_IFTS_SCHEDULER_IDLE_WAIT",
6919 "FT_IFTSHC_MUTEX",
6920 "FT_IFTSISM_MUTEX",
6921 "FT_MASTER_MERGE",
6922 "FT_METADATA_MUTEX",
6923 "FT_RESTART_CRAWL",
6924 "FULLTEXT",
6925 "GUARDIAN",
6926 "HADR_AG_MUTEX",
6927 "HADR_AR_CRITICAL_SECTION_ENTRY",
6928 "HADR_AR_MANAGER_MUTEX",
6929 "HADR_ARCONTROLLER_NOTIFICATIONS_SUBSCRIBER_LIST",
6930 "HADR_BACKUP_BULK_LOCK",
6931 "HADR_BACKUP_QUEUE",
6932 "HADR_CLUSAPI_CALL",
6933 "HADR_COMPRESSED_CACHE_SYNC",
6934 "HADR_DATABASE_FLOW_CONTROL",
6935 "HADR_DATABASE_VERSIONING_STATE",
6936 "HADR_DATABASE_WAIT_FOR_RESTART",
6937 "HADR_DATABASE_WAIT_FOR_TRANSITION_TO_VERSIONING",
6938 "HADR_DB_COMMAND",
6939 "HADR_DB_OP_COMPLETION_SYNC",
6940 "HADR_DB_OP_START_SYNC",
6941 "HADR_DBR_SUBSCRIBER",
6942 "HADR_DBR_SUBSCRIBER_FILTER_LIST",
6943 "HADR_DBSTATECHANGE_SYNC",
6944 "HADR_FILESTREAM_BLOCK_FLUSH",
6945 "HADR_FILESTREAM_FILE_CLOSE",
6946 "HADR_FILESTREAM_FILE_REQUEST",
6947 "HADR_FILESTREAM_IOMGR",
6948 "HADR_FILESTREAM_IOMGR_IOCOMPLETION",
6949 "HADR_FILESTREAM_MANAGER",
6950 "HADR_GROUP_COMMIT",
6951 "HADR_LOGCAPTURE_SYNC",
6952 "HADR_LOGCAPTURE_WAIT",
6953 "HADR_LOGPROGRESS_SYNC",
6954 "HADR_NOTIFICATION_DEQUEUE",
6955 "HADR_NOTIFICATION_WORKER_EXCLUSIVE_ACCESS",
6956 "HADR_NOTIFICATION_WORKER_STARTUP_SYNC",
6957 "HADR_NOTIFICATION_WORKER_TERMINATION_SYNC",
6958 "HADR_PARTNER_SYNC",
6959 "HADR_READ_ALL_NETWORKS",
6960 "HADR_RECOVERY_WAIT_FOR_CONNECTION",
6961 "HADR_RECOVERY_WAIT_FOR_UNDO",
6962 "HADR_REPLICAINFO_SYNC",
6963 "HADR_SYNC_COMMIT",
6964 "HADR_SYNCHRONIZING_THROTTLE",
6965 "HADR_TDS_LISTENER_SYNC",
6966 "HADR_TDS_LISTENER_SYNC_PROCESSING",
6967 "HADR_TIMER_TASK",
6968 "HADR_TRANSPORT_DBRLIST",
6969 "HADR_TRANSPORT_FLOW_CONTROL",
6970 "HADR_TRANSPORT_SESSION",
6971 "HADR_WORK_POOL",
6972 "HADR_WORK_QUEUE",
6973 "HADR_XRF_STACK_ACCESS",
6974 "HTTP_ENUMERATION",
6975 "HTTP_START",
6976 "IMPPROV_IOWAIT",
6977 "INTERNAL_TESTING",
6978 "IO_AUDIT_MUTEX",
6979 "IO_COMPLETION",
6980 "IO_RETRY",
6981 "IOAFF_RANGE_QUEUE",
6982 "KSOURCE_WAKEUP",
6983 "KTM_ENLISTMENT",
6984 "KTM_RECOVERY_MANAGER",
6985 "KTM_RECOVERY_RESOLUTION",
6986 "LATCH_DT",
6987 "LATCH_EX",
6988 "LATCH_KP",
6989 "LATCH_NL",
6990 "LATCH_SH",
6991 "LATCH_UP",
6992 "LAZYWRITER_SLEEP",
6993 "LCK_M_BU",
6994 "LCK_M_BU_ABORT_BLOCKERS",
6995 "LCK_M_BU_LOW_PRIORITY",
6996 "LCK_M_IS",
6997 "LCK_M_IS_ABORT_BLOCKERS",
6998 "LCK_M_IS_LOW_PRIORITY",
6999 "LCK_M_IU",
7000 "LCK_M_IU_ABORT_BLOCKERS",
7001 "LCK_M_IU_LOW_PRIORITY",
7002 "LCK_M_IX",
7003 "LCK_M_IX_ABORT_BLOCKERS",
7004 "LCK_M_IX_LOW_PRIORITY",
7005 "LCK_M_RIn_NL",
7006 "LCK_M_RIn_NL_ABORT_BLOCKERS",
7007 "LCK_M_RIn_NL_LOW_PRIORITY",
7008 "LCK_M_RIn_S",
7009 "LCK_M_RIn_S_ABORT_BLOCKERS",
7010 "LCK_M_RIn_S_LOW_PRIORITY",
7011 "LCK_M_RIn_U",
7012 "LCK_M_RIn_U_ABORT_BLOCKERS",
7013 "LCK_M_RIn_U_LOW_PRIORITY",
7014 "LCK_M_RIn_X",
7015 "LCK_M_RIn_X_ABORT_BLOCKERS",
7016 "LCK_M_RIn_X_LOW_PRIORITY",
7017 "LCK_M_RS_S",
7018 "LCK_M_RS_S_ABORT_BLOCKERS",
7019 "LCK_M_RS_S_LOW_PRIORITY",
7020 "LCK_M_RS_U",
7021 "LCK_M_RS_U_ABORT_BLOCKERS",
7022 "LCK_M_RS_U_LOW_PRIORITY",
7023 "LCK_M_RX_S",
7024 "LCK_M_RX_S_ABORT_BLOCKERS",
7025 "LCK_M_RX_S_LOW_PRIORITY",
7026 "LCK_M_RX_U",
7027 "LCK_M_RX_U_ABORT_BLOCKERS",
7028 "LCK_M_RX_U_LOW_PRIORITY",
7029 "LCK_M_RX_X",
7030 "LCK_M_RX_X_ABORT_BLOCKERS",
7031 "LCK_M_RX_X_LOW_PRIORITY",
7032 "LCK_M_S",
7033 "LCK_M_S_ABORT_BLOCKERS",
7034 "LCK_M_S_LOW_PRIORITY",
7035 "LCK_M_SCH_M",
7036 "LCK_M_SCH_M_ABORT_BLOCKERS",
7037 "LCK_M_SCH_M_LOW_PRIORITY",
7038 "LCK_M_SCH_S",
7039 "LCK_M_SCH_S_ABORT_BLOCKERS",
7040 "LCK_M_SCH_S_LOW_PRIORITY",
7041 "LCK_M_SIU",
7042 "LCK_M_SIU_ABORT_BLOCKERS",
7043 "LCK_M_SIU_LOW_PRIORITY",
7044 "LCK_M_SIX",
7045 "LCK_M_SIX_ABORT_BLOCKERS",
7046 "LCK_M_SIX_LOW_PRIORITY",
7047 "LCK_M_U",
7048 "LCK_M_U_ABORT_BLOCKERS",
7049 "LCK_M_U_LOW_PRIORITY",
7050 "LCK_M_UIX",
7051 "LCK_M_UIX_ABORT_BLOCKERS",
7052 "LCK_M_UIX_LOW_PRIORITY",
7053 "LCK_M_X",
7054 "LCK_M_X_ABORT_BLOCKERS",
7055 "LCK_M_X_LOW_PRIORITY",
7056 "LOGBUFFER",
7057 "LOGGENERATION",
7058 "LOGMGR",
7059 "LOGMGR_FLUSH",
7060 "LOGMGR_QUEUE",
7061 "LOGMGR_RESERVE_APPEND",
7062 "LOWFAIL_MEMMGR_QUEUE",
7063 "MEMORY_ALLOCATION_EXT",
7064 "MISCELLANEOUS",
7065 "MSQL_DQ",
7066 "MSQL_XACT_MGR_MUTEX",
7067 "MSQL_XACT_MUTEX",
7068 "MSQL_XP",
7069 "MSSEARCH",
7070 "NET_WAITFOR_PACKET",
7071 "OLEDB",
7072 "ONDEMAND_TASK_QUEUE",
7073 "PAGEIOLATCH_DT",
7074 "PAGEIOLATCH_EX",
7075 "PAGEIOLATCH_KP",
7076 "PAGEIOLATCH_NL",
7077 "PAGEIOLATCH_SH",
7078 "PAGEIOLATCH_UP",
7079 "PAGELATCH_DT",
7080 "PAGELATCH_EX",
7081 "PAGELATCH_KP",
7082 "PAGELATCH_NL",
7083 "PAGELATCH_SH",
7084 "PAGELATCH_UP",
7085 "PARALLEL_BACKUP_QUEUE",
7086 "PREEMPTIVE_ABR",
7087 "PREEMPTIVE_AUDIT_ACCESS_EVENTLOG",
7088 "PREEMPTIVE_AUDIT_ACCESS_SECLOG",
7089 "PREEMPTIVE_CLOSEBACKUPMEDIA",
7090 "PREEMPTIVE_CLOSEBACKUPTAPE",
7091 "PREEMPTIVE_CLOSEBACKUPVDIDEVICE",
7092 "PREEMPTIVE_CLUSAPI_CLUSTERRESOURCECONTROL",
7093 "PREEMPTIVE_COM_COCREATEINSTANCE",
7094 "PREEMPTIVE_HADR_LEASE_MECHANISM",
7095 "PREEMPTIVE_SOSTESTING",
7096 "PREEMPTIVE_STRESSDRIVER",
7097 "PREEMPTIVE_TESTING",
7098 "PREEMPTIVE_XETESTING",
7099 "PRINT_ROLLBACK_PROGRESS",
7100 "PWAIT_HADR_CHANGE_NOTIFIER_TERMINATION_SYNC",
7101 "PWAIT_HADR_CLUSTER_INTEGRATION",
7102 "PWAIT_HADR_OFFLINE_COMPLETED",
7103 "PWAIT_HADR_ONLINE_COMPLETED",
7104 "PWAIT_HADR_POST_ONLINE_COMPLETED",
7105 "PWAIT_HADR_WORKITEM_COMPLETED",
7106 "PWAIT_MD_LOGIN_STATS",
7107 "PWAIT_MD_RELATION_CACHE",
7108 "PWAIT_MD_SERVER_CACHE",
7109 "PWAIT_MD_UPGRADE_CONFIG",
7110 "PWAIT_METADATA_LAZYCACHE_RWLOCk",
7111 "QPJOB_KILL",
7112 "QPJOB_WAITFOR_ABORT",
7113 "QRY_MEM_GRANT_INFO_MUTEX",
7114 "QUERY_ERRHDL_SERVICE_DONE",
7115 "QUERY_EXECUTION_INDEX_SORT_EVENT_OPEN",
7116 "QUERY_NOTIFICATION_MGR_MUTEX",
7117 "QUERY_NOTIFICATION_SUBSCRIPTION_MUTEX",
7118 "QUERY_NOTIFICATION_TABLE_MGR_MUTEX",
7119 "QUERY_NOTIFICATION_UNITTEST_MUTEX",
7120 "QUERY_OPTIMIZER_PRINT_MUTEX",
7121 "QUERY_TRACEOUT",
7122 "QUERY_WAIT_ERRHDL_SERVICE",
7123 "RECOVER_CHANGEDB",
7124 "REPL_CACHE_ACCESS",
7125 "REPL_SCHEMA_ACCESS",
7126 "REPLICA_WRITES",
7127 "REQUEST_DISPENSER_PAUSE",
7128 "REQUEST_FOR_DEADLOCK_SEARCH",
7129 "RESMGR_THROTTLED",
7130 "RESOURCE_QUEUE",
7131 "RESOURCE_SEMAPHORE",
7132 "RESOURCE_SEMAPHORE_MUTEX",
7133 "RESOURCE_SEMAPHORE_QUERY_COMPILE",
7134 "RESOURCE_SEMAPHORE_SMALL_QUERY",
7135 "SEC_DROP_TEMP_KEY",
7136 "SECURITY_MUTEX",
7137 "SEQUENTIAL_GUID",
7138 "SERVER_IDLE_CHECK",
7139 "SHUTDOWN",
7140 "SLEEP_BPOOL_FLUSH",
7141 "SLEEP_DBSTARTUP",
7142 "SLEEP_DCOMSTARTUP",
7143 "SLEEP_MSDBSTARTUP",
7144 "SLEEP_SYSTEMTASK",
7145 "SLEEP_TASK",
7146 "SLEEP_TEMPDBSTARTUP",
7147 "SNI_CRITICAL_SECTION",
7148 "SNI_HTTP_WAITFOR_",
7149 "SNI_LISTENER_ACCESS",
7150 "SNI_TASK_COMPLETION",
7151 "SOAP_READ",
7152 "SOAP_WRITE",
7153 "SOS_CALLBACK_REMOVAL",
7154 "SOS_DISPATCHER_MUTEX",
7155 "SOS_LOCALALLOCATORLIST",
7156 "SOS_MEMORY_USAGE_ADJUSTMENT",
7157 "SOS_OBJECT_STORE_DESTROY_MUTEX",
7158 "SOS_PHYS_PAGE_CACHE",
7159 "SOS_PROCESS_AFFINITY_MUTEX",
7160 "SOS_RESERVEDMEMBLOCKLIST",
7161 "SOS_SCHEDULER_YIELD",
7162 "SOS_SMALL_PAGE_ALLOC",
7163 "SOS_STACKSTORE_INIT_MUTEX",
7164 "SOS_SYNC_TASK_ENQUEUE_EVENT",
7165 "SOS_VIRTUALMEMORY_LOW",
7166 "SOSHOST_EVENT",
7167 "SOSHOST_INTERNAL",
7168 "SOSHOST_MUTEX",
7169 "SOSHOST_RWLOCK",
7170 "SOSHOST_SEMAPHORE",
7171 "SOSHOST_SLEEP",
7172 "SOSHOST_TRACELOCK",
7173 "SOSHOST_WAITFORDONE",
7174 "SQLCLR_APPDOMAIN",
7175 "SQLCLR_ASSEMBLY",
7176 "SQLCLR_DEADLOCK_DETECTION",
7177 "SQLCLR_QUANTUM_PUNISHMENT",
7178 "SQLSORT_NORMMUTEX",
7179 "SQLSORT_SORTMUTEX",
7180 "SQLTRACE_BUFFER_FLUSH",
7181 "SQLTRACE_FILE_BUFFER",
7182 "SQLTRACE_SHUTDOWN",
7183 "SQLTRACE_WAIT_ENTRIES",
7184 "SRVPROC_SHUTDOWN",
7185 "TEMPOBJ",
7186 "THREADPOOL",
7187 "TIMEPRIV_TIMEPERIOD",
7188 "TRACEWRITE",
7189 "TRAN_MARKLATCH_DT",
7190 "TRAN_MARKLATCH_EX",
7191 "TRAN_MARKLATCH_KP",
7192 "TRAN_MARKLATCH_NL",
7193 "TRAN_MARKLATCH_SH",
7194 "TRAN_MARKLATCH_UP",
7195 "TRANSACTION_MUTEX",
7196 "UTIL_PAGE_ALLOC",
7197 "VIA_ACCEPT",
7198 "VIEW_DEFINITION_MUTEX",
7199 "WAIT_FOR_RESULTS",
7200 "WAIT_XTP_CKPT_CLOSE",
7201 "WAIT_XTP_CKPT_ENABLED",
7202 "WAIT_XTP_CKPT_STATE_LOCK",
7203 "WAIT_XTP_GUEST",
7204 "WAIT_XTP_HOST_WAIT",
7205 "WAIT_XTP_OFFLINE_CKPT_LOG_IO",
7206 "WAIT_XTP_OFFLINE_CKPT_NEW_LOG",
7207 "WAIT_XTP_PROCEDURE_ENTRY",
7208 "WAIT_XTP_RECOVERY",
7209 "WAIT_XTP_TASK_SHUTDOWN",
7210 "WAIT_XTP_TRAN_COMMIT",
7211 "WAIT_XTP_TRAN_DEPENDENCY",
7212 "WAITFOR",
7213 "WAITFOR_TASKSHUTDOWN",
7214 "WAITSTAT_MUTEX",
7215 "WCC",
7216 "WORKTBL_DROP",
7217 "WRITE_COMPLETION",
7218 "WRITELOG",
7219 "XACT_OWN_TRANSACTION",
7220 "XACT_RECLAIM_SESSION",
7221 "XACTLOCKINFO",
7222 "XACTWORKSPACE_MUTEX",
7223 "XE_BUFFERMGR_ALLPROCESSED_EVENT",
7224 "XE_BUFFERMGR_FREEBUF_EVENT",
7225 "XE_DISPATCHER_CONFIG_SESSION_LIST",
7226 "XE_DISPATCHER_JOIN",
7227 "XE_DISPATCHER_WAIT",
7228 "XE_MODULEMGR_SYNC",
7229 "XE_OLS_LOCK",
7230 "XE_PACKAGE_LOCK_BACKOFF",
7231 "XTPPROC_CACHE_ACCESS",
7232 "XTPPROC_PARTITIONED_STACK_CREATE",
7235 register_check_parameters(
7236 RulespecGroupCheckParametersApplications,
7237 "mssql_blocked_sessions",
7238 _("MSSQL Blocked Sessions"),
7239 Dictionary(
7240 elements=[
7241 ("state",
7242 MonitoringState(
7243 title=_("State of MSSQL Blocked Sessions is treated as"),
7244 help=_("The default state if there is at least one "
7245 "blocked session."),
7246 default_value=2,
7248 ("waittime",
7249 Tuple(
7250 title=_("Levels for wait"),
7251 help=_("The threshholds for wait_duration_ms. Will "
7252 "overwrite the default state set above."),
7253 default_value=(0, 0),
7254 elements=[
7255 Float(title=_("Warning at"), unit=_("seconds"), display_format="%.3f"),
7256 Float(title=_("Critical at"), unit=_("seconds"), display_format="%.3f"),
7257 ])),
7258 ("ignore_waittypes",
7259 DualListChoice(
7260 title=_("Ignore wait types"),
7261 rows=40,
7262 choices=[(entry, entry) for entry in mssql_waittypes],
7264 ],),
7265 None,
7266 "dict",
7267 deprecated=True,
7270 register_check_parameters(
7271 RulespecGroupCheckParametersApplications,
7272 "mssql_instance_blocked_sessions",
7273 _("MSSQL Blocked Sessions"),
7274 Dictionary(
7275 elements=[
7276 ("state",
7277 MonitoringState(
7278 title=_("State of MSSQL Blocked Sessions is treated as"),
7279 help=_("The default state if there is at least one "
7280 "blocked session."),
7281 default_value=2,
7283 ("waittime",
7284 Tuple(
7285 title=_("Levels for wait"),
7286 help=_("The threshholds for wait_duration_ms. Will "
7287 "overwrite the default state set above."),
7288 default_value=(0, 0),
7289 elements=[
7290 Float(title=_("Warning at"), unit=_("seconds"), display_format="%.3f"),
7291 Float(title=_("Critical at"), unit=_("seconds"), display_format="%.3f"),
7292 ])),
7293 ("ignore_waittypes",
7294 DualListChoice(
7295 title=_("Ignore wait types"),
7296 rows=40,
7297 choices=[(entry, entry) for entry in mssql_waittypes],
7299 ],),
7300 TextAscii(title=_("Instance identifier")),
7301 "dict",
7304 register_check_parameters(
7305 RulespecGroupCheckParametersApplications,
7306 "mysql_sessions",
7307 _("MySQL Sessions & Connections"),
7308 Dictionary(
7309 help=_("This check monitors the current number of active sessions to the MySQL "
7310 "database server as well as the connection rate."),
7311 elements=[
7313 "total",
7314 Tuple(
7315 title=_("Number of current sessions"),
7316 elements=[
7317 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
7318 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
7323 "running",
7324 Tuple(
7325 title=_("Number of currently running sessions"),
7326 help=_("Levels for the number of sessions that are currently active"),
7327 elements=[
7328 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
7329 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
7334 "connections",
7335 Tuple(
7336 title=_("Number of new connections per second"),
7337 elements=[
7338 Integer(title=_("Warning at"), unit=_("connection/sec"), default_value=20),
7339 Integer(title=_("Critical at"), unit=_("connection/sec"), default_value=40),
7344 TextAscii(
7345 title=_("Instance"),
7346 help=_("Only needed if you have multiple MySQL Instances on one server"),
7348 "dict",
7351 register_check_parameters(
7352 RulespecGroupCheckParametersApplications,
7353 "mysql_innodb_io",
7354 _("MySQL InnoDB Throughput"),
7355 Dictionary(
7356 elements=[("read",
7357 Tuple(
7358 title=_("Read throughput"),
7359 elements=[
7360 Float(title=_("warning at"), unit=_("MB/s")),
7361 Float(title=_("critical at"), unit=_("MB/s"))
7362 ])),
7363 ("write",
7364 Tuple(
7365 title=_("Write throughput"),
7366 elements=[
7367 Float(title=_("warning at"), unit=_("MB/s")),
7368 Float(title=_("critical at"), unit=_("MB/s"))
7369 ])),
7370 ("average",
7371 Integer(
7372 title=_("Average"),
7373 help=_("When averaging is set, a floating average value "
7374 "of the disk throughput is computed and the levels for read "
7375 "and write will be applied to the average instead of the current "
7376 "value."),
7377 minvalue=1,
7378 default_value=5,
7379 unit=_("minutes")))]),
7380 TextAscii(
7381 title=_("Instance"),
7382 help=_("Only needed if you have multiple MySQL Instances on one server"),
7384 "dict",
7387 register_check_parameters(
7388 RulespecGroupCheckParametersApplications,
7389 "mysql_connections",
7390 _("MySQL Connections"),
7391 Dictionary(elements=[
7392 ("perc_used",
7393 Tuple(
7394 title=_("Max. parallel connections"),
7395 help=_("Compares the maximum number of connections that have been "
7396 "in use simultaneously since the server started with the maximum simultaneous "
7397 "connections allowed by the configuration of the server. This threshold "
7398 "makes the check raise warning/critical states if the percentage is equal to "
7399 "or above the configured levels."),
7400 elements=[
7401 Percentage(title=_("Warning at")),
7402 Percentage(title=_("Critical at")),
7403 ])),
7405 TextAscii(
7406 title=_("Instance"),
7407 help=_("Only needed if you have multiple MySQL Instances on one server"),
7409 "dict",
7412 register_check_parameters(
7413 RulespecGroupCheckParametersApplications,
7414 "mysql_slave",
7415 _("MySQL Slave"),
7416 Dictionary(
7417 elements=[
7418 ("seconds_behind_master",
7419 Tuple(
7420 title=_("Max. time behind the master"),
7421 help=_(
7422 "Compares the time which the slave can be behind the master. "
7423 "This rule makes the check raise warning/critical states if the time is equal to "
7424 "or above the configured levels."),
7425 elements=[
7426 Age(title=_("Warning at")),
7427 Age(title=_("Critical at")),
7428 ])),
7430 optional_keys=None),
7431 TextAscii(
7432 title=_("Instance"),
7433 help=_("Only needed if you have multiple MySQL Instances on one server"),
7435 "dict",
7438 register_check_parameters(
7439 RulespecGroupCheckParametersApplications, "db_bloat", _("Database Bloat (PostgreSQL)"),
7440 Dictionary(
7441 help=_("This rule allows you to configure bloat levels for a databases tablespace and "
7442 "indexspace."),
7443 elements=[
7444 ("table_bloat_abs",
7445 Tuple(
7446 title=_("Table absolute bloat levels"),
7447 elements=[
7448 Filesize(title=_("Warning at")),
7449 Filesize(title=_("Critical at")),
7450 ])),
7451 ("table_bloat_perc",
7452 Tuple(
7453 title=_("Table percentage bloat levels"),
7454 help=_("Percentage in respect to the optimal utilization. "
7455 "For example if an alarm should raise at 50% wasted space, you need "
7456 "to configure 150%"),
7457 elements=[
7458 Percentage(title=_("Warning at"), maxvalue=None),
7459 Percentage(title=_("Critical at"), maxvalue=None),
7460 ])),
7461 ("index_bloat_abs",
7462 Tuple(
7463 title=_("Index absolute levels"),
7464 elements=[
7465 Filesize(title=_("Warning at")),
7466 Filesize(title=_("Critical at")),
7467 ])),
7468 ("index_bloat_perc",
7469 Tuple(
7470 title=_("Index percentage bloat levels"),
7471 help=_("Percentage in respect to the optimal utilization. "
7472 "For example if an alarm should raise at 50% wasted space, you need "
7473 "to configure 150%"),
7474 elements=[
7475 Percentage(title=_("Warning at"), maxvalue=None),
7476 Percentage(title=_("Critical at"), maxvalue=None),
7477 ])),
7478 ]), TextAscii(title=_("Name of the database"),), "dict")
7480 register_check_parameters(
7481 RulespecGroupCheckParametersApplications, "db_connections",
7482 _("Database Connections (PostgreSQL/MongoDB)"),
7483 Dictionary(
7484 help=_("This rule allows you to configure the number of maximum concurrent "
7485 "connections for a given database."),
7486 elements=[
7487 ("levels_perc",
7488 Tuple(
7489 title=_("Percentage of maximum available connections"),
7490 elements=[
7491 Percentage(title=_("Warning at"), unit=_("% of maximum connections")),
7492 Percentage(title=_("Critical at"), unit=_("% of maximum connections")),
7493 ])),
7494 ("levels_abs",
7495 Tuple(
7496 title=_("Absolute number of connections"),
7497 elements=[
7498 Integer(title=_("Warning at"), minvalue=0, unit=_("connections")),
7499 Integer(title=_("Critical at"), minvalue=0, unit=_("connections")),
7500 ])),
7501 ]), TextAscii(title=_("Name of the database"),), "dict")
7503 register_check_parameters(
7504 RulespecGroupCheckParametersApplications, "postgres_locks", _("PostgreSQL Locks"),
7505 Dictionary(
7506 help=_(
7507 "This rule allows you to configure the limits for the SharedAccess and Exclusive Locks "
7508 "for a PostgreSQL database."),
7509 elements=[
7510 ("levels_shared",
7511 Tuple(
7512 title=_("Shared Access Locks"),
7513 elements=[
7514 Integer(title=_("Warning at"), minvalue=0),
7515 Integer(title=_("Critical at"), minvalue=0),
7516 ])),
7517 ("levels_exclusive",
7518 Tuple(
7519 title=_("Exclusive Locks"),
7520 elements=[
7521 Integer(title=_("Warning at"), minvalue=0),
7522 Integer(title=_("Critical at"), minvalue=0),
7523 ])),
7524 ]), TextAscii(title=_("Name of the database"),), "dict")
7526 register_check_parameters(
7527 RulespecGroupCheckParametersApplications, "postgres_maintenance",
7528 _("PostgreSQL VACUUM and ANALYZE"),
7529 Dictionary(
7530 help=_("With this rule you can set limits for the VACUUM and ANALYZE operation of "
7531 "a PostgreSQL database. Keep in mind that each table within a database is checked "
7532 "with this limits."),
7533 elements=[
7534 ("last_vacuum",
7535 Tuple(
7536 title=_("Time since the last VACUUM"),
7537 elements=[
7538 Age(title=_("Warning if older than"), default_value=86400 * 7),
7539 Age(title=_("Critical if older than"), default_value=86400 * 14)
7540 ])),
7541 ("last_analyze",
7542 Tuple(
7543 title=_("Time since the last ANALYZE"),
7544 elements=[
7545 Age(title=_("Warning if older than"), default_value=86400 * 7),
7546 Age(title=_("Critical if older than"), default_value=86400 * 14)
7547 ])),
7548 ("never_analyze_vacuum",
7549 Tuple(
7550 title=_("Age of never analyzed/vacuumed tables"),
7551 elements=[
7552 Age(title=_("Warning if older than"), default_value=86400 * 7),
7553 Age(title=_("Critical if older than"), default_value=86400 * 14)
7554 ])),
7555 ]), TextAscii(title=_("Name of the database"),), "dict")
7557 register_check_parameters(
7558 RulespecGroupCheckParametersApplications, "f5_connections", _("F5 Loadbalancer Connections"),
7559 Dictionary(elements=[
7560 ("conns",
7561 Levels(
7562 title=_("Max. number of connections"),
7563 default_value=None,
7564 default_levels=(25000, 30000))),
7565 ("ssl_conns",
7566 Levels(
7567 title=_("Max. number of SSL connections"),
7568 default_value=None,
7569 default_levels=(25000, 30000))),
7570 ("connections_rate",
7571 Levels(
7572 title=_("Maximum connections per second"),
7573 default_value=None,
7574 default_levels=(500, 1000))),
7575 ("connections_rate_lower",
7576 Tuple(
7577 title=_("Minimum connections per second"),
7578 elements=[
7579 Integer(title=_("Warning at")),
7580 Integer(title=_("Critical at")),
7583 ("http_req_rate",
7584 Levels(
7585 title=_("HTTP requests per second"), default_value=None, default_levels=(500, 1000))),
7586 ]), None, "dict")
7588 register_check_parameters(
7589 RulespecGroupCheckParametersApplications,
7590 "cisco_fw_connections",
7591 _("Cisco ASA Firewall Connections"),
7592 Dictionary(elements=[
7593 ("connections",
7594 Tuple(
7595 help=_("This rule sets limits to the current number of connections through "
7596 "a Cisco ASA firewall."),
7597 title=_("Maximum number of firewall connections"),
7598 elements=[
7599 Integer(title=_("Warning at")),
7600 Integer(title=_("Critical at")),
7604 None,
7605 "dict",
7608 register_check_parameters(
7609 RulespecGroupCheckParametersApplications,
7610 "checkpoint_connections",
7611 _("Checkpoint Firewall Connections"),
7612 Tuple(
7613 help=_("This rule sets limits to the current number of connections through "
7614 "a Checkpoint firewall."),
7615 title=_("Maximum number of firewall connections"),
7616 elements=[
7617 Integer(title=_("Warning at"), default_value=40000),
7618 Integer(title=_("Critical at"), default_value=50000),
7621 None,
7622 match_type="first",
7625 register_check_parameters(
7626 RulespecGroupCheckParametersApplications, "checkpoint_packets",
7627 _("Checkpoint Firewall Packet Rates"),
7628 Dictionary(elements=[
7629 ("accepted",
7630 Levels(
7631 title=_("Maximum Rate of Accepted Packets"),
7632 default_value=None,
7633 default_levels=(100000, 200000),
7634 unit="pkts/sec")),
7635 ("rejected",
7636 Levels(
7637 title=_("Maximum Rate of Rejected Packets"),
7638 default_value=None,
7639 default_levels=(100000, 200000),
7640 unit="pkts/sec")),
7641 ("dropped",
7642 Levels(
7643 title=_("Maximum Rate of Dropped Packets"),
7644 default_value=None,
7645 default_levels=(100000, 200000),
7646 unit="pkts/sec")),
7647 ("logged",
7648 Levels(
7649 title=_("Maximum Rate of Logged Packets"),
7650 default_value=None,
7651 default_levels=(100000, 200000),
7652 unit="pkts/sec")),
7653 ]), None, "dict")
7655 register_check_parameters(
7656 RulespecGroupCheckParametersApplications, "f5_pools", _("F5 Loadbalancer Pools"),
7657 Tuple(
7658 title=_("Minimum number of pool members"),
7659 elements=[
7660 Integer(title=_("Warning if below"), unit=_("Members ")),
7661 Integer(title=_("Critical if below"), unit=_("Members")),
7663 ), TextAscii(title=_("Name of pool")), "first")
7665 register_check_parameters(
7666 RulespecGroupCheckParametersApplications, "mysql_db_size", _("Size of MySQL databases"),
7667 Optional(
7668 Tuple(elements=[
7669 Filesize(title=_("warning at")),
7670 Filesize(title=_("critical at")),
7672 help=_("The check will trigger a warning or critical state if the size of the "
7673 "database exceeds these levels."),
7674 title=_("Impose limits on the size of the database"),
7676 TextAscii(
7677 title=_("Name of the database"),
7678 help=_("Don't forget the instance: instance:dbname"),
7679 ), "first")
7681 register_check_parameters(
7682 RulespecGroupCheckParametersApplications,
7683 "postgres_sessions",
7684 _("PostgreSQL Sessions"),
7685 Dictionary(
7686 help=_("This check monitors the current number of active and idle sessions on PostgreSQL"),
7687 elements=[
7689 "total",
7690 Tuple(
7691 title=_("Number of current sessions"),
7692 elements=[
7693 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
7694 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
7699 "running",
7700 Tuple(
7701 title=_("Number of currently running sessions"),
7702 help=_("Levels for the number of sessions that are currently active"),
7703 elements=[
7704 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
7705 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
7710 None,
7711 match_type="dict",
7712 deprecated=True,
7715 register_check_parameters(
7716 RulespecGroupCheckParametersApplications,
7717 "postgres_instance_sessions",
7718 _("PostgreSQL Sessions"),
7719 Dictionary(
7720 help=_("This check monitors the current number of active and idle sessions on PostgreSQL"),
7721 elements=[
7723 "total",
7724 Tuple(
7725 title=_("Number of current sessions"),
7726 elements=[
7727 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
7728 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
7733 "running",
7734 Tuple(
7735 title=_("Number of currently running sessions"),
7736 help=_("Levels for the number of sessions that are currently active"),
7737 elements=[
7738 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
7739 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
7744 TextAscii(title=_("Instance")),
7745 match_type="dict",
7748 register_check_parameters(
7749 RulespecGroupCheckParametersApplications,
7750 "asa_svc_sessions",
7751 _("Cisco SSl VPN Client Sessions"),
7752 Tuple(
7753 title=_("Number of active sessions"),
7754 help=_("This check monitors the current number of active sessions"),
7755 elements=[
7756 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
7757 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
7760 None,
7761 match_type="first",
7765 def convert_oracle_sessions(value):
7766 if isinstance(value, tuple):
7767 return {'sessions_abs': value}
7768 if 'sessions_abs' not in value:
7769 value['sessions_abs'] = (100, 200)
7770 return value
7773 register_check_parameters(
7774 RulespecGroupCheckParametersApplications,
7775 "oracle_sessions",
7776 _("Oracle Sessions"),
7777 Transform(
7778 Dictionary(
7779 elements=[
7780 ("sessions_abs",
7781 Alternative(
7782 title=_("Absolute levels of active sessions"),
7783 style="dropdown",
7784 help=_("This check monitors the current number of active sessions on Oracle"),
7785 elements=[
7786 FixedValue(None, title=_("Do not use absolute levels"), totext=""),
7787 Tuple(
7788 title=_("Number of active sessions"),
7789 elements=[
7790 Integer(
7791 title=_("Warning at"), unit=_("sessions"), default_value=100),
7792 Integer(
7793 title=_("Critical at"), unit=_("sessions"), default_value=200),
7799 "sessions_perc",
7800 Tuple(
7801 title=_("Relative levels of active sessions."),
7802 help=
7803 _("Set upper levels of active sessions relative to max. number of sessions. This is optional."
7805 elements=[
7806 Percentage(title=_("Warning at")),
7807 Percentage(title=_("Critical at")),
7812 optional_keys=["sessions_perc"],
7814 forth=convert_oracle_sessions),
7815 TextAscii(title=_("Database name"), allow_empty=False),
7816 match_type="first",
7819 register_check_parameters(
7820 RulespecGroupCheckParametersApplications,
7821 "oracle_locks",
7822 _("Oracle Locks"),
7823 Dictionary(elements=[("levels",
7824 Tuple(
7825 title=_("Levels for minimum wait time for a lock"),
7826 elements=[
7827 Age(title=_("warning if higher then"), default_value=1800),
7828 Age(title=_("critical if higher then"), default_value=3600),
7829 ]))]),
7830 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
7831 "dict",
7834 register_check_parameters(
7835 RulespecGroupCheckParametersApplications,
7836 "oracle_longactivesessions",
7837 _("Oracle Long Active Sessions"),
7838 Dictionary(elements=[("levels",
7839 Tuple(
7840 title=_("Levels of active sessions"),
7841 elements=[
7842 Integer(title=_("Warning if more than"), unit=_("sessions")),
7843 Integer(title=_("Critical if more than"), unit=_("sessions")),
7844 ]))]),
7845 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
7846 "dict",
7849 register_check_parameters(
7850 RulespecGroupCheckParametersApplications,
7851 "postgres_stat_database",
7852 _("PostgreSQL Database Statistics"),
7853 Dictionary(
7854 help=_(
7855 "This check monitors how often database objects in a PostgreSQL Database are accessed"),
7856 elements=[
7858 "blocks_read",
7859 Tuple(
7860 title=_("Blocks read"),
7861 elements=[
7862 Float(title=_("Warning at"), unit=_("blocks/s")),
7863 Float(title=_("Critical at"), unit=_("blocks/s")),
7868 "xact_commit",
7869 Tuple(
7870 title=_("Commits"),
7871 elements=[
7872 Float(title=_("Warning at"), unit=_("/s")),
7873 Float(title=_("Critical at"), unit=_("/s")),
7878 "tup_fetched",
7879 Tuple(
7880 title=_("Fetches"),
7881 elements=[
7882 Float(title=_("Warning at"), unit=_("/s")),
7883 Float(title=_("Critical at"), unit=_("/s")),
7888 "tup_deleted",
7889 Tuple(
7890 title=_("Deletes"),
7891 elements=[
7892 Float(title=_("Warning at"), unit=_("/s")),
7893 Float(title=_("Critical at"), unit=_("/s")),
7898 "tup_updated",
7899 Tuple(
7900 title=_("Updates"),
7901 elements=[
7902 Float(title=_("Warning at"), unit=_("/s")),
7903 Float(title=_("Critical at"), unit=_("/s")),
7908 "tup_inserted",
7909 Tuple(
7910 title=_("Inserts"),
7911 elements=[
7912 Float(title=_("Warning at"), unit=_("/s")),
7913 Float(title=_("Critical at"), unit=_("/s")),
7919 TextAscii(title=_("Database name"), allow_empty=False),
7920 match_type="dict",
7923 register_check_parameters(
7924 RulespecGroupCheckParametersApplications,
7925 "win_dhcp_pools",
7926 _("DHCP Pools for Windows and Linux"),
7927 Transform(
7928 Dictionary(
7929 elements = [
7930 ("free_leases",
7931 Alternative(
7932 title = _("Free leases levels"),
7933 elements = [
7934 Tuple(
7935 title = _("Free leases levels in percent"),
7936 elements = [
7937 Percentage(title = _("Warning if below"), default_value = 10.0),
7938 Percentage(title = _("Critical if below"), default_value = 5.0)
7941 Tuple(
7942 title = _("Absolute free leases levels"),
7943 elements = [
7944 Integer(title = _("Warning if below"), unit = _("free leases")),
7945 Integer(title = _("Critical if below"), unit = _("free leases"))
7951 ("used_leases",
7952 Alternative(
7953 title = _("Used leases levels"),
7954 elements = [
7955 Tuple(
7956 title = _("Used leases levels in percent"),
7957 elements = [
7958 Percentage(title = _("Warning if below")),
7959 Percentage(title = _("Critical if below"))
7962 Tuple(
7963 title = _("Absolute used leases levels"),
7964 elements = [
7965 Integer(title = _("Warning if below"), unit = _("used leases")),
7966 Integer(title = _("Critical if below"), unit = _("used leases"))
7974 forth = lambda params: isinstance(params, tuple) and {"free_leases" : (float(params[0]), float(params[1]))} or params,
7976 TextAscii(
7977 title = _("Pool name"),
7978 allow_empty = False,
7980 match_type = "first",
7983 register_check_parameters(
7984 RulespecGroupCheckParametersOperatingSystem,
7985 "threads",
7986 _("Number of threads"),
7987 Tuple(
7988 help=_(
7989 "These levels check the number of currently existing threads on the system. Each process has at "
7990 "least one thread."),
7991 elements=[
7992 Integer(title=_("Warning at"), unit=_("threads"), default_value=1000),
7993 Integer(title=_("Critical at"), unit=_("threads"), default_value=2000)
7995 None,
7996 match_type="first",
7999 register_check_parameters(
8000 RulespecGroupCheckParametersOperatingSystem,
8001 "logins",
8002 _("Number of Logins on System"),
8003 Tuple(
8004 help=_("This rule defines upper limits for the number of logins on a system."),
8005 elements=[
8006 Integer(title=_("Warning at"), unit=_("users"), default_value=20),
8007 Integer(title=_("Critical at"), unit=_("users"), default_value=30)
8009 None,
8010 match_type="first",
8013 register_check_parameters(
8014 RulespecGroupCheckParametersApplications,
8015 "vms_procs",
8016 _("Number of processes on OpenVMS"),
8017 Optional(
8018 Tuple(elements=[
8019 Integer(title=_("Warning at"), unit=_("processes"), default_value=100),
8020 Integer(title=_("Critical at"), unit=_("processes"), default_value=200)
8022 title=_("Impose levels on number of processes"),
8024 None,
8025 match_type="first",
8028 register_check_parameters(
8029 RulespecGroupCheckParametersOperatingSystem, "vm_counter",
8030 _("Number of kernel events per second"),
8031 Levels(
8032 help=_("This ruleset applies to several similar checks measing various kernel "
8033 "events like context switches, process creations and major page faults. "
8034 "Please create separate rules for each type of kernel counter you "
8035 "want to set levels for."),
8036 unit=_("events per second"),
8037 default_levels=(1000, 5000),
8038 default_difference=(500.0, 1000.0),
8039 default_value=None,
8041 DropdownChoice(
8042 title=_("kernel counter"),
8043 choices=[("Context Switches", _("Context Switches")),
8044 ("Process Creations", _("Process Creations")),
8045 ("Major Page Faults", _("Major Page Faults"))]), "first")
8047 register_check_parameters(
8048 RulespecGroupCheckParametersStorage,
8049 "ibm_svc_total_latency",
8050 _("IBM SVC: Levels for total disk latency"),
8051 Dictionary(elements=[
8052 ("read",
8053 Levels(
8054 title=_("Read latency"),
8055 unit=_("ms"),
8056 default_value=None,
8057 default_levels=(50.0, 100.0))),
8058 ("write",
8059 Levels(
8060 title=_("Write latency"),
8061 unit=_("ms"),
8062 default_value=None,
8063 default_levels=(50.0, 100.0))),
8065 DropdownChoice(
8066 choices=[
8067 ("Drives", _("Total latency for all drives")),
8068 ("MDisks", _("Total latency for all MDisks")),
8069 ("VDisks", _("Total latency for all VDisks")),
8071 title=_("Disk/Drive type"),
8072 help=_("Please enter <tt>Drives</tt>, <tt>Mdisks</tt> or <tt>VDisks</tt> here.")),
8073 match_type="dict",
8077 def transform_ibm_svc_host(params):
8078 if params is None:
8079 # Old inventory rule until version 1.2.7
8080 # params were None instead of emtpy dictionary
8081 params = {'always_ok': False}
8083 if 'always_ok' in params:
8084 if params['always_ok'] is False:
8085 params = {'degraded_hosts': (1, 1), 'offline_hosts': (1, 1), 'other_hosts': (1, 1)}
8086 else:
8087 params = {}
8088 return params
8091 register_check_parameters(
8092 RulespecGroupCheckParametersStorage,
8093 "ibm_svc_host",
8094 _("IBM SVC: Options for SVC Hosts Check"),
8095 Transform(
8096 Dictionary(elements=[
8098 "active_hosts",
8099 Tuple(
8100 title=_("Count of active hosts"),
8101 elements=[
8102 Integer(title=_("Warning at or below"), minvalue=0, unit=_("active hosts")),
8103 Integer(
8104 title=_("Critical at or below"), minvalue=0, unit=_("active hosts")),
8108 "inactive_hosts",
8109 Tuple(
8110 title=_("Count of inactive hosts"),
8111 elements=[
8112 Integer(
8113 title=_("Warning at or above"), minvalue=0, unit=_("inactive hosts")),
8114 Integer(
8115 title=_("Critical at or above"), minvalue=0, unit=_("inactive hosts")),
8119 "degraded_hosts",
8120 Tuple(
8121 title=_("Count of degraded hosts"),
8122 elements=[
8123 Integer(
8124 title=_("Warning at or above"), minvalue=0, unit=_("degraded hosts")),
8125 Integer(
8126 title=_("Critical at or above"), minvalue=0, unit=_("degraded hosts")),
8130 "offline_hosts",
8131 Tuple(
8132 title=_("Count of offline hosts"),
8133 elements=[
8134 Integer(
8135 title=_("Warning at or above"), minvalue=0, unit=_("offline hosts")),
8136 Integer(
8137 title=_("Critical at or above"), minvalue=0, unit=_("offline hosts")),
8141 "other_hosts",
8142 Tuple(
8143 title=_("Count of other hosts"),
8144 elements=[
8145 Integer(title=_("Warning at or above"), minvalue=0, unit=_("other hosts")),
8146 Integer(title=_("Critical at or above"), minvalue=0, unit=_("other hosts")),
8150 forth=transform_ibm_svc_host,
8152 None,
8153 "dict",
8156 register_check_parameters(
8157 RulespecGroupCheckParametersStorage,
8158 "ibm_svc_mdisk",
8159 _("IBM SVC: Options for SVC Disk Check"),
8160 Dictionary(
8161 optional_keys=False,
8162 elements=[
8164 "online_state",
8165 MonitoringState(
8166 title=_("Resulting state if disk is online"),
8167 default_value=0,
8171 "degraded_state",
8172 MonitoringState(
8173 title=_("Resulting state if disk is degraded"),
8174 default_value=1,
8178 "offline_state",
8179 MonitoringState(
8180 title=_("Resulting state if disk is offline"),
8181 default_value=2,
8185 "excluded_state",
8186 MonitoringState(
8187 title=_("Resulting state if disk is excluded"),
8188 default_value=2,
8192 "managed_mode",
8193 MonitoringState(
8194 title=_("Resulting state if disk is in managed mode"),
8195 default_value=0,
8199 "array_mode",
8200 MonitoringState(
8201 title=_("Resulting state if disk is in array mode"),
8202 default_value=0,
8206 "image_mode",
8207 MonitoringState(
8208 title=_("Resulting state if disk is in image mode"),
8209 default_value=0,
8213 "unmanaged_mode",
8214 MonitoringState(
8215 title=_("Resulting state if disk is in unmanaged mode"),
8216 default_value=1,
8220 TextAscii(
8221 title=_("IBM SVC disk"),
8222 help=_("Name of the disk, e.g. mdisk0"),
8224 "dict",
8227 register_check_parameters(
8228 RulespecGroupCheckParametersStorage,
8229 "diskstat",
8230 _("Levels for disk IO"),
8231 Dictionary(
8232 help=_(
8233 "With this rule you can set limits for various disk IO statistics. "
8234 "Keep in mind that not all of these settings may be applicable for the actual "
8235 "check. For example, if the check doesn't provide a <i>Read wait</i> information in its "
8236 "output, any configuration setting referring to <i>Read wait</i> will have no effect."),
8237 elements=[
8238 ("read",
8239 Levels(
8240 title=_("Read throughput"),
8241 unit=_("MB/s"),
8242 default_levels=(50.0, 100.0),
8244 ("write",
8245 Levels(
8246 title=_("Write throughput"),
8247 unit=_("MB/s"),
8248 default_levels=(50.0, 100.0),
8250 ("utilization",
8251 Levels(
8252 title=_("Disk Utilization"),
8253 unit=_("%"),
8254 default_levels=(80.0, 90.0),
8256 ("latency", Levels(
8257 title=_("Disk Latency"),
8258 unit=_("ms"),
8259 default_levels=(80.0, 160.0),
8261 ("read_wait", Levels(title=_("Read wait"), unit=_("ms"), default_levels=(30.0, 50.0))),
8262 ("write_wait", Levels(title=_("Write wait"), unit=_("ms"), default_levels=(30.0,
8263 50.0))),
8264 ("average",
8265 Age(
8266 title=_("Averaging"),
8267 help=_(
8268 "When averaging is set, then all of the disk's metrics are averaged "
8269 "over the selected interval - rather then the check interval. This allows "
8270 "you to make your monitoring less reactive to short peaks. But it will also "
8271 "introduce a loss of accuracy in your graphs. "),
8272 default_value=300,
8274 ("read_ios",
8275 Levels(title=_("Read operations"), unit=_("1/s"), default_levels=(400.0, 600.0))),
8276 ("write_ios",
8277 Levels(title=_("Write operations"), unit=_("1/s"), default_levels=(300.0, 400.0))),
8279 TextAscii(
8280 title=_("Device"),
8281 help=_(
8282 "For a summarized throughput of all disks, specify <tt>SUMMARY</tt>, "
8283 "a per-disk IO is specified by the drive letter, a colon and a slash on Windows "
8284 "(e.g. <tt>C:/</tt>) or by the device name on Linux/UNIX (e.g. <tt>/dev/sda</tt>).")),
8285 "dict",
8288 register_check_parameters(
8289 RulespecGroupCheckParametersStorage, "disk_io", _("Levels on disk IO (old style checks)"),
8290 Dictionary(elements=[
8291 ("read",
8292 Levels(
8293 title=_("Read throughput"),
8294 unit=_("MB/s"),
8295 default_value=None,
8296 default_levels=(50.0, 100.0))),
8297 ("write",
8298 Levels(
8299 title=_("Write throughput"),
8300 unit=_("MB/s"),
8301 default_value=None,
8302 default_levels=(50.0, 100.0))),
8303 ("average",
8304 Integer(
8305 title=_("Average"),
8306 help=_("When averaging is set, a floating average value "
8307 "of the disk throughput is computed and the levels for read "
8308 "and write will be applied to the average instead of the current "
8309 "value."),
8310 default_value=5,
8311 minvalue=1,
8312 unit=_("minutes"))),
8313 ("latency",
8314 Tuple(
8315 title=_("IO Latency"),
8316 elements=[
8317 Float(title=_("warning at"), unit=_("ms"), default_value=80.0),
8318 Float(title=_("critical at"), unit=_("ms"), default_value=160.0),
8319 ])),
8321 "latency_perfdata",
8322 Checkbox(
8323 title=_("Performance Data for Latency"),
8324 label=_("Collect performance data for disk latency"),
8325 help=_("Note: enabling performance data for the latency might "
8326 "cause incompatibilities with existing historical data "
8327 "if you are running PNP4Nagios in SINGLE mode.")),
8329 ("read_ql",
8330 Tuple(
8331 title=_("Read Queue-Length"),
8332 elements=[
8333 Float(title=_("warning at"), default_value=80.0),
8334 Float(title=_("critical at"), default_value=90.0),
8335 ])),
8336 ("write_ql",
8337 Tuple(
8338 title=_("Write Queue-Length"),
8339 elements=[
8340 Float(title=_("warning at"), default_value=80.0),
8341 Float(title=_("critical at"), default_value=90.0),
8342 ])),
8344 "ql_perfdata",
8345 Checkbox(
8346 title=_("Performance Data for Queue Length"),
8347 label=_("Collect performance data for disk latency"),
8348 help=_("Note: enabling performance data for the latency might "
8349 "cause incompatibilities with existing historical data "
8350 "if you are running PNP4Nagios in SINGLE mode.")),
8353 TextAscii(
8354 title=_("Device"),
8355 help=_(
8356 "For a summarized throughput of all disks, specify <tt>SUMMARY</tt>, for a "
8357 "sum of read or write throughput write <tt>read</tt> or <tt>write</tt> resp. "
8358 "A per-disk IO is specified by the drive letter, a colon and a slash on Windows "
8359 "(e.g. <tt>C:/</tt>) or by the device name on Linux/UNIX (e.g. <tt>/dev/sda</tt>).")),
8360 "dict")
8362 register_rule(
8363 RulespecGroupCheckParametersStorage,
8364 "diskstat_inventory",
8365 ListChoice(
8366 title=_("Discovery mode for Disk IO check"),
8367 help=_("This rule controls which and how many checks will be created "
8368 "for monitoring individual physical and logical disks. "
8369 "Note: the option <i>Create a summary for all read, one for "
8370 "write</i> has been removed. Some checks will still support "
8371 "this settings, but it will be removed there soon."),
8372 choices=[
8373 ("summary", _("Create a summary over all physical disks")),
8374 # This option is still supported by some checks, but is deprecated and
8375 # we fade it out...
8376 # ( "legacy", _("Create a summary for all read, one for write") ),
8377 ("physical", _("Create a separate check for each physical disk")),
8378 ("lvm", _("Create a separate check for each LVM volume (Linux)")),
8379 ("vxvm", _("Creata a separate check for each VxVM volume (Linux)")),
8380 ("diskless", _("Creata a separate check for each partition (XEN)")),
8382 default_value=['summary'],
8384 match="first")
8387 def transform_if_groups_forth(params):
8388 for param in params:
8389 if param.get("name"):
8390 param["group_name"] = param["name"]
8391 del param["name"]
8392 if param.get("include_items"):
8393 param["items"] = param["include_items"]
8394 del param["include_items"]
8395 if param.get("single") is not None:
8396 if param["single"]:
8397 param["group_presence"] = "instead"
8398 else:
8399 param["group_presence"] = "separate"
8400 del param["single"]
8401 return params
8404 vs_elements_if_groups_matches = [
8405 ("iftype",
8406 Transform(
8407 DropdownChoice(
8408 title=_("Select interface port type"),
8409 choices=defines.interface_port_types(),
8410 help=_("Only interfaces with the given port type are put into this group. "
8411 "For example 53 (propVirtual)."),
8413 forth=str,
8414 back=int,
8416 ("items",
8417 ListOfStrings(
8418 title=_("Restrict interface items"),
8419 help=_("Only interface with these item names are put into this group."),
8423 vs_elements_if_groups_group = [
8424 ("group_name",
8425 TextAscii(
8426 title=_("Group name"),
8427 help=_("Name of group in service description"),
8428 allow_empty=False,
8430 ("group_presence",
8431 DropdownChoice(
8432 title=_("Group interface presence"),
8433 help=_("Determine whether the group interface is created as an "
8434 "separate service or not. In second case the choosen interface "
8435 "services disapear."),
8436 choices=[
8437 ("separate", _("List grouped interfaces separately")),
8438 ("instead", _("List grouped interfaces instead")),
8440 default_value="instead",
8444 register_rule(
8445 RulespecGroupCheckParametersNetworking,
8446 varname="if_groups",
8447 title=_('Network interface groups'),
8448 help=_(
8449 'Normally the Interface checks create a single service for interface. '
8450 'By defining if-group patterns multiple interfaces can be combined together. '
8451 'A single service is created for this interface group showing the total traffic amount '
8452 'of its members. You can configure if interfaces which are identified as group interfaces '
8453 'should not show up as single service. You can restrict grouped interfaces by iftype and the '
8454 'item name of the single interface.'),
8455 valuespec=Transform(
8456 Alternative(
8457 style="dropdown",
8458 elements=[
8459 ListOf(
8460 title=_("Groups on single host"),
8461 add_label=_("Add pattern"),
8462 valuespec=Dictionary(
8463 elements=vs_elements_if_groups_group + vs_elements_if_groups_matches,
8464 required_keys=["group_name", "group_presence"]),
8466 ListOf(
8467 magic="@!!",
8468 title=_("Groups on cluster"),
8469 add_label=_("Add pattern"),
8470 valuespec=Dictionary(
8471 elements=vs_elements_if_groups_group +
8472 [("node_patterns",
8473 ListOf(
8474 title=_("Patterns for each node"),
8475 add_label=_("Add pattern"),
8476 valuespec=Dictionary(
8477 elements=[("node_name", TextAscii(title=_("Node name")))] +
8478 vs_elements_if_groups_matches,
8479 required_keys=["node_name"]),
8480 allow_empty=False,
8481 ))],
8482 optional_keys=[])),
8485 forth=transform_if_groups_forth),
8486 match='all',
8489 register_rule(
8490 RulespecGroupCheckParametersDiscovery,
8491 varname="winperf_msx_queues_inventory",
8492 title=_('MS Exchange Message Queues Discovery'),
8493 help=_(
8494 'Per default the offsets of all Windows performance counters are preconfigured in the check. '
8495 'If the format of your counters object is not compatible then you can adapt the counter '
8496 'offsets manually.'),
8497 valuespec=ListOf(
8498 Tuple(
8499 orientation="horizontal",
8500 elements=[
8501 TextAscii(
8502 title=_("Name of Counter"),
8503 help=_("Name of the Counter to be monitored."),
8504 size=50,
8505 allow_empty=False,
8507 Integer(
8508 title=_("Offset"),
8509 help=_("The offset of the information relative to counter base"),
8510 allow_empty=False,
8513 movable=False,
8514 add_label=_("Add Counter")),
8515 match='all',
8518 mailqueue_params = Dictionary(
8519 elements=[
8521 "deferred",
8522 Tuple(
8523 title=_("Mails in outgoing mail queue/deferred mails"),
8524 help=_("This rule is applied to the number of E-Mails currently "
8525 "in the deferred mail queue, or in the general outgoing mail "
8526 "queue, if such a distinction is not available."),
8527 elements=[
8528 Integer(title=_("Warning at"), unit=_("mails"), default_value=10),
8529 Integer(title=_("Critical at"), unit=_("mails"), default_value=20),
8534 "active",
8535 Tuple(
8536 title=_("Mails in active mail queue"),
8537 help=_("This rule is applied to the number of E-Mails currently "
8538 "in the active mail queue"),
8539 elements=[
8540 Integer(title=_("Warning at"), unit=_("mails"), default_value=800),
8541 Integer(title=_("Critical at"), unit=_("mails"), default_value=1000),
8546 optional_keys=["active"],
8549 register_check_parameters(
8550 RulespecGroupCheckParametersApplications,
8551 "mailqueue_length",
8552 _("Number of mails in outgoing mail queue"),
8553 Transform(
8554 mailqueue_params,
8555 forth=lambda old: not isinstance(old, dict) and {"deferred": old} or old,
8557 None,
8558 match_type="dict",
8559 deprecated=True,
8562 register_check_parameters(
8563 RulespecGroupCheckParametersApplications,
8564 "mail_queue_length",
8565 _("Number of mails in outgoing mail queue"),
8566 Transform(
8567 mailqueue_params,
8568 forth=lambda old: not isinstance(old, dict) and {"deferred": old} or old,
8570 TextAscii(title=_("Mail queue name")),
8571 match_type="dict",
8574 register_check_parameters(
8575 RulespecGroupCheckParametersApplications, "mail_latency", _("Mail Latency"),
8576 Tuple(
8577 title=_("Upper levels for Mail Latency"),
8578 elements=[
8579 Age(title=_("Warning at"), default_value=40),
8580 Age(title=_("Critical at"), default_value=60),
8581 ]), None, "first")
8583 register_check_parameters(
8584 RulespecGroupCheckParametersStorage,
8585 "zpool_status",
8586 _("ZFS storage pool status"),
8587 None,
8588 None,
8589 match_type="first",
8592 register_check_parameters(
8593 RulespecGroupCheckParametersVirtualization,
8594 "vm_state",
8595 _("Overall state of a virtual machine (for example ESX VMs)"),
8596 None,
8597 None,
8598 match_type="first",
8601 register_check_parameters(
8602 RulespecGroupCheckParametersHardware,
8603 "hw_errors",
8604 _("Simple checks for BIOS/Hardware errors"),
8605 None,
8606 None,
8607 match_type="first",
8610 register_check_parameters(
8611 RulespecGroupCheckParametersApplications, "omd_status", _("OMD site status"), None,
8612 TextAscii(
8613 title=_("Name of the OMD site"),
8614 help=_("The name of the OMD site to check the status for")), "first")
8616 register_check_parameters(
8617 RulespecGroupCheckParametersStorage, "network_fs",
8618 _("Network filesystem - overall status (e.g. NFS)"),
8619 Dictionary(
8620 elements=[
8622 "has_perfdata",
8623 DropdownChoice(
8624 title=_("Performance data settings"),
8625 choices=[
8626 (True, _("Enable performance data")),
8627 (False, _("Disable performance data")),
8629 default_value=False),
8631 ],),
8632 TextAscii(
8633 title=_("Name of the mount point"), help=_("For NFS enter the name of the mount point.")),
8634 "dict")
8636 register_check_parameters(
8637 RulespecGroupCheckParametersStorage,
8638 "windows_multipath",
8639 _("Windows Multipath Count"),
8640 Alternative(
8641 help=_("This rules sets the expected number of active paths for a multipath LUN."),
8642 title=_("Expected number of active paths"),
8643 elements=[
8644 Integer(title=_("Expected number of active paths")),
8645 Tuple(
8646 title=_("Expected percentage of active paths"),
8647 elements=[
8648 Integer(title=_("Expected number of active paths")),
8649 Percentage(title=_("Warning if less then")),
8650 Percentage(title=_("Critical if less then")),
8653 None,
8654 "first",
8657 register_check_parameters(
8658 RulespecGroupCheckParametersStorage, "multipath", _("Linux and Solaris Multipath Count"),
8659 Alternative(
8660 help=_("This rules sets the expected number of active paths for a multipath LUN "
8661 "on Linux and Solaris hosts"),
8662 title=_("Expected number of active paths"),
8663 elements=[
8664 Integer(title=_("Expected number of active paths")),
8665 Tuple(
8666 title=_("Expected percentage of active paths"),
8667 elements=[
8668 Percentage(title=_("Warning if less then")),
8669 Percentage(title=_("Critical if less then")),
8672 TextAscii(
8673 title=_("Name of the MP LUN"),
8674 help=_("For Linux multipathing this is either the UUID (e.g. "
8675 "60a9800043346937686f456f59386741), or the configured "
8676 "alias.")), "first")
8678 register_rule(
8679 RulespecGroupCheckParametersStorage,
8680 varname="inventory_multipath_rules",
8681 title=_("Linux Multipath Inventory"),
8682 valuespec=Dictionary(
8683 elements=[
8684 ("use_alias",
8685 Checkbox(
8686 title=_("Use the multipath alias as service name, if one is set"),
8687 label=_("use alias"),
8688 help=_(
8689 "If a multipath device has an alias then you can use it for specifying "
8690 "the device instead of the UUID. The alias will then be part of the service "
8691 "description. The UUID will be displayed in the plugin output."))),
8693 help=_(
8694 "This rule controls whether the UUID or the alias is used in the service description during "
8695 "discovery of Multipath devices on Linux."),
8697 match='dict',
8700 register_check_parameters(
8701 RulespecGroupCheckParametersStorage, "multipath_count", _("ESX Multipath Count"),
8702 Alternative(
8703 help=_("This rules sets the expected number of active paths for a multipath LUN "
8704 "on ESX servers"),
8705 title=_("Match type"),
8706 elements=[
8707 FixedValue(
8708 None,
8709 title=_("OK if standby count is zero or equals active paths."),
8710 totext="",
8712 Dictionary(
8713 title=_("Custom settings"),
8714 elements=[
8715 (element,
8716 Transform(
8717 Tuple(
8718 title=description,
8719 elements=[
8720 Integer(title=_("Critical if less than")),
8721 Integer(title=_("Warning if less than")),
8722 Integer(title=_("Warning if more than")),
8723 Integer(title=_("Critical if more than")),
8725 forth=lambda x: len(x) == 2 and (0, 0, x[0], x[1]) or x))
8726 for (element,
8727 description) in [("active", _("Active paths")), (
8728 "dead", _("Dead paths")), (
8729 "disabled", _("Disabled paths")), (
8730 "standby", _("Standby paths")), ("unknown",
8731 _("Unknown paths"))]
8733 ]), TextAscii(title=_("Path ID")), "first")
8735 register_check_parameters(
8736 RulespecGroupCheckParametersStorage, "hpux_multipath", _("HP-UX Multipath Count"),
8737 Tuple(
8738 title=_("Expected path situation"),
8739 help=_("This rules sets the expected number of various paths for a multipath LUN "
8740 "on HPUX servers"),
8741 elements=[
8742 Integer(title=_("Number of active paths")),
8743 Integer(title=_("Number of standby paths")),
8744 Integer(title=_("Number of failed paths")),
8745 Integer(title=_("Number of unopen paths")),
8746 ]), TextAscii(title=_("WWID of the LUN")), "first")
8748 register_check_parameters(
8749 RulespecGroupCheckParametersStorage,
8750 "drbd",
8751 _("DR:BD roles and diskstates"),
8752 Dictionary(elements=[(
8753 "roles",
8754 Alternative(
8755 title=_("Roles"),
8756 elements=[
8757 FixedValue(None, totext="", title=_("Do not monitor")),
8758 ListOf(
8759 Tuple(
8760 orientation="horizontal",
8761 elements=[
8762 DropdownChoice(
8763 title=_("DRBD shows up as"),
8764 default_value="running",
8765 choices=[("primary_secondary", _("Primary / Secondary")
8766 ), ("primary_primary", _("Primary / Primary")
8767 ), ("secondary_primary", _("Secondary / Primary")
8768 ), ("secondary_secondary",
8769 _("Secondary / Secondary"))]),
8770 MonitoringState(title=_("Resulting state"),),
8772 default_value=("ignore", 0)),
8773 title=_("Set roles"),
8774 add_label=_("Add role rule"))
8775 ])),
8777 "diskstates",
8778 Alternative(
8779 title=_("Diskstates"),
8780 elements=[
8781 FixedValue(None, totext="", title=_("Do not monitor")),
8782 ListOf(
8783 Tuple(
8784 elements=[
8785 DropdownChoice(
8786 title=_("Diskstate"),
8787 choices=[
8788 ("primary_Diskless",
8789 _("Primary - Diskless")),
8790 ("primary_Attaching",
8791 _("Primary - Attaching")),
8792 ("primary_Failed", _("Primary - Failed")),
8793 ("primary_Negotiating",
8794 _("Primary - Negotiating")),
8795 ("primary_Inconsistent",
8796 _("Primary - Inconsistent")),
8797 ("primary_Outdated",
8798 _("Primary - Outdated")),
8799 ("primary_DUnknown",
8800 _("Primary - DUnknown")),
8801 ("primary_Consistent",
8802 _("Primary - Consistent")),
8803 ("primary_UpToDate",
8804 _("Primary - UpToDate")),
8805 ("secondary_Diskless",
8806 _("Secondary - Diskless")),
8807 ("secondary_Attaching",
8808 _("Secondary - Attaching")),
8809 ("secondary_Failed",
8810 _("Secondary - Failed")),
8811 ("secondary_Negotiating",
8812 _("Secondary - Negotiating")),
8813 ("secondary_Inconsistent",
8814 _("Secondary - Inconsistent")),
8815 ("secondary_Outdated",
8816 _("Secondary - Outdated")),
8817 ("secondary_DUnknown",
8818 _("Secondary - DUnknown")),
8819 ("secondary_Consistent",
8820 _("Secondary - Consistent")),
8821 ("secondary_UpToDate",
8822 _("Secondary - UpToDate")),
8824 MonitoringState(title=_("Resulting state"))
8826 orientation="horizontal",
8828 title=_("Set diskstates"),
8829 add_label=_("Add diskstate rule"))
8831 )]),
8832 TextAscii(title=_("DRBD device")),
8833 match_type="dict",
8836 register_check_parameters(
8837 RulespecGroupCheckParametersStorage,
8838 "snapvault",
8839 _("NetApp Snapvaults / Snapmirror Lag Time"),
8840 Dictionary(
8841 elements=
8843 "lag_time",
8844 Tuple(
8845 title=_("Default levels"),
8846 elements=[
8847 Age(title=_("Warning at")),
8848 Age(title=_("Critical at")),
8852 ("policy_lag_time",
8853 ListOf(
8854 Tuple(
8855 orientation="horizontal",
8856 elements=[
8857 TextAscii(title=_("Policy name")),
8858 Tuple(
8859 title=_("Maximum age"),
8860 elements=[
8861 Age(title=_("Warning at")),
8862 Age(title=_("Critical at")),
8866 title=_('Policy specific levels (Clustermode only)'),
8867 help=_(
8868 "Here you can specify levels for different policies which overrule the levels "
8869 "from the <i>Default levels</i> parameter. This setting only works in NetApp Clustermode setups."
8871 allow_empty=False,
8872 ))],),
8873 TextAscii(title=_("Source Path"), allow_empty=False),
8874 "dict",
8877 register_check_parameters(
8878 RulespecGroupCheckParametersStorage,
8879 "netapp_snapshots",
8880 _("NetApp Snapshot Reserve"),
8881 Dictionary(
8882 elements=[
8883 ("levels",
8884 Tuple(
8885 title=_("Levels for used configured reserve"),
8886 elements=[
8887 Percentage(title=_("Warning at or above"), unit="%", default_value=85.0),
8888 Percentage(title=_("Critical at or above"), unit="%", default_value=90.0),
8889 ])),
8890 ("state_noreserve", MonitoringState(title=_("State if no reserve is configured"),)),
8891 ],),
8892 TextAscii(title=_("Volume name")),
8893 match_type="dict",
8896 register_check_parameters(
8897 RulespecGroupCheckParametersStorage,
8898 "netapp_disks",
8899 _("Filer Disk Levels (NetApp, IBM SVC)"),
8900 Transform(
8901 Dictionary(
8902 elements=[
8903 ("failed_spare_ratio",
8904 Tuple(
8905 title=_("Failed to spare ratio"),
8906 help=_("You can set a limit to the failed to spare disk ratio. "
8907 "The ratio is calculated with <i>spare / (failed + spare)</i>."),
8908 elements=[
8909 Percentage(title=_("Warning at or above"), default_value=1.0),
8910 Percentage(title=_("Critical at or above"), default_value=50.0),
8911 ])),
8912 ("offline_spare_ratio",
8913 Tuple(
8914 title=_("Offline to spare ratio"),
8915 help=_("You can set a limit to the offline to spare disk ratio. "
8916 "The ratio is calculated with <i>spare / (offline + spare)</i>."),
8917 elements=[
8918 Percentage(title=_("Warning at or above"), default_value=1.0),
8919 Percentage(title=_("Critical at or above"), default_value=50.0),
8920 ])),
8921 ("number_of_spare_disks",
8922 Tuple(
8923 title=_("Number of spare disks"),
8924 help=_("You can set a lower limit to the absolute number of spare disks."),
8925 elements=[
8926 Integer(title=_("Warning below"), default_value=2, min_value=0),
8927 Integer(title=_("Critical below"), default_value=1, min_value=0),
8928 ])),
8929 ],),
8930 forth=
8931 lambda a: "broken_spare_ratio" in a and {"failed_spare_ratio": a["broken_spare_ratio"]} or a
8933 None,
8934 match_type="dict",
8937 register_check_parameters(
8938 RulespecGroupCheckParametersStorage,
8939 "netapp_volumes",
8940 _("NetApp Volumes"),
8941 Dictionary(elements=[
8942 ("levels",
8943 Alternative(
8944 title=_("Levels for volume"),
8945 show_alternative_title=True,
8946 default_value=(80.0, 90.0),
8947 match=match_dual_level_type,
8948 elements=[
8949 get_free_used_dynamic_valuespec("used", "volume"),
8950 Transform(
8951 get_free_used_dynamic_valuespec("free", "volume", default_value=(20.0, 10.0)),
8952 allow_empty=False,
8953 forth=transform_filesystem_free,
8954 back=transform_filesystem_free)
8955 ])),
8956 ("perfdata",
8957 ListChoice(
8958 title=_("Performance data for protocols"),
8959 help=_("Specify for which protocol performance data should get recorded."),
8960 choices=[
8961 ("", _("Summarized data of all protocols")),
8962 ("nfs", _("NFS")),
8963 ("cifs", _("CIFS")),
8964 ("san", _("SAN")),
8965 ("fcp", _("FCP")),
8966 ("iscsi", _("iSCSI")),
8969 ("magic",
8970 Float(
8971 title=_("Magic factor (automatic level adaptation for large volumes)"),
8972 default_value=0.8,
8973 minvalue=0.1,
8974 maxvalue=1.0)),
8975 ("magic_normsize",
8976 Integer(
8977 title=_("Reference size for magic factor"), default_value=20, minvalue=1, unit=_("GB"))
8979 ("levels_low",
8980 Tuple(
8981 title=_("Minimum levels if using magic factor"),
8982 help=_("The volume levels will never fall below these values, when using "
8983 "the magic factor and the volume is very small."),
8984 elements=[
8985 Percentage(
8986 title=_("Warning if above"),
8987 unit=_("% usage"),
8988 allow_int=True,
8989 default_value=50),
8990 Percentage(
8991 title=_("Critical if above"),
8992 unit=_("% usage"),
8993 allow_int=True,
8994 default_value=60)
8995 ])),
8996 ("inodes_levels",
8997 Alternative(
8998 title=_("Levels for Inodes"),
8999 help=_("The number of remaining inodes on the filesystem. "
9000 "Please note that this setting has no effect on some filesystem checks."),
9001 elements=[
9002 Tuple(
9003 title=_("Percentage free"),
9004 elements=[
9005 Percentage(title=_("Warning if less than")),
9006 Percentage(title=_("Critical if less than")),
9008 Tuple(
9009 title=_("Absolute free"),
9010 elements=[
9011 Integer(
9012 title=_("Warning if less than"),
9013 size=10,
9014 unit=_("inodes"),
9015 minvalue=0,
9016 default_value=10000),
9017 Integer(
9018 title=_("Critical if less than"),
9019 size=10,
9020 unit=_("inodes"),
9021 minvalue=0,
9022 default_value=5000),
9025 default_value=(10.0, 5.0),
9027 ("show_inodes",
9028 DropdownChoice(
9029 title=_("Display inode usage in check output..."),
9030 choices=[
9031 ("onproblem", _("Only in case of a problem")),
9032 ("onlow", _("Only in case of a problem or if inodes are below 50%")),
9033 ("always", _("Always")),
9035 default_value="onlow",
9037 ("trend_range",
9038 Optional(
9039 Integer(
9040 title=_("Time Range for filesystem trend computation"),
9041 default_value=24,
9042 minvalue=1,
9043 unit=_("hours")),
9044 title=_("Trend computation"),
9045 label=_("Enable trend computation"))),
9046 ("trend_mb",
9047 Tuple(
9048 title=_("Levels on trends in MB per time range"),
9049 elements=[
9050 Integer(title=_("Warning at"), unit=_("MB / range"), default_value=100),
9051 Integer(title=_("Critical at"), unit=_("MB / range"), default_value=200)
9052 ])),
9053 ("trend_perc",
9054 Tuple(
9055 title=_("Levels for the percentual growth per time range"),
9056 elements=[
9057 Percentage(
9058 title=_("Warning at"),
9059 unit=_("% / range"),
9060 default_value=5,
9062 Percentage(
9063 title=_("Critical at"),
9064 unit=_("% / range"),
9065 default_value=10,
9067 ])),
9068 ("trend_timeleft",
9069 Tuple(
9070 title=_("Levels on the time left until the filesystem gets full"),
9071 elements=[
9072 Integer(
9073 title=_("Warning if below"),
9074 unit=_("hours"),
9075 default_value=12,
9077 Integer(
9078 title=_("Critical if below"),
9079 unit=_("hours"),
9080 default_value=6,
9082 ])),
9083 ("trend_showtimeleft",
9084 Checkbox(
9085 title=_("Display time left in check output"),
9086 label=_("Enable"),
9087 help=_("Normally, the time left until the disk is full is only displayed when "
9088 "the configured levels have been breached. If you set this option "
9089 "the check always reports this information"))),
9090 ("trend_perfdata",
9091 Checkbox(
9092 title=_("Trend performance data"),
9093 label=_("Enable generation of performance data from trends"))),
9095 TextAscii(title=_("Volume name")),
9096 match_type="dict",
9099 register_check_parameters(
9100 RulespecGroupCheckParametersStorage,
9101 "netapp_luns",
9102 _("NetApp LUNs"),
9103 Dictionary(
9104 title=_("Configure levels for used space"),
9105 elements=[
9106 ("ignore_levels",
9107 FixedValue(
9108 title=_("Ignore used space (this option disables any other options)"),
9109 help=_(
9110 "Some luns, e.g. jfs formatted, tend to report incorrect used space values"),
9111 label=_("Ignore used space"),
9112 value=True,
9113 totext="",
9115 ("levels",
9116 Alternative(
9117 title=_("Levels for LUN"),
9118 show_alternative_title=True,
9119 default_value=(80.0, 90.0),
9120 match=match_dual_level_type,
9121 elements=[
9122 get_free_used_dynamic_valuespec("used", "LUN"),
9123 Transform(
9124 get_free_used_dynamic_valuespec("free", "LUN", default_value=(20.0, 10.0)),
9125 allow_empty=False,
9126 forth=transform_filesystem_free,
9127 back=transform_filesystem_free,
9129 ])),
9130 ("trend_range",
9131 Optional(
9132 Integer(
9133 title=_("Time Range for lun filesystem trend computation"),
9134 default_value=24,
9135 minvalue=1,
9136 unit=_("hours")),
9137 title=_("Trend computation"),
9138 label=_("Enable trend computation"))),
9139 ("trend_mb",
9140 Tuple(
9141 title=_("Levels on trends in MB per time range"),
9142 elements=[
9143 Integer(title=_("Warning at"), unit=_("MB / range"), default_value=100),
9144 Integer(title=_("Critical at"), unit=_("MB / range"), default_value=200)
9145 ])),
9146 ("trend_perc",
9147 Tuple(
9148 title=_("Levels for the percentual growth per time range"),
9149 elements=[
9150 Percentage(
9151 title=_("Warning at"),
9152 unit=_("% / range"),
9153 default_value=5,
9155 Percentage(
9156 title=_("Critical at"),
9157 unit=_("% / range"),
9158 default_value=10,
9160 ])),
9161 ("trend_timeleft",
9162 Tuple(
9163 title=_("Levels on the time left until the lun filesystem gets full"),
9164 elements=[
9165 Integer(
9166 title=_("Warning if below"),
9167 unit=_("hours"),
9168 default_value=12,
9170 Integer(
9171 title=_("Critical if below"),
9172 unit=_("hours"),
9173 default_value=6,
9175 ])),
9176 ("trend_showtimeleft",
9177 Checkbox(
9178 title=_("Display time left in check output"),
9179 label=_("Enable"),
9180 help=_(
9181 "Normally, the time left until the lun filesystem is full is only displayed when "
9182 "the configured levels have been breached. If you set this option "
9183 "the check always reports this information"))),
9184 ("trend_perfdata",
9185 Checkbox(
9186 title=_("Trend performance data"),
9187 label=_("Enable generation of performance data from trends"))),
9188 ("read_only",
9189 Checkbox(
9190 title=_("LUN is read-only"),
9191 help=_("Display a warning if a LUN is not read-only. Without "
9192 "this setting a warning will be displayed if a LUN is "
9193 "read-only."),
9194 label=_("Enable"))),
9196 TextAscii(title=_("LUN name")),
9197 match_type="dict",
9200 register_check_parameters(
9201 RulespecGroupCheckParametersApplications,
9202 "services",
9203 _("Windows Services"),
9204 Dictionary(elements=[
9205 ("additional_servicenames",
9206 ListOfStrings(
9207 title=_("Alternative names for the service"),
9208 help=_("Here you can specify alternative names that the service might have. "
9209 "This helps when the exact spelling of the services can changed from "
9210 "one version to another."),
9212 ("states",
9213 ListOf(
9214 Tuple(
9215 orientation="horizontal",
9216 elements=[
9217 DropdownChoice(
9218 title=_("Expected state"),
9219 default_value="running",
9220 choices=[(None,
9221 _("ignore the state")), ("running",
9222 _("running")), ("stopped",
9223 _("stopped"))]),
9224 DropdownChoice(
9225 title=_("Start type"),
9226 default_value="auto",
9227 choices=[
9228 (None, _("ignore the start type")),
9229 ("demand",
9230 _("demand")),
9231 ("disabled", _("disabled")),
9232 ("auto", _("auto")),
9233 ("unknown", _("unknown (old agent)")),
9235 MonitoringState(title=_("Resulting state"),),
9237 default_value=("running", "auto", 0)),
9238 title=_("Services states"),
9239 help=_("You can specify a separate monitoring state for each possible "
9240 "combination of service state and start type. If you do not use "
9241 "this parameter, then only running/auto will be assumed to be OK."),
9242 )), (
9243 "else",
9244 MonitoringState(
9245 title=_("State if no entry matches"),
9246 default_value=2,
9249 ('icon',
9250 UserIconOrAction(
9251 title=_("Add custom icon or action"),
9252 help=_("You can assign icons or actions to the found services in the status GUI."),
9255 TextAscii(
9256 title=_("Name of the service"),
9257 help=_("Please Please note, that the agent replaces spaces in "
9258 "the service names with underscores. If you are unsure about the "
9259 "correct spelling of the name then please look at the output of "
9260 "the agent (cmk -d HOSTNAME). The service names are in the first "
9261 "column of the section &lt;&lt;&lt;services&gt;&gt;&gt;. Please "
9262 "do not mix up the service name with the display name of the service."
9263 "The latter one is just being displayed as a further information."),
9264 allow_empty=False),
9265 match_type="dict",
9268 register_check_parameters(
9269 RulespecGroupCheckParametersApplications,
9270 "solaris_services",
9271 _("Solaris Services"),
9272 Dictionary(
9273 elements=[
9274 ("additional_servicenames",
9275 ListOfStrings(
9276 title=_("Alternative names for the service"),
9277 help=_("Here you can specify alternative names that the service might have. "
9278 "This helps when the exact spelling of the services can changed from "
9279 "one version to another."),
9281 ("states",
9282 ListOf(
9283 Tuple(
9284 orientation="horizontal",
9285 elements=[
9286 DropdownChoice(
9287 title=_("Expected state"),
9288 choices=[
9289 (None, _("Ignore the state")),
9290 ("online", _("Online")),
9291 ("disabled", _("Disabled")),
9292 ("maintenance", _("Maintenance")),
9293 ("legacy_run", _("Legacy run")),
9295 DropdownChoice(
9296 title=_("STIME"),
9297 choices=[
9298 (None, _("Ignore")),
9299 (True, _("Has changed")),
9300 (False, _("Did not changed")),
9302 MonitoringState(title=_("Resulting state"),),
9305 title=_("Services states"),
9306 help=_("You can specify a separate monitoring state for each possible "
9307 "combination of service state. If you do not use this parameter, "
9308 "then only online/legacy_run will be assumed to be OK."),
9310 ("else", MonitoringState(
9311 title=_("State if no entry matches"),
9312 default_value=2,
9314 ],),
9315 TextAscii(title=_("Name of the service"), allow_empty=False),
9316 match_type="dict",
9319 register_check_parameters(
9320 RulespecGroupCheckParametersApplications,
9321 "winperf_ts_sessions",
9322 _("Windows Terminal Server Sessions"),
9323 Dictionary(
9324 help=_("This check monitors number of active and inactive terminal "
9325 "server sessions."),
9326 elements=[
9328 "active",
9329 Tuple(
9330 title=_("Number of active sessions"),
9331 elements=[
9332 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
9333 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
9338 "inactive",
9339 Tuple(
9340 title=_("Number of inactive sessions"),
9341 help=_("Levels for the number of sessions that are currently inactive"),
9342 elements=[
9343 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
9344 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
9349 None,
9350 match_type="dict",
9353 register_check_parameters(
9354 RulespecGroupCheckParametersStorage, "raid", _("RAID: overall state"), None,
9355 TextAscii(
9356 title=_("Name of the device"),
9357 help=_("For Linux MD specify the device name without the "
9358 "<tt>/dev/</tt>, e.g. <tt>md0</tt>, for hardware raids "
9359 "please refer to the manual of the actual check being used.")), "first")
9361 register_check_parameters(
9362 RulespecGroupCheckParametersStorage, "raid_summary", _("RAID: summary state"),
9363 Dictionary(elements=[
9364 ("use_device_states",
9365 DropdownChoice(
9366 title=_("Use device states and overwrite expected status"),
9367 choices=[
9368 (False, _("Ignore")),
9369 (True, _("Use device states")),
9371 default_value=True,
9373 ]), None, "dict")
9375 register_check_parameters(
9376 RulespecGroupCheckParametersStorage, "raid_disk", _("RAID: state of a single disk"),
9377 Transform(
9378 Dictionary(elements=[
9380 "expected_state",
9381 TextAscii(
9382 title=_("Expected state"),
9383 help=_("State the disk is expected to be in. Typical good states "
9384 "are online, host spare, OK and the like. The exact way of how "
9385 "to specify a state depends on the check and hard type being used. "
9386 "Please take examples from discovered checks for reference.")),
9388 ("use_device_states",
9389 DropdownChoice(
9390 title=_("Use device states and overwrite expected status"),
9391 choices=[
9392 (False, _("Ignore")),
9393 (True, _("Use device states")),
9395 default_value=True,
9398 forth=lambda x: isinstance(x, str) and {"expected_state": x} or x,
9400 TextAscii(
9401 title=_("Number or ID of the disk"),
9402 help=_("How the disks are named depends on the type of hardware being "
9403 "used. Please look at already discovered checks for examples.")), "first")
9405 register_check_parameters(
9406 RulespecGroupCheckParametersStorage, "pfm_health", _("PCIe flash module"),
9407 Dictionary(
9408 elements=[
9410 "health_lifetime_perc",
9411 Tuple(
9412 title=_("Lower levels for health lifetime"),
9413 elements=[
9414 Percentage(title=_("Warning if below"), default_value=10),
9415 Percentage(title=_("Critical if below"), default_value=5)
9419 ],),
9420 TextAscii(
9421 title=_("Number or ID of the disk"),
9422 help=_("How the disks are named depends on the type of hardware being "
9423 "used. Please look at already discovered checks for examples.")), "dict")
9425 register_check_parameters(
9426 RulespecGroupCheckParametersEnvironment,
9427 "switch_contact",
9428 _("Switch contact state"),
9429 DropdownChoice(
9430 help=_("This rule sets the required state of a switch contact"),
9431 label=_("Required switch contact state"),
9432 choices=[
9433 ("open", "Switch contact is <b>open</b>"),
9434 ("closed", "Switch contact is <b>closed</b>"),
9435 ("ignore", "Ignore switch contact state"),
9438 TextAscii(title=_("Sensor"), allow_empty=False),
9439 match_type="first",
9442 register_check_parameters(
9443 RulespecGroupCheckParametersEnvironment,
9444 "plugs",
9445 _("State of PDU Plugs"),
9446 DropdownChoice(
9447 help=_("This rule sets the required state of a PDU plug. It is meant to "
9448 "be independent of the hardware manufacturer."),
9449 title=_("Required plug state"),
9450 choices=[
9451 ("on", _("Plug is ON")),
9452 ("off", _("Plug is OFF")),
9454 default_value="on"),
9455 TextAscii(
9456 title=_("Plug item number or name"),
9457 help=
9458 _("Whether you need the number or the name depends on the check. Just take a look to the service description."
9460 allow_empty=True),
9461 match_type="first",
9464 # New temperature rule for modern temperature checks that have the
9465 # sensor type (e.g. "CPU", "Chassis", etc.) as the beginning of their
9466 # item (e.g. "CPU 1", "Chassis 17/11"). This will replace all other
9467 # temperature rulesets in future. Note: those few temperature checks
9468 # that do *not* use an item, need to be converted to use one single
9469 # item (other than None).
9470 register_check_parameters(
9471 RulespecGroupCheckParametersEnvironment,
9472 "temperature",
9473 _("Temperature"),
9474 Transform(
9475 Dictionary(elements=[
9476 ("levels",
9477 Tuple(
9478 title=_("Upper Temperature Levels"),
9479 elements=[
9480 Float(title=_("Warning at"), unit=u"°C", default_value=26),
9481 Float(title=_("Critical at"), unit=u"°C", default_value=30),
9482 ])),
9483 ("levels_lower",
9484 Tuple(
9485 title=_("Lower Temperature Levels"),
9486 elements=[
9487 Float(title=_("Warning below"), unit=u"°C", default_value=0),
9488 Float(title=_("Critical below"), unit=u"°C", default_value=-10),
9489 ])),
9490 ("output_unit",
9491 DropdownChoice(
9492 title=_("Display values in "),
9493 choices=[
9494 ("c", _("Celsius")),
9495 ("f", _("Fahrenheit")),
9496 ("k", _("Kelvin")),
9497 ])),
9498 ("input_unit",
9499 DropdownChoice(
9500 title=_("Override unit of sensor"),
9501 help=_("In some rare cases the unit that is signalled by the sensor "
9502 "is wrong and e.g. the sensor sends values in Fahrenheit while "
9503 "they are misinterpreted as Celsius. With this setting you can "
9504 "force the reading of the sensor to be interpreted as customized. "),
9505 choices=[
9506 ("c", _("Celsius")),
9507 ("f", _("Fahrenheit")),
9508 ("k", _("Kelvin")),
9509 ])),
9510 ("device_levels_handling",
9511 DropdownChoice(
9512 title=_("Interpretation of the device's own temperature status"),
9513 choices=[
9514 ("usr", _("Ignore device's own levels")),
9515 ("dev", _("Only use device's levels, ignore yours")),
9516 ("best", _("Use least critical of your and device's levels")),
9517 ("worst", _("Use most critical of your and device's levels")),
9518 ("devdefault", _("Use device's levels if present, otherwise yours")),
9519 ("usrdefault", _("Use your own levels if present, otherwise the device's")),
9521 default_value="usrdefault",
9524 "trend_compute",
9525 Dictionary(
9526 title=_("Trend computation"),
9527 label=_("Enable trend computation"),
9528 elements=[
9529 ("period",
9530 Integer(
9531 title=_("Observation period for temperature trend computation"),
9532 default_value=30,
9533 minvalue=5,
9534 unit=_("minutes"))),
9535 ("trend_levels",
9536 Tuple(
9537 title=_("Levels on temperature increase per period"),
9538 elements=[
9539 Integer(
9540 title=_("Warning at"),
9541 unit=u"°C / " + _("period"),
9542 default_value=5),
9543 Integer(
9544 title=_("Critical at"),
9545 unit=u"°C / " + _("period"),
9546 default_value=10)
9547 ])),
9548 ("trend_levels_lower",
9549 Tuple(
9550 title=_("Levels on temperature decrease per period"),
9551 elements=[
9552 Integer(
9553 title=_("Warning at"),
9554 unit=u"°C / " + _("period"),
9555 default_value=5),
9556 Integer(
9557 title=_("Critical at"),
9558 unit=u"°C / " + _("period"),
9559 default_value=10)
9560 ])),
9561 ("trend_timeleft",
9562 Tuple(
9563 title=
9564 _("Levels on the time left until a critical temperature (upper or lower) is reached"
9566 elements=[
9567 Integer(
9568 title=_("Warning if below"),
9569 unit=_("minutes"),
9570 default_value=240,
9572 Integer(
9573 title=_("Critical if below"),
9574 unit=_("minutes"),
9575 default_value=120,
9579 optional_keys=["trend_levels", "trend_levels_lower", "trend_timeleft"],
9583 forth=lambda v: isinstance(v, tuple) and {"levels": v} or v,
9585 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
9586 "dict",
9589 register_check_parameters(
9590 RulespecGroupCheckParametersEnvironment,
9591 "room_temperature",
9592 _("Room temperature (external thermal sensors)"),
9593 Tuple(
9594 help=_("Temperature levels for external thermometers that are used "
9595 "for monitoring the temperature of a datacenter. An example "
9596 "is the webthem from W&T."),
9597 elements=[
9598 Integer(title=_("warning at"), unit=u"°C", default_value=26),
9599 Integer(title=_("critical at"), unit=u"°C", default_value=30),
9601 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
9602 "first",
9603 deprecated=True,
9606 register_check_parameters(
9607 RulespecGroupCheckParametersEnvironment,
9608 "hw_single_temperature",
9609 _("Host/Device temperature"),
9610 Tuple(
9611 help=_("Temperature levels for hardware devices with "
9612 "a single temperature sensor."),
9613 elements=[
9614 Integer(title=_("warning at"), unit=u"°C", default_value=35),
9615 Integer(title=_("critical at"), unit=u"°C", default_value=40),
9617 None,
9618 "first",
9619 deprecated=True,
9622 register_check_parameters(
9623 RulespecGroupCheckParametersEnvironment, "evolt",
9624 _("Voltage levels (UPS / PDU / Other Devices)"),
9625 Tuple(
9626 help=_("Voltage Levels for devices like UPS or PDUs. "
9627 "Several phases may be addressed independently."),
9628 elements=[
9629 Integer(title=_("warning if below"), unit="V", default_value=210),
9630 Integer(title=_("critical if below"), unit="V", default_value=180),
9632 TextAscii(title=_("Phase"),
9633 help=_("The identifier of the phase the power is related to.")), "first")
9635 register_check_parameters(
9636 RulespecGroupCheckParametersEnvironment, "efreq", _("Nominal Frequencies"),
9637 Tuple(
9638 help=_("Levels for the nominal frequencies of AC devices "
9639 "like UPSs or PDUs. Several phases may be addressed independently."),
9640 elements=[
9641 Integer(title=_("warning if below"), unit="Hz", default_value=40),
9642 Integer(title=_("critical if below"), unit="Hz", default_value=45),
9644 TextAscii(title=_("Phase"), help=_("The identifier of the phase the power is related to.")),
9645 "first")
9647 register_check_parameters(
9648 RulespecGroupCheckParametersEnvironment, "epower", _("Electrical Power"),
9649 Tuple(
9650 help=_("Levels for the electrical power consumption of a device "
9651 "like a UPS or a PDU. Several phases may be addressed independently."),
9652 elements=[
9653 Integer(title=_("warning if below"), unit="Watt", default_value=20),
9654 Integer(title=_("critical if below"), unit="Watt", default_value=1),
9656 TextAscii(title=_("Phase"), help=_("The identifier of the phase the power is related to.")),
9657 "first")
9659 register_check_parameters(
9660 RulespecGroupCheckParametersEnvironment, "ups_out_load",
9661 _("Parameters for output loads of UPSs and PDUs"),
9662 Tuple(elements=[
9663 Integer(title=_("warning at"), unit=u"%", default_value=85),
9664 Integer(title=_("critical at"), unit=u"%", default_value=90),
9665 ]), TextAscii(title=_("Phase"), help=_("The identifier of the phase the power is related to.")),
9666 "first")
9668 register_check_parameters(
9669 RulespecGroupCheckParametersEnvironment, "epower_single",
9670 _("Electrical Power for Devices with only one phase"),
9671 Tuple(
9672 help=_("Levels for the electrical power consumption of a device "),
9673 elements=[
9674 Integer(title=_("warning if at"), unit="Watt", default_value=300),
9675 Integer(title=_("critical if at"), unit="Watt", default_value=400),
9676 ]), None, "first")
9678 register_check_parameters(
9679 RulespecGroupCheckParametersEnvironment,
9680 "hw_temperature",
9681 _("Hardware temperature, multiple sensors"),
9682 Tuple(
9683 help=_("Temperature levels for hardware devices like "
9684 "Brocade switches with (potentially) several "
9685 "temperature sensors. Sensor IDs can be selected "
9686 "in the rule."),
9687 elements=[
9688 Integer(title=_("warning at"), unit=u"°C", default_value=35),
9689 Integer(title=_("critical at"), unit=u"°C", default_value=40),
9691 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
9692 "first",
9693 deprecated=True,
9696 register_check_parameters(
9697 RulespecGroupCheckParametersEnvironment,
9698 "hw_temperature_single",
9699 _("Hardware temperature, single sensor"),
9700 Tuple(
9701 help=_("Temperature levels for hardware devices like "
9702 "DELL Powerconnect that have just one temperature sensor. "),
9703 elements=[
9704 Integer(title=_("warning at"), unit=u"°C", default_value=35),
9705 Integer(title=_("critical at"), unit=u"°C", default_value=40),
9707 None,
9708 "first",
9709 deprecated=True,
9712 register_check_parameters(
9713 RulespecGroupCheckParametersEnvironment,
9714 "disk_temperature",
9715 _("Harddisk temperature (e.g. via SMART)"),
9716 Tuple(
9717 help=_("Temperature levels for hard disks, that is determined e.g. via SMART"),
9718 elements=[
9719 Integer(title=_("warning at"), unit=u"°C", default_value=35),
9720 Integer(title=_("critical at"), unit=u"°C", default_value=40),
9722 TextAscii(
9723 title=_("Hard disk device"),
9724 help=_("The identificator of the hard disk device, e.g. <tt>/dev/sda</tt>.")),
9725 "first",
9726 deprecated=True,
9729 register_check_parameters(
9730 RulespecGroupCheckParametersEnvironment, "eaton_enviroment",
9731 _("Temperature and Humidity for Eaton UPS"),
9732 Dictionary(elements=[
9733 ("temp",
9734 Tuple(
9735 title=_("Temperature"),
9736 elements=[
9737 Integer(title=_("warning at"), unit=u"°C", default_value=26),
9738 Integer(title=_("critical at"), unit=u"°C", default_value=30),
9739 ])),
9740 ("remote_temp",
9741 Tuple(
9742 title=_("Remote Temperature"),
9743 elements=[
9744 Integer(title=_("warning at"), unit=u"°C", default_value=26),
9745 Integer(title=_("critical at"), unit=u"°C", default_value=30),
9746 ])),
9747 ("humidity",
9748 Tuple(
9749 title=_("Humidity"),
9750 elements=[
9751 Integer(title=_("warning at"), unit=u"%", default_value=60),
9752 Integer(title=_("critical at"), unit=u"%", default_value=75),
9753 ])),
9754 ]), None, "dict")
9756 phase_elements = [
9757 ("voltage",
9758 Tuple(
9759 title=_("Voltage"),
9760 elements=[
9761 Integer(title=_("warning if below"), unit=u"V", default_value=210),
9762 Integer(title=_("critical if below"), unit=u"V", default_value=200),
9765 ("power",
9766 Tuple(
9767 title=_("Power"),
9768 elements=[
9769 Integer(title=_("warning at"), unit=u"W", default_value=1000),
9770 Integer(title=_("critical at"), unit=u"W", default_value=1200),
9773 ("appower",
9774 Tuple(
9775 title=_("Apparent Power"),
9776 elements=[
9777 Integer(title=_("warning at"), unit=u"VA", default_value=1100),
9778 Integer(title=_("critical at"), unit=u"VA", default_value=1300),
9781 ("current",
9782 Tuple(
9783 title=_("Current"),
9784 elements=[
9785 Integer(title=_("warning at"), unit=u"A", default_value=5),
9786 Integer(title=_("critical at"), unit=u"A", default_value=10),
9789 ("frequency",
9790 Tuple(
9791 title=_("Frequency"),
9792 elements=[
9793 Integer(title=_("warning if below"), unit=u"Hz", default_value=45),
9794 Integer(title=_("critical if below"), unit=u"Hz", default_value=40),
9795 Integer(title=_("warning if above"), unit=u"Hz", default_value=55),
9796 Integer(title=_("critical if above"), unit=u"Hz", default_value=60),
9799 ("differential_current_ac",
9800 Tuple(
9801 title=_("Differential current AC"),
9802 elements=[
9803 Float(title=_("warning at"), unit=u"mA", default_value=3.5),
9804 Float(title=_("critical at"), unit=u"mA", default_value=30),
9807 ("differential_current_dc",
9808 Tuple(
9809 title=_("Differential current DC"),
9810 elements=[
9811 Float(title=_("warning at"), unit=u"mA", default_value=70),
9812 Float(title=_("critical at"), unit=u"mA", default_value=100),
9817 register_check_parameters(
9818 RulespecGroupCheckParametersEnvironment, "ups_outphase",
9819 _("Parameters for output phases of UPSs and PDUs"),
9820 Dictionary(
9821 help=_("This rule allows you to specify levels for the voltage, current, load, power "
9822 "and apparent power of your device. The levels will only be applied if the device "
9823 "actually supplies values for these parameters."),
9824 elements=phase_elements + [
9825 ("load",
9826 Tuple(
9827 title=_("Load"),
9828 elements=[
9829 Integer(title=_("warning at"), unit=u"%", default_value=80),
9830 Integer(title=_("critical at"), unit=u"%", default_value=90),
9831 ])),
9832 ("map_device_states",
9833 ListOf(
9834 Tuple(elements=[TextAscii(size=10), MonitoringState()]),
9835 title=_("Map device state"),
9836 help=_("Here you can enter either device state number (eg. from SNMP devices) "
9837 "or exact device state name and the related monitoring state."),
9840 TextAscii(
9841 title=_("Output Name"),
9842 help=_("The name of the output, e.g. <tt>Phase 1</tt>/<tt>PDU 1</tt>")), "dict")
9844 register_check_parameters(
9845 RulespecGroupCheckParametersEnvironment, "el_inphase",
9846 _("Parameters for input phases of UPSs and PDUs"),
9847 Dictionary(
9848 help=_("This rule allows you to specify levels for the voltage, current, power "
9849 "and apparent power of your device. The levels will only be applied if the device "
9850 "actually supplies values for these parameters."),
9851 elements=phase_elements + [
9852 ("map_device_states",
9853 ListOf(
9854 Tuple(elements=[TextAscii(size=10), MonitoringState()]),
9855 title=_("Map device state"),
9856 help=_("Here you can enter either device state number (eg. from SNMP devices) "
9857 "or exact device state name and the related monitoring state."),
9860 ), TextAscii(title=_("Input Name"), help=_("The name of the input, e.g. <tt>Phase 1</tt>")),
9861 "dict")
9863 register_check_parameters(
9864 RulespecGroupCheckParametersEnvironment,
9865 "hw_fans",
9866 _("FAN speed of Hardware devices"),
9867 Dictionary(
9868 elements=[
9870 "lower",
9871 Tuple(
9872 help=_("Lower levels for the fan speed of a hardware device"),
9873 title=_("Lower levels"),
9874 elements=[
9875 Integer(title=_("warning if below"), unit=u"rpm"),
9876 Integer(title=_("critical if below"), unit=u"rpm"),
9880 "upper",
9881 Tuple(
9882 help=_("Upper levels for the fan speed of a hardware device"),
9883 title=_("Upper levels"),
9884 elements=[
9885 Integer(title=_("warning at"), unit=u"rpm", default_value=8000),
9886 Integer(title=_("critical at"), unit=u"rpm", default_value=8400),
9889 ("output_metrics",
9890 Checkbox(title=_("Performance data"), label=_("Enable performance data"))),
9892 optional_keys=["upper"],
9894 TextAscii(title=_("Fan Name"), help=_("The identificator of the fan.")),
9895 match_type="dict",
9898 register_check_parameters(
9899 RulespecGroupCheckParametersEnvironment,
9900 "hw_fans_perc",
9901 _("Fan speed of hardware devices (in percent)"),
9902 Dictionary(elements=[
9903 ("levels",
9904 Tuple(
9905 title=_("Upper fan speed levels"),
9906 elements=[
9907 Percentage(title=_("warning if at")),
9908 Percentage(title=_("critical if at")),
9909 ])),
9910 ("levels_lower",
9911 Tuple(
9912 title=_("Lower fan speed levels"),
9913 elements=[
9914 Percentage(title=_("warning if below")),
9915 Percentage(title=_("critical if below")),
9916 ])),
9918 TextAscii(title=_("Fan Name"), help=_("The identifier of the fan.")),
9919 "dict",
9922 register_check_parameters(
9923 RulespecGroupCheckParametersOperatingSystem,
9924 "pf_used_states",
9925 _("Number of used states of OpenBSD PF engine"),
9926 Dictionary(
9927 elements=[
9929 "used",
9930 Tuple(
9931 title=_("Limits for the number of used states"),
9932 elements=[
9933 Integer(title=_("warning at")),
9934 Integer(title=_("critical at")),
9938 optional_keys=[None],
9940 None,
9941 match_type="dict",
9944 register_check_parameters(
9945 RulespecGroupCheckParametersEnvironment,
9946 "pdu_gude",
9947 _("Levels for Gude PDU Devices"),
9948 Dictionary(elements=[
9949 ("kWh",
9950 Tuple(
9951 title=_("Total accumulated Active Energy of Power Channel"),
9952 elements=[
9953 Integer(title=_("warning at"), unit=_("kW")),
9954 Integer(title=_("critical at"), unit=_("kW")),
9955 ])),
9956 ("W",
9957 Tuple(
9958 title=_("Active Power"),
9959 elements=[
9960 Integer(title=_("warning at"), unit=_("W")),
9961 Integer(title=_("critical at"), unit=_("W")),
9962 ])),
9963 ("A",
9964 Tuple(
9965 title=_("Current on Power Channel"),
9966 elements=[
9967 Integer(title=_("warning at"), unit=_("A")),
9968 Integer(title=_("critical at"), unit=_("A")),
9969 ])),
9970 ("V",
9971 Tuple(
9972 title=_("Voltage on Power Channel"),
9973 elements=[
9974 Integer(title=_("warning if below"), unit=_("V")),
9975 Integer(title=_("critical if below"), unit=_("V")),
9976 ])),
9977 ("VA",
9978 Tuple(
9979 title=_("Line Mean Apparent Power"),
9980 elements=[
9981 Integer(title=_("warning at"), unit=_("VA")),
9982 Integer(title=_("critical at"), unit=_("VA")),
9983 ])),
9985 TextAscii(title=_("Phase Number"), help=_("The Number of the power Phase.")),
9986 match_type="dict",
9989 register_check_parameters(
9990 RulespecGroupCheckParametersEnvironment, "hostsystem_sensors", _("Hostsystem sensor alerts"),
9991 ListOf(
9992 Dictionary(
9993 help=_("This rule allows to override alert levels for the given sensor names."),
9994 elements=[
9995 ("name", TextAscii(title=_("Sensor name"))),
9996 ("states",
9997 Dictionary(
9998 title=_("Custom states"),
9999 elements=[(element,
10000 MonitoringState(
10001 title="Sensor %s" % description,
10002 label=_("Set state to"),
10003 default_value=int(element)))
10004 for (element, description) in [("0", _("OK")), (
10005 "1", _("WARNING")), ("2", _("CRITICAL")), ("3", _("UNKNOWN"))]],
10008 optional_keys=False),
10009 add_label=_("Add sensor name")), None, "first")
10011 register_check_parameters(
10012 RulespecGroupCheckParametersEnvironment, "netapp_instance", _("Netapp Instance State"),
10013 ListOf(
10014 Dictionary(
10015 help=_("This rule allows you to override netapp warnings"),
10016 elements=[("name", TextAscii(title=_("Warning starts with"))),
10017 ("state", MonitoringState(title="Set state to", default_value=1))],
10018 optional_keys=False),
10019 add_label=_("Add warning")), None, "first")
10021 register_check_parameters(
10022 RulespecGroupCheckParametersEnvironment,
10023 "temperature_auto",
10024 _("Temperature sensors with builtin levels"),
10025 None,
10026 TextAscii(title=_("Sensor ID"), help=_("The identificator of the thermal sensor.")),
10027 "first",
10028 deprecated=True,
10031 register_check_parameters(
10032 RulespecGroupCheckParametersEnvironment,
10033 "temperature_trends",
10034 _("Temperature trends for devices with builtin levels"),
10035 Dictionary(
10036 title=_("Temperature Trend Analysis"),
10037 help=_(
10038 "This rule enables and configures a trend analysis and corresponding limits for devices, "
10039 "which have their own limits configured on the device. It will only work for supported "
10040 "checks, right now the <tt>adva_fsp_temp</tt> check."),
10041 elements=[
10042 ("trend_range",
10043 Optional(
10044 Integer(
10045 title=_("Time range for temperature trend computation"),
10046 default_value=30,
10047 minvalue=5,
10048 unit=_("minutes")),
10049 title=_("Trend computation"),
10050 label=_("Enable trend computation"))),
10051 ("trend_c",
10052 Tuple(
10053 title=_("Levels on trends in degrees Celsius per time range"),
10054 elements=[
10055 Integer(title=_("Warning at"), unit=u"°C / " + _("range"), default_value=5),
10056 Integer(title=_("Critical at"), unit=u"°C / " + _("range"), default_value=10)
10057 ])),
10058 ("trend_timeleft",
10059 Tuple(
10060 title=_("Levels on the time left until limit is reached"),
10061 elements=[
10062 Integer(
10063 title=_("Warning if below"),
10064 unit=_("minutes"),
10065 default_value=240,
10067 Integer(
10068 title=_("Critical if below"),
10069 unit=_("minutes"),
10070 default_value=120,
10072 ])),
10074 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
10075 "dict",
10076 deprecated=True,
10078 ntp_params = Tuple(
10079 title=_("Thresholds for quality of time"),
10080 elements=[
10081 Integer(
10082 title=_("Critical at stratum"),
10083 default_value=10,
10084 help=_(
10085 "The stratum (\"distance\" to the reference clock) at which the check gets critical."
10088 Float(
10089 title=_("Warning at"),
10090 unit=_("ms"),
10091 default_value=200.0,
10092 help=_("The offset in ms at which a warning state is triggered."),
10094 Float(
10095 title=_("Critical at"),
10096 unit=_("ms"),
10097 default_value=500.0,
10098 help=_("The offset in ms at which a critical state is triggered."),
10102 register_check_parameters(
10103 RulespecGroupCheckParametersOperatingSystem, "ntp_time", _("State of NTP time synchronisation"),
10104 Transform(
10105 Dictionary(elements=[
10107 "ntp_levels",
10108 ntp_params,
10110 ("alert_delay",
10111 Tuple(
10112 title=_("Phases without synchronization"),
10113 elements=[
10114 Age(
10115 title=_("Warning at"),
10116 display=["hours", "minutes"],
10117 default_value=300,
10119 Age(
10120 title=_("Critical at"),
10121 display=["hours", "minutes"],
10122 default_value=3600,
10124 ])),
10126 forth=lambda params: isinstance(params, tuple) and {"ntp_levels": params} or params), None,
10127 "dict")
10129 register_check_parameters(RulespecGroupCheckParametersOperatingSystem, "ntp_peer",
10130 _("State of NTP peer"), ntp_params,
10131 TextAscii(title=_("Name of the peer")), "first")
10133 register_check_parameters(
10134 RulespecGroupCheckParametersEnvironment,
10135 "smoke",
10136 _("Smoke Detection"),
10137 Tuple(
10138 help=_("For devices which measure smoke in percent"),
10139 elements=[
10140 Percentage(title=_("Warning at"), allow_int=True, default_value=1),
10141 Percentage(title=_("Critical at"), allow_int=True, default_value=5),
10143 TextAscii(title=_("Sensor ID"), help=_("The identifier of the sensor.")),
10144 "first",
10147 register_check_parameters(
10148 RulespecGroupCheckParametersEnvironment,
10149 "apc_ats_output",
10150 _("APC Automatic Transfer Switch Output"),
10151 Dictionary(
10152 title=_("Levels for ATS Output parameters"),
10153 optional_keys=True,
10154 elements=[
10155 ("output_voltage_max",
10156 Tuple(
10157 title=_("Maximum Levels for Voltage"),
10158 elements=[
10159 Integer(title=_("Warning at"), unit="Volt"),
10160 Integer(title=_("Critical at"), unit="Volt"),
10161 ])),
10162 ("output_voltage_min",
10163 Tuple(
10164 title=_("Minimum Levels for Voltage"),
10165 elements=[
10166 Integer(title=_("Warning if below"), unit="Volt"),
10167 Integer(title=_("Critical if below"), unit="Volt"),
10168 ])),
10169 ("load_perc_max",
10170 Tuple(
10171 title=_("Maximum Levels for load in percent"),
10172 elements=[
10173 Percentage(title=_("Warning at")),
10174 Percentage(title=_("Critical at")),
10175 ])),
10176 ("load_perc_min",
10177 Tuple(
10178 title=_("Minimum Levels for load in percent"),
10179 elements=[
10180 Percentage(title=_("Warning if below")),
10181 Percentage(title=_("Critical if below")),
10182 ])),
10185 TextAscii(title=_("ID of phase")),
10186 "dict",
10189 register_check_parameters(
10190 RulespecGroupCheckParametersEnvironment,
10191 "airflow",
10192 _("Airflow levels"),
10193 Dictionary(
10194 title=_("Levels for airflow"),
10195 elements=[
10196 ("level_low",
10197 Tuple(
10198 title=_("Lower levels"),
10199 elements=[
10200 Float(
10201 title=_("Warning if below"),
10202 unit=_("l/s"),
10203 default_value=5.0,
10204 allow_int=True),
10205 Float(
10206 title=_("Critical if below"),
10207 unit=_("l/s"),
10208 default_value=2.0,
10209 allow_int=True)
10210 ])),
10211 ("level_high",
10212 Tuple(
10213 title=_("Upper levels"),
10214 elements=[
10215 Float(
10216 title=_("Warning at"), unit=_("l/s"), default_value=10.0, allow_int=True),
10217 Float(
10218 title=_("Critical at"), unit=_("l/s"), default_value=11.0, allow_int=True)
10219 ])),
10221 None,
10222 match_type="dict",
10225 register_check_parameters(
10226 RulespecGroupCheckParametersEnvironment,
10227 "ups_capacity",
10228 _("UPS Capacity"),
10229 Dictionary(
10230 title=_("Levels for battery parameters"),
10231 optional_keys=False,
10232 elements=[(
10233 "capacity",
10234 Tuple(
10235 title=_("Battery capacity"),
10236 elements=[
10237 Integer(
10238 title=_("Warning at"),
10239 help=
10240 _("The battery capacity in percent at and below which a warning state is triggered"
10242 unit="%",
10243 default_value=95,
10245 Integer(
10246 title=_("Critical at"),
10247 help=
10248 _("The battery capacity in percent at and below which a critical state is triggered"
10250 unit="%",
10251 default_value=90,
10257 "battime",
10258 Tuple(
10259 title=_("Time left on battery"),
10260 elements=[
10261 Integer(
10262 title=_("Warning at"),
10263 help=
10264 _("Time left on Battery at and below which a warning state is triggered"
10266 unit=_("min"),
10267 default_value=0,
10269 Integer(
10270 title=_("Critical at"),
10271 help=
10272 _("Time Left on Battery at and below which a critical state is triggered"
10274 unit=_("min"),
10275 default_value=0,
10281 None,
10282 match_type="dict",
10285 register_check_parameters(
10286 RulespecGroupCheckParametersApplications,
10287 "mbg_lantime_state",
10288 _("Meinberg Lantime State"),
10289 Dictionary(
10290 title=_("Meinberg Lantime State"),
10291 elements=[
10292 ("stratum",
10293 Tuple(
10294 title=_("Warning levels for Stratum"),
10295 elements=[
10296 Integer(
10297 title=_("Warning at"),
10298 default_value=2,
10300 Integer(
10301 title=_("Critical at"),
10302 default_value=3,
10304 ])),
10305 ("offset",
10306 Tuple(
10307 title=_("Warning levels for Time Offset"),
10308 elements=[
10309 Integer(
10310 title=_("Warning at"),
10311 unit=_("microseconds"),
10312 default_value=10,
10314 Integer(
10315 title=_("Critical at"),
10316 unit=_("microseconds"),
10317 default_value=20,
10319 ])),
10321 None,
10322 match_type="dict",
10325 register_check_parameters(
10326 RulespecGroupCheckParametersApplications, "sansymphony_pool", _("Sansymphony: pool allocation"),
10327 Tuple(
10328 help=_("This rule sets the warn and crit levels for the percentage of allocated pools"),
10329 elements=[
10330 Integer(
10331 title=_("Warning at"),
10332 unit=_("percent"),
10333 default_value=80,
10335 Integer(
10336 title=_("Critical at"),
10337 unit=_("percent"),
10338 default_value=90,
10340 ]), TextAscii(title=_("Name of the pool"),), "first")
10342 register_check_parameters(
10343 RulespecGroupCheckParametersApplications, "sansymphony_alerts",
10344 _("Sansymphony: Number of unacknowlegded alerts"),
10345 Tuple(
10346 help=_("This rule sets the warn and crit levels for the number of unacknowlegded alerts"),
10347 elements=[
10348 Integer(
10349 title=_("Warning at"),
10350 unit=_("alerts"),
10351 default_value=1,
10353 Integer(
10354 title=_("Critical at"),
10355 unit=_("alerts"),
10356 default_value=2,
10358 ]), None, "first")
10360 register_check_parameters(
10361 RulespecGroupCheckParametersApplications, "jvm_threads", _("JVM threads"),
10362 Tuple(
10363 help=_("This rule sets the warn and crit levels for the number of threads "
10364 "running in a JVM."),
10365 elements=[
10366 Integer(
10367 title=_("Warning at"),
10368 unit=_("threads"),
10369 default_value=80,
10371 Integer(
10372 title=_("Critical at"),
10373 unit=_("threads"),
10374 default_value=100,
10377 TextAscii(
10378 title=_("Name of the virtual machine"),
10379 help=_("The name of the application server"),
10380 allow_empty=False,
10381 ), "first")
10383 register_check_parameters(
10384 RulespecGroupCheckParametersApplications,
10385 "sym_brightmail_queues",
10386 "Symantec Brightmail Queues",
10387 Dictionary(
10388 help=_("This check is used to monitor successful email delivery through "
10389 "Symantec Brightmail Scanner appliances."),
10390 elements=[
10391 ("connections",
10392 Tuple(
10393 title=_("Number of connections"),
10394 elements=[
10395 Integer(title=_("Warning at")),
10396 Integer(title=_("Critical at")),
10397 ])),
10398 ("messageRate",
10399 Tuple(
10400 title=_("Number of messages delivered"),
10401 elements=[
10402 Integer(title=_("Warning at")),
10403 Integer(title=_("Critical at")),
10404 ])),
10405 ("dataRate",
10406 Tuple(
10407 title=_("Amount of data processed"),
10408 elements=[
10409 Integer(title=_("Warning at")),
10410 Integer(title=_("Cricital at")),
10411 ])),
10412 ("queuedMessages",
10413 Tuple(
10414 title=_("Number of messages currently queued"),
10415 elements=[
10416 Integer(title=_("Warning at")),
10417 Integer(title=_("Critical at")),
10418 ])),
10419 ("queueSize",
10420 Tuple(
10421 title=_("Size of the queue"),
10422 elements=[
10423 Integer(title=_("Warning at")),
10424 Integer(title=_("Critical at")),
10425 ])),
10426 ("deferredMessages",
10427 Tuple(
10428 title=_("Number of messages in deferred state"),
10429 elements=[
10430 Integer(title=_("Warning at")),
10431 Integer(title=_("Critical at")),
10432 ])),
10435 TextAscii(title=_("Instance name"), allow_empty=True),
10436 "dict",
10439 register_check_parameters(
10440 RulespecGroupCheckParametersApplications, "db2_logsize", _("DB2 logfile usage"),
10441 Dictionary(elements=[(
10442 "levels",
10443 Transform(
10444 get_free_used_dynamic_valuespec("free", "logfile", default_value=(20.0, 10.0)),
10445 title=_("Logfile levels"),
10446 allow_empty=False,
10447 forth=transform_filesystem_free,
10448 back=transform_filesystem_free))]),
10449 TextAscii(
10450 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
10451 "dict")
10453 register_check_parameters(
10454 RulespecGroupCheckParametersApplications,
10455 "db2_sortoverflow",
10456 _("DB2 Sort Overflow"),
10457 Dictionary(
10458 help=_("This rule allows you to set percentual limits for sort overflows."),
10459 elements=[
10461 "levels_perc",
10462 Tuple(
10463 title=_("Overflows"),
10464 elements=[
10465 Percentage(title=_("Warning at"), unit=_("%"), default_value=2.0),
10466 Percentage(title=_("Critical at"), unit=_("%"), default_value=4.0),
10471 TextAscii(
10472 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
10473 "dict",
10476 register_check_parameters(
10477 RulespecGroupCheckParametersApplications, "db2_tablespaces", _("DB2 Tablespaces"),
10478 Dictionary(
10479 help=_("A tablespace is a container for segments (tables, indexes, etc). A "
10480 "database consists of one or more tablespaces, each made up of one or "
10481 "more data files. Tables and indexes are created within a particular "
10482 "tablespace. "
10483 "This rule allows you to define checks on the size of tablespaces."),
10484 elements=db_levels_common,
10486 TextAscii(
10487 title=_("Instance"),
10488 help=_("The instance name, the database name and the tablespace name combined "
10489 "like this db2wps8:WPSCOMT8.USERSPACE1")), "dict")
10491 register_check_parameters(
10492 RulespecGroupCheckParametersApplications, "db2_connections", _("DB2 Connections"),
10493 Dictionary(
10494 help=_("This rule allows you to set limits for the maximum number of DB2 connections"),
10495 elements=[
10497 "levels_total",
10498 Tuple(
10499 title=_("Number of current connections"),
10500 elements=[
10501 Integer(title=_("Warning at"), unit=_("connections"), default_value=150),
10502 Integer(title=_("Critical at"), unit=_("connections"), default_value=200),
10507 TextAscii(
10508 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
10509 "dict")
10511 register_check_parameters(
10512 RulespecGroupCheckParametersApplications,
10513 "db2_counters",
10514 _("DB2 Counters"),
10515 Dictionary(
10516 help=_("This rule allows you to configure limits for the deadlocks and lockwaits "
10517 "counters of a DB2."),
10518 elements=[
10520 "deadlocks",
10521 Tuple(
10522 title=_("Deadlocks"),
10523 elements=[
10524 Float(title=_("Warning at"), unit=_("deadlocks/sec")),
10525 Float(title=_("Critical at"), unit=_("deadlocks/sec")),
10530 "lockwaits",
10531 Tuple(
10532 title=_("Lockwaits"),
10533 elements=[
10534 Float(title=_("Warning at"), unit=_("lockwaits/sec")),
10535 Float(title=_("Critical at"), unit=_("lockwaits/sec")),
10540 TextAscii(
10541 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
10542 "dict",
10545 register_check_parameters(
10546 RulespecGroupCheckParametersApplications, "db2_backup",
10547 _("DB2 Time since last database Backup"),
10548 Optional(
10549 Tuple(elements=[
10550 Age(title=_("Warning at"),
10551 display=["days", "hours", "minutes"],
10552 default_value=86400 * 14),
10553 Age(title=_("Critical at"),
10554 display=["days", "hours", "minutes"],
10555 default_value=86400 * 28)
10557 title=_("Specify time since last successful backup"),
10559 TextAscii(
10560 title=_("Instance"),
10561 help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")), "first")
10563 register_check_parameters(
10564 RulespecGroupCheckParametersApplications, "db2_mem", _("Memory levels for DB2 memory usage"),
10565 Tuple(
10566 elements=[
10567 Percentage(title=_("Warning if less than"), unit=_("% memory left")),
10568 Percentage(title=_("Critical if less than"), unit=_("% memory left")),
10569 ],), TextAscii(title=_("Instance name"), allow_empty=True), "first")
10571 register_check_parameters(
10572 RulespecGroupCheckParametersApplications, "windows_updates", _("WSUS (Windows Updates)"),
10573 Tuple(
10574 title=_("Parameters for the Windows Update Check with WSUS"),
10575 help=_("Set the according numbers to 0 if you want to disable alerting."),
10576 elements=[
10577 Integer(title=_("Warning if at least this number of important updates are pending")),
10578 Integer(title=_("Critical if at least this number of important updates are pending")),
10579 Integer(title=_("Warning if at least this number of optional updates are pending")),
10580 Integer(title=_("Critical if at least this number of optional updates are pending")),
10581 Age(title=_("Warning if time until forced reboot is less then"), default_value=604800),
10582 Age(title=_("Critical if time time until forced reboot is less then"),
10583 default_value=172800),
10584 Checkbox(title=_("display all important updates verbosely"), default_value=True),
10586 ), None, "first")
10588 synology_update_states = [
10589 (1, "Available"),
10590 (2, "Unavailable"),
10591 (4, "Disconnected"),
10592 (5, "Others"),
10595 register_check_parameters(
10596 RulespecGroupCheckParametersApplications,
10597 "synology_update",
10598 _("Synology Updates"),
10599 Dictionary(
10600 title=_("Update State"),
10601 elements=[
10602 ("ok_states",
10603 ListChoice(
10604 title=_("States which result in OK"),
10605 choices=synology_update_states,
10606 default_value=[2])),
10607 ("warn_states",
10608 ListChoice(
10609 title=_("States which result in Warning"),
10610 choices=synology_update_states,
10611 default_value=[5])),
10612 ("crit_states",
10613 ListChoice(
10614 title=_("States which result in Critical"),
10615 choices=synology_update_states,
10616 default_value=[1, 4])),
10618 optional_keys=None,
10620 None,
10621 match_type="dict",
10624 register_check_parameters(
10625 RulespecGroupCheckParametersApplications, "antivir_update_age",
10626 _("Age of last AntiVirus update"),
10627 Tuple(
10628 title=_("Age of last AntiVirus update"),
10629 elements=[
10630 Age(title=_("Warning level for time since last update")),
10631 Age(title=_("Critical level for time since last update")),
10632 ]), None, "first")
10634 register_check_parameters(RulespecGroupCheckParametersApplications,
10635 "logwatch_ec",
10636 _('Logwatch Event Console Forwarding'),
10637 Alternative(
10638 title = _("Forwarding"),
10639 help = _("Instead of using the regular logwatch check all lines received by logwatch can "
10640 "be forwarded to a Check_MK event console daemon to be processed. The target event "
10641 "console can be configured for each host in a separate rule."),
10642 style = "dropdown",
10643 elements = [
10644 FixedValue(
10646 totext = _("Messages are handled by logwatch."),
10647 title = _("No forwarding"),
10649 Dictionary(
10650 title = _('Forward Messages to Event Console'),
10651 elements = [
10652 ('method', Transform(
10653 # TODO: Clean this up to some CascadingDropdown()
10654 Alternative(
10655 style = "dropdown",
10656 title = _("Forwarding Method"),
10657 elements = [
10658 FixedValue(
10660 title = _("Local: Send events to local Event Console in same OMD site"),
10661 totext = _("Directly forward to Event Console"),
10663 TextAscii(
10664 title = _("Local: Send events to local Event Console into unix socket"),
10665 allow_empty = False,
10668 FixedValue(
10669 "spool:",
10670 title = _("Local: Spooling - Send events to local event console in same OMD site"),
10671 totext = _("Spool to Event Console"),
10673 Transform(
10674 TextAscii(),
10675 title = _("Local: Spooling - Send events to local Event Console into given spool directory"),
10676 allow_empty = False,
10677 forth = lambda x: x[6:], # remove prefix
10678 back = lambda x: "spool:" + x, # add prefix
10680 CascadingDropdown(
10681 title = _("Remote: Send events to remote syslog host"),
10682 choices = [
10683 ("tcp", _("Send via TCP"), Dictionary(
10684 elements = [
10685 ("address", TextAscii(
10686 title = _("Address"),
10687 allow_empty = False,
10689 ("port", Integer(
10690 title = _("Port"),
10691 allow_empty = False,
10692 default_value = 514,
10693 minvalue = 1,
10694 maxvalue = 65535,
10695 size = 6,
10697 ("spool", Dictionary(
10698 title = _("Spool messages that could not be sent"),
10699 help = _("Messages that can not be forwarded, e.g. when the target Event Console is "
10700 "not running, can temporarily be stored locally. Forwarding is tried again "
10701 "on next execution. When messages are spooled, the check will go into WARNING "
10702 "state. In case messages are dropped by the rules below, the check will shortly "
10703 "go into CRITICAL state for this execution."),
10704 elements = [
10705 ("max_age", Age(
10706 title = _("Maximum spool duration"),
10707 help = _("Messages that are spooled longer than this time will be thrown away."),
10708 default_value = 60*60*24*7, # 1 week should be fine (if size is not exceeded)
10710 ("max_size", Filesize(
10711 title = _("Maximum spool size"),
10712 help = _("When the total size of spooled messages exceeds this number, the oldest "
10713 "messages of the currently spooled messages is thrown away until the left "
10714 "messages have the half of the maximum size."),
10715 default_value = 500000, # do not save more than 500k of message
10718 optional_keys = [],
10721 optional_keys = [ "spool" ],
10723 ("udp", _("Send via UDP"), Dictionary(
10724 elements = [
10725 ("address", TextAscii(
10726 title = _("Address"),
10727 allow_empty = False,
10729 ("port", Integer(
10730 title = _("Port"),
10731 allow_empty = False,
10732 default_value = 514,
10733 minvalue = 1,
10734 maxvalue = 65535,
10735 size = 6,
10738 optional_keys = [],
10743 match = lambda x: 4 if isinstance(x, tuple) else (0 if not x else (2 if x == 'spool:' else (3 if x.startswith('spool:') else 1)))
10745 # migrate old (tcp, address, port) tuple to new dict
10746 forth = lambda v: (v[0], {"address": v[1], "port": v[2]}) if (isinstance(v, tuple) and not isinstance(v[1], dict)) else v,
10748 ('facility', DropdownChoice(
10749 title = _("Syslog facility for forwarded messages"),
10750 help = _("When forwarding messages and no facility can be extracted from the "
10751 "message this facility is used."),
10752 choices = mkeventd.syslog_facilities,
10753 default_value = 17, # local1
10755 ('restrict_logfiles',
10756 ListOfStrings(
10757 title = _('Restrict Logfiles (Prefix matching regular expressions)'),
10758 help = _("Put the item names of the logfiles here. For example \"System$\" "
10759 "to select the service \"LOG System\". You can use regular expressions "
10760 "which must match the beginning of the logfile name."),
10763 ('monitor_logfilelist',
10764 Checkbox(
10765 title = _("Monitoring of forwarded logfiles"),
10766 label = _("Warn if list of forwarded logfiles changes"),
10767 help = _("If this option is enabled, the check monitors the list of forwarded "
10768 "logfiles and will warn you if at any time a logfile is missing or exceeding "
10769 "when compared to the initial list that was snapshotted during service detection. "
10770 "Reinventorize this check in order to make it OK again."),
10773 ('expected_logfiles',
10774 ListOfStrings(
10775 title = _("List of expected logfiles"),
10776 help = _("When the monitoring of forwarded logfiles is enabled, the check verifies that "
10777 "all of the logfiles listed here are reported by the monitored system."),
10780 ('logwatch_reclassify',
10781 Checkbox(
10782 title = _("Reclassify messages before forwarding them to the EC"),
10783 label = _("Apply logwatch patterns"),
10784 help = _("If this option is enabled, the logwatch lines are first reclassified by the logwatch "
10785 "patterns before they are sent to the event console. If you reclassify specific lines to "
10786 "IGNORE they are not forwarded to the event console. This takes the burden from the "
10787 "event console to process the message itself through all of its rulesets. The reclassifcation "
10788 "of each line takes into account from which logfile the message originates. So you can create "
10789 "logwatch reclassification rules specifically designed for a logfile <i>access.log</i>, "
10790 "which do not apply to other logfiles."),
10793 ('separate_checks',
10794 Checkbox(
10795 title = _("Create a separate check for each logfile"),
10796 label = _("Separate check"),
10797 help = _("If this option is enabled, there will be one separate check for each logfile found during "
10798 "the service discovery. This option also changes the behaviour for unknown logfiles. "
10799 "The default logwatch check forwards all logfiles to the event console, even logfiles "
10800 "which were not known during the service discovery. Creating one check per logfile changes "
10801 "this behaviour so that any data from unknown logfiles is discarded."),
10805 optional_keys = ['restrict_logfiles', 'expected_logfiles', 'logwatch_reclassify', 'separate_checks'],
10808 default_value = '',
10810 None,
10811 'first',
10814 register_rule(
10815 RulespecGroupCheckParametersApplications,
10816 varname="logwatch_groups",
10817 title=_('Logfile Grouping Patterns'),
10818 help=_('The check <tt>logwatch</tt> normally creates one service for each logfile. '
10819 'By defining grouping patterns you can switch to the check <tt>logwatch.groups</tt>. '
10820 'If the pattern begins with a tilde then this pattern is interpreted as a regular '
10821 'expression instead of as a filename globbing pattern and <tt>*</tt> and <tt>?</tt> '
10822 'are treated differently. '
10823 'That check monitors a list of logfiles at once. This is useful if you have '
10824 'e.g. a folder with rotated logfiles where the name of the current logfile'
10825 'also changes with each rotation'),
10826 valuespec=ListOf(
10827 Tuple(
10828 help=_("This defines one logfile grouping pattern"),
10829 show_titles=True,
10830 orientation="horizontal",
10831 elements=[
10832 TextAscii(title=_("Name of group"),),
10833 Tuple(
10834 show_titles=True,
10835 orientation="vertical",
10836 elements=[
10837 TextAscii(title=_("Include Pattern")),
10838 TextAscii(title=_("Exclude Pattern"))
10843 add_label=_("Add pattern group"),
10845 match='all',
10848 register_rule(
10849 RulespecGroupCheckParametersNetworking,
10850 "if_disable_if64_hosts",
10851 title=_("Hosts forced to use <tt>if</tt> instead of <tt>if64</tt>"),
10852 help=_("A couple of switches with broken firmware report that they "
10853 "support 64 bit counters but do not output any actual data "
10854 "in those counters. Listing those hosts in this rule forces "
10855 "them to use the interface check with 32 bit counters instead."))
10857 # wmic_process does not support inventory at the moment
10858 register_check_parameters(
10859 RulespecGroupCheckParametersApplications, "wmic_process",
10860 _("Memory and CPU of processes on Windows"),
10861 Tuple(
10862 elements=[
10863 TextAscii(
10864 title=_("Name of the process"),
10865 allow_empty=False,
10867 Integer(title=_("Memory warning at"), unit="MB"),
10868 Integer(title=_("Memory critical at"), unit="MB"),
10869 Integer(title=_("Pagefile warning at"), unit="MB"),
10870 Integer(title=_("Pagefile critical at"), unit="MB"),
10871 Percentage(title=_("CPU usage warning at")),
10872 Percentage(title=_("CPU usage critical at")),
10873 ],),
10874 TextAscii(
10875 title=_("Process name for usage in the Nagios service description"), allow_empty=False),
10876 "first", False)
10878 register_check_parameters(
10879 RulespecGroupCheckParametersOperatingSystem,
10880 "zypper",
10881 _("Zypper Updates"),
10882 None,
10883 None,
10884 match_type="first",
10887 register_check_parameters(
10888 RulespecGroupCheckParametersOperatingSystem,
10889 "apt",
10890 _("APT Updates"),
10891 Dictionary(elements=[
10892 ("normal",
10893 MonitoringState(
10894 title=_("State when normal updates are pending"),
10895 default_value=1,
10897 ("security",
10898 MonitoringState(
10899 title=_("State when security updates are pending"),
10900 default_value=2,
10903 None,
10904 match_type="dict",
10907 register_check_parameters(
10908 RulespecGroupCheckParametersEnvironment, "airflow_deviation", _("Airflow Deviation in Percent"),
10909 Tuple(
10910 help=_("Levels for Airflow Deviation measured at airflow sensors "),
10911 elements=[
10912 Float(title=_("critical if below or equal"), unit=u"%", default_value=-20),
10913 Float(title=_("warning if below or equal"), unit=u"%", default_value=-20),
10914 Float(title=_("warning if above or equal"), unit=u"%", default_value=20),
10915 Float(title=_("critical if above or equal"), unit=u"%", default_value=20),
10916 ]), TextAscii(title=_("Detector ID"), help=_("The identifier of the detector.")), "first")
10918 register_check_parameters(
10919 RulespecGroupCheckParametersApplications,
10920 "citrix_load",
10921 _("Load of Citrix Server"),
10922 Transform(
10923 Tuple(
10924 title=_("Citrix Server load"),
10925 elements=[
10926 Percentage(title=_("Warning at"), default_value=85.0, unit="percent"),
10927 Percentage(title=_("Critical at"), default_value=95.0, unit="percent"),
10929 forth=lambda x: (x[0] / 100.0, x[1] / 100.0),
10930 back=lambda x: (int(x[0] * 100), int(x[1] * 100))),
10931 None,
10932 match_type="first",
10935 register_check_parameters(
10936 RulespecGroupCheckParametersNetworking, "adva_ifs", _("Adva Optical Transport Laser Power"),
10937 Dictionary(elements=[
10938 ("limits_output_power",
10939 Tuple(
10940 title=_("Sending Power"),
10941 elements=[
10942 Float(title=_("lower limit"), unit="dBm"),
10943 Float(title=_("upper limit"), unit="dBm"),
10944 ])),
10945 ("limits_input_power",
10946 Tuple(
10947 title=_("Received Power"),
10948 elements=[
10949 Float(title=_("lower limit"), unit="dBm"),
10950 Float(title=_("upper limit"), unit="dBm"),
10951 ])),
10952 ]), TextAscii(
10953 title=_("Interface"),
10954 allow_empty=False,
10955 ), "dict")
10957 bluecat_operstates = [
10958 (1, "running normally"),
10959 (2, "not running"),
10960 (3, "currently starting"),
10961 (4, "currently stopping"),
10962 (5, "fault"),
10965 register_check_parameters(
10966 RulespecGroupCheckParametersNetworking,
10967 "bluecat_ntp",
10968 _("Bluecat NTP Settings"),
10969 Dictionary(elements=[
10970 ("oper_states",
10971 Dictionary(
10972 title=_("Operations States"),
10973 elements=[
10974 ("warning",
10975 ListChoice(
10976 title=_("States treated as warning"),
10977 choices=bluecat_operstates,
10978 default_value=[2, 3, 4],
10980 ("critical",
10981 ListChoice(
10982 title=_("States treated as critical"),
10983 choices=bluecat_operstates,
10984 default_value=[5],
10987 required_keys=['warning', 'critical'],
10989 ("stratum",
10990 Tuple(
10991 title=_("Levels for Stratum "),
10992 elements=[
10993 Integer(title=_("Warning at")),
10994 Integer(title=_("Critical at")),
10995 ])),
10997 None,
10998 match_type="dict",
11001 register_check_parameters(
11002 RulespecGroupCheckParametersNetworking,
11003 "bluecat_dhcp",
11004 _("Bluecat DHCP Settings"),
11005 Dictionary(
11006 elements=[
11007 ("oper_states",
11008 Dictionary(
11009 title=_("Operations States"),
11010 elements=[
11011 ("warning",
11012 ListChoice(
11013 title=_("States treated as warning"),
11014 choices=bluecat_operstates,
11015 default_value=[2, 3, 4],
11017 ("critical",
11018 ListChoice(
11019 title=_("States treated as critical"),
11020 choices=bluecat_operstates,
11021 default_value=[5],
11024 required_keys=['warning', 'critical'],
11027 required_keys=['oper_states'], # There is only one value, so its required
11029 None,
11030 match_type="dict",
11033 register_check_parameters(
11034 RulespecGroupCheckParametersNetworking,
11035 "bluecat_command_server",
11036 _("Bluecat Command Server Settings"),
11037 Dictionary(
11038 elements=[
11039 ("oper_states",
11040 Dictionary(
11041 title=_("Operations States"),
11042 elements=[
11043 ("warning",
11044 ListChoice(
11045 title=_("States treated as warning"),
11046 choices=bluecat_operstates,
11047 default_value=[2, 3, 4],
11049 ("critical",
11050 ListChoice(
11051 title=_("States treated as critical"),
11052 choices=bluecat_operstates,
11053 default_value=[5],
11056 required_keys=['warning', 'critical'],
11059 required_keys=['oper_states'], # There is only one value, so its required
11061 None,
11062 match_type="dict",
11065 register_check_parameters(
11066 RulespecGroupCheckParametersNetworking,
11067 "bluecat_dns",
11068 _("Bluecat DNS Settings"),
11069 Dictionary(
11070 elements=[
11071 ("oper_states",
11072 Dictionary(
11073 title=_("Operations States"),
11074 elements=[
11075 ("warning",
11076 ListChoice(
11077 title=_("States treated as warning"),
11078 choices=bluecat_operstates,
11079 default_value=[2, 3, 4],
11081 ("critical",
11082 ListChoice(
11083 title=_("States treated as critical"),
11084 choices=bluecat_operstates,
11085 default_value=[5],
11088 required_keys=['warning', 'critical'],
11091 required_keys=['oper_states'], # There is only one value, so its required
11093 None,
11094 match_type="dict",
11097 bluecat_ha_operstates = [
11098 (1, "standalone"),
11099 (2, "active"),
11100 (3, "passiv"),
11101 (4, "stopped"),
11102 (5, "stopping"),
11103 (6, "becoming active"),
11104 (7, "becomming passive"),
11105 (8, "fault"),
11108 register_check_parameters(
11109 RulespecGroupCheckParametersNetworking,
11110 "bluecat_ha",
11111 _("Bluecat HA Settings"),
11112 Dictionary(
11113 elements=[
11114 ("oper_states",
11115 Dictionary(
11116 title=_("Operations States"),
11117 elements=[
11119 "warning",
11120 ListChoice(
11121 title=_("States treated as warning"),
11122 choices=bluecat_ha_operstates,
11123 default_value=[5, 6, 7],
11127 "critical",
11128 ListChoice(
11129 title=_("States treated as critical"),
11130 choices=bluecat_ha_operstates,
11131 default_value=[8, 4],
11135 required_keys=['warning', 'critical'],
11138 required_keys=['oper_states'], # There is only one value, so its required
11140 None,
11141 match_type="dict",
11144 register_check_parameters(
11145 RulespecGroupCheckParametersNetworking,
11146 "steelhead_connections",
11147 _("Steelhead connections"),
11148 Dictionary(
11149 elements=[
11150 ("total",
11151 Tuple(
11152 title=_("Levels for total amount of connections"),
11153 elements=[
11154 Integer(title=_("Warning at")),
11155 Integer(title=_("Critical at")),
11158 ("optimized",
11159 Tuple(
11160 title=_("Levels for optimized connections"),
11161 elements=[
11162 Integer(title=_("Warning at")),
11163 Integer(title=_("Critical at")),
11166 ("passthrough",
11167 Tuple(
11168 title=_("Levels for passthrough connections"),
11169 elements=[
11170 Integer(title=_("Warning at")),
11171 Integer(title=_("Critical at")),
11174 ("halfOpened",
11175 Tuple(
11176 title=_("Levels for half opened connections"),
11177 elements=[
11178 Integer(title=_("Warning at")),
11179 Integer(title=_("Critical at")),
11182 ("halfClosed",
11183 Tuple(
11184 title=_("Levels for half closed connections"),
11185 elements=[
11186 Integer(title=_("Warning at")),
11187 Integer(title=_("Critical at")),
11190 ("established",
11191 Tuple(
11192 title=_("Levels for established connections"),
11193 elements=[
11194 Integer(title=_("Warning at")),
11195 Integer(title=_("Critical at")),
11198 ("active",
11199 Tuple(
11200 title=_("Levels for active connections"),
11201 elements=[
11202 Integer(title=_("Warning at")),
11203 Integer(title=_("Critical at")),
11206 ],),
11207 None,
11208 "dict",
11211 register_check_parameters(
11212 RulespecGroupCheckParametersStorage,
11213 "fc_port",
11214 _("FibreChannel Ports (FCMGMT MIB)"),
11215 Dictionary(elements=[
11216 ("bw",
11217 Alternative(
11218 title=_("Throughput levels"),
11219 help=_("Please note: in a few cases the automatic detection of the link speed "
11220 "does not work. In these cases you have to set the link speed manually "
11221 "below if you want to monitor percentage values"),
11222 elements=[
11223 Tuple(
11224 title=_("Used bandwidth of port relative to the link speed"),
11225 elements=[
11226 Percentage(title=_("Warning at"), unit=_("percent")),
11227 Percentage(title=_("Critical at"), unit=_("percent")),
11229 Tuple(
11230 title=_("Used Bandwidth of port in megabyte/s"),
11231 elements=[
11232 Integer(title=_("Warning at"), unit=_("MByte/s")),
11233 Integer(title=_("Critical at"), unit=_("MByte/s")),
11235 ])),
11236 ("assumed_speed",
11237 Float(
11238 title=_("Assumed link speed"),
11239 help=_("If the automatic detection of the link speed does "
11240 "not work you can set the link speed here."),
11241 unit=_("Gbit/s"))),
11242 ("rxcrcs",
11243 Tuple(
11244 title=_("CRC errors rate"),
11245 elements=[
11246 Percentage(title=_("Warning at"), unit=_("percent")),
11247 Percentage(title=_("Critical at"), unit=_("percent")),
11248 ])),
11249 ("rxencoutframes",
11250 Tuple(
11251 title=_("Enc-Out frames rate"),
11252 elements=[
11253 Percentage(title=_("Warning at"), unit=_("percent")),
11254 Percentage(title=_("Critical at"), unit=_("percent")),
11255 ])),
11256 ("notxcredits",
11257 Tuple(
11258 title=_("No-TxCredits errors"),
11259 elements=[
11260 Percentage(title=_("Warning at"), unit=_("percent")),
11261 Percentage(title=_("Critical at"), unit=_("percent")),
11262 ])),
11263 ("c3discards",
11264 Tuple(
11265 title=_("C3 discards"),
11266 elements=[
11267 Percentage(title=_("Warning at"), unit=_("percent")),
11268 Percentage(title=_("Critical at"), unit=_("percent")),
11269 ])),
11270 ("average",
11271 Integer(
11272 title=_("Averaging"),
11273 help=_("If this parameter is set, all throughputs will be averaged "
11274 "over the specified time interval before levels are being applied. Per "
11275 "default, averaging is turned off. "),
11276 unit=_("minutes"),
11277 minvalue=1,
11278 default_value=5,
11280 # ("phystate",
11281 # Optional(
11282 # ListChoice(
11283 # title = _("Allowed states (otherwise check will be critical)"),
11284 # choices = [ (1, _("unknown") ),
11285 # (2, _("failed") ),
11286 # (3, _("bypassed") ),
11287 # (4, _("active") ),
11288 # (5, _("loopback") ),
11289 # (6, _("txfault") ),
11290 # (7, _("nomedia") ),
11291 # (8, _("linkdown") ),
11293 # ),
11294 # title = _("Physical state of port") ,
11295 # negate = True,
11296 # label = _("ignore physical state"),
11298 # ),
11299 # ("opstate",
11300 # Optional(
11301 # ListChoice(
11302 # title = _("Allowed states (otherwise check will be critical)"),
11303 # choices = [ (1, _("unknown") ),
11304 # (2, _("unused") ),
11305 # (3, _("ready") ),
11306 # (4, _("warning") ),
11307 # (5, _("failure") ),
11308 # (6, _("not participating") ),
11309 # (7, _("initializing") ),
11310 # (8, _("bypass") ),
11311 # (9, _("ols") ),
11313 # ),
11314 # title = _("Operational state") ,
11315 # negate = True,
11316 # label = _("ignore operational state"),
11318 # ),
11319 # ("admstate",
11320 # Optional(
11321 # ListChoice(
11322 # title = _("Allowed states (otherwise check will be critical)"),
11323 # choices = [ (1, _("unknown") ),
11324 # (2, _("online") ),
11325 # (3, _("offline") ),
11326 # (4, _("bypassed") ),
11327 # (5, _("diagnostics") ),
11329 # ),
11330 # title = _("Administrative state") ,
11331 # negate = True,
11332 # label = _("ignore administrative state"),
11336 TextAscii(
11337 title=_("port name"),
11338 help=_("The name of the FC port"),
11340 match_type="dict",
11343 register_check_parameters(
11344 RulespecGroupCheckParametersEnvironment, "plug_count", _("Number of active Plugs"),
11345 Tuple(
11346 help=_("Levels for the number of active plugs in a device."),
11347 elements=[
11348 Integer(title=_("critical if below or equal"), default_value=30),
11349 Integer(title=_("warning if below or equal"), default_value=32),
11350 Integer(title=_("warning if above or equal"), default_value=38),
11351 Integer(title=_("critical if above or equal"), default_value=40),
11352 ]), None, "first")
11354 # Rules for configuring parameters of checks (services)
11355 register_check_parameters(
11356 RulespecGroupCheckParametersEnvironment, "ucs_bladecenter_chassis_voltage",
11357 _("UCS Bladecenter Chassis Voltage Levels"),
11358 Dictionary(
11359 help=_("Here you can configure the 3.3V and 12V voltage levels for each chassis."),
11360 elements=[
11361 ("levels_3v_lower",
11362 Tuple(
11363 title=_("3.3 Volt Output Lower Levels"),
11364 elements=[
11365 Float(title=_("warning if below or equal"), unit="V", default_value=3.25),
11366 Float(title=_("critical if below or equal"), unit="V", default_value=3.20),
11367 ])),
11368 ("levels_3v_upper",
11369 Tuple(
11370 title=_("3.3 Volt Output Upper Levels"),
11371 elements=[
11372 Float(title=_("warning if above or equal"), unit="V", default_value=3.4),
11373 Float(title=_("critical if above or equal"), unit="V", default_value=3.45),
11374 ])),
11375 ("levels_12v_lower",
11376 Tuple(
11377 title=_("12 Volt Output Lower Levels"),
11378 elements=[
11379 Float(title=_("warning if below or equal"), unit="V", default_value=11.9),
11380 Float(title=_("critical if below or equal"), unit="V", default_value=11.8),
11381 ])),
11382 ("levels_12v_upper",
11383 Tuple(
11384 title=_("12 Volt Output Upper Levels"),
11385 elements=[
11386 Float(title=_("warning if above or equal"), unit="V", default_value=12.1),
11387 Float(title=_("critical if above or equal"), unit="V", default_value=12.2),
11389 ]), TextAscii(title=_("Chassis"), help=_("The identifier of the chassis.")), "dict")
11391 register_check_parameters(
11392 RulespecGroupCheckParametersEnvironment, "hp_msa_psu_voltage",
11393 _("HP MSA Power Supply Voltage Levels"),
11394 Dictionary(
11395 help=_("Here you can configure the 3.3V and 12V voltage levels for each power supply."),
11396 elements=[
11397 ("levels_33v_lower",
11398 Tuple(
11399 title=_("3.3 Volt Output Lower Levels"),
11400 elements=[
11401 Float(title=_("warning if below or equal"), unit="V", default_value=3.25),
11402 Float(title=_("critical if below or equal"), unit="V", default_value=3.20),
11403 ])),
11404 ("levels_33v_upper",
11405 Tuple(
11406 title=_("3.3 Volt Output Upper Levels"),
11407 elements=[
11408 Float(title=_("warning if above or equal"), unit="V", default_value=3.4),
11409 Float(title=_("critical if above or equal"), unit="V", default_value=3.45),
11410 ])),
11411 ("levels_5v_lower",
11412 Tuple(
11413 title=_("5 Volt Output Lower Levels"),
11414 elements=[
11415 Float(title=_("warning if below or equal"), unit="V", default_value=3.25),
11416 Float(title=_("critical if below or equal"), unit="V", default_value=3.20),
11417 ])),
11418 ("levels_5v_upper",
11419 Tuple(
11420 title=_("5 Volt Output Upper Levels"),
11421 elements=[
11422 Float(title=_("warning if above or equal"), unit="V", default_value=3.4),
11423 Float(title=_("critical if above or equal"), unit="V", default_value=3.45),
11424 ])),
11425 ("levels_12v_lower",
11426 Tuple(
11427 title=_("12 Volt Output Lower Levels"),
11428 elements=[
11429 Float(title=_("warning if below or equal"), unit="V", default_value=11.9),
11430 Float(title=_("critical if below or equal"), unit="V", default_value=11.8),
11431 ])),
11432 ("levels_12v_upper",
11433 Tuple(
11434 title=_("12 Volt Output Upper Levels"),
11435 elements=[
11436 Float(title=_("warning if above or equal"), unit="V", default_value=12.1),
11437 Float(title=_("critical if above or equal"), unit="V", default_value=12.2),
11439 ]), TextAscii(title=_("Power Supply name"), help=_("The identifier of the power supply.")),
11440 "dict")
11442 register_check_parameters(
11443 RulespecGroupCheckParametersApplications, "jvm_gc", _("JVM garbage collection levels"),
11444 Dictionary(
11445 help=_("This ruleset also covers Tomcat, Jolokia and JMX. "),
11446 elements=[
11447 ("CollectionTime",
11448 Alternative(
11449 title=_("Collection time levels"),
11450 elements=[
11451 Tuple(
11452 title=_("Time of garbage collection in ms per minute"),
11453 elements=[
11454 Integer(title=_("Warning at"), unit=_("ms"), allow_empty=False),
11455 Integer(title=_("Critical at"), unit=_("ms"), allow_empty=False),
11457 ])),
11458 ("CollectionCount",
11459 Alternative(
11460 title=_("Collection count levels"),
11461 elements=[
11462 Tuple(
11463 title=_("Count of garbage collection per minute"),
11464 elements=[
11465 Integer(title=_("Warning at"), allow_empty=False),
11466 Integer(title=_("Critical at"), allow_empty=False),
11468 ])),
11470 TextAscii(
11471 title=_("Name of the virtual machine and/or<br>garbage collection type"),
11472 help=_("The name of the application server"),
11473 allow_empty=False,
11474 ), "dict")
11476 register_check_parameters(
11477 RulespecGroupCheckParametersApplications, "jvm_tp", _("JVM tomcat threadpool levels"),
11478 Dictionary(
11479 help=_("This ruleset also covers Tomcat, Jolokia and JMX. "),
11480 elements=[
11481 ("currentThreadCount",
11482 Alternative(
11483 title=_("Current thread count levels"),
11484 elements=[
11485 Tuple(
11486 title=_("Percentage levels of current thread count in threadpool"),
11487 elements=[
11488 Integer(title=_("Warning at"), unit=_(u"%"), allow_empty=False),
11489 Integer(title=_("Critical at"), unit=_(u"%"), allow_empty=False),
11491 ])),
11492 ("currentThreadsBusy",
11493 Alternative(
11494 title=_("Current threads busy levels"),
11495 elements=[
11496 Tuple(
11497 title=_("Percentage of current threads busy in threadpool"),
11498 elements=[
11499 Integer(title=_("Warning at"), unit=_(u"%"), allow_empty=False),
11500 Integer(title=_("Critical at"), unit=_(u"%"), allow_empty=False),
11502 ])),
11504 TextAscii(
11505 title=_("Name of the virtual machine and/or<br>threadpool"),
11506 help=_("The name of the application server"),
11507 allow_empty=False,
11508 ), "dict")
11510 register_check_parameters(
11511 RulespecGroupCheckParametersApplications, "docker_node_containers",
11512 _("Docker node container levels"),
11513 Dictionary(
11514 help=_(
11515 "Allows to define absolute levels for all, running, paused, and stopped containers."),
11516 elements=[
11517 ("upper_levels",
11518 Tuple(
11519 title=_("Containers upper levels"),
11520 elements=[
11521 Integer(title=_("Warning at"), allow_empty=False),
11522 Integer(title=_("Critical at"), allow_empty=False),
11523 ])),
11524 ("lower_levels",
11525 Tuple(
11526 title=_("Containers lower levels"),
11527 elements=[
11528 Integer(title=_("Warning at"), allow_empty=False),
11529 Integer(title=_("Critical at"), allow_empty=False),
11530 ])),
11531 ("running_upper_levels",
11532 Tuple(
11533 title=_("Running containers upper levels"),
11534 elements=[
11535 Integer(title=_("Warning at"), allow_empty=False),
11536 Integer(title=_("Critical at"), allow_empty=False),
11537 ])),
11538 ("running_lower_levels",
11539 Tuple(
11540 title=_("Running containers lower levels"),
11541 elements=[
11542 Integer(title=_("Warning at"), allow_empty=False),
11543 Integer(title=_("Critical at"), allow_empty=False),
11544 ])),
11545 ("paused_upper_levels",
11546 Tuple(
11547 title=_("Paused containers upper levels"),
11548 elements=[
11549 Integer(title=_("Warning at"), allow_empty=False),
11550 Integer(title=_("Critical at"), allow_empty=False),
11551 ])),
11552 ("paused_lower_levels",
11553 Tuple(
11554 title=_("Paused containers lower levels"),
11555 elements=[
11556 Integer(title=_("Warning at"), allow_empty=False),
11557 Integer(title=_("Critical at"), allow_empty=False),
11558 ])),
11559 ("stopped_upper_levels",
11560 Tuple(
11561 title=_("Stopped containers upper levels"),
11562 elements=[
11563 Integer(title=_("Warning at"), allow_empty=False),
11564 Integer(title=_("Critical at"), allow_empty=False),
11565 ])),
11566 ("stopped_lower_levels",
11567 Tuple(
11568 title=_("Stopped containers lower levels"),
11569 elements=[
11570 Integer(title=_("Warning at"), allow_empty=False),
11571 Integer(title=_("Critical at"), allow_empty=False),
11572 ])),
11573 ]), None, "dict")
11575 register_check_parameters(
11576 RulespecGroupCheckParametersApplications, "docker_node_disk_usage", _("Docker node disk usage"),
11577 Dictionary(
11578 help=
11579 _("Allows to define levels for the counts and size of Docker Containers, Images, Local Volumes, and the Build Cache."
11581 elements=[
11582 ("size",
11583 Tuple(
11584 title=_("Size"),
11585 elements=[
11586 Filesize(title=_("Warning at"), allow_empty=False),
11587 Filesize(title=_("Critical at"), allow_empty=False),
11588 ])),
11589 ("reclaimable",
11590 Tuple(
11591 title=_("Reclaimable"),
11592 elements=[
11593 Filesize(title=_("Warning at"), allow_empty=False),
11594 Filesize(title=_("Critical at"), allow_empty=False),
11595 ])),
11596 ("count",
11597 Tuple(
11598 title=_("Total count"),
11599 elements=[
11600 Integer(title=_("Warning at"), allow_empty=False),
11601 Integer(title=_("Critical at"), allow_empty=False),
11602 ])),
11603 ("active",
11604 Tuple(
11605 title=_("Active"),
11606 elements=[
11607 Integer(title=_("Warning at"), allow_empty=False),
11608 Integer(title=_("Critical at"), allow_empty=False),
11609 ])),
11611 TextAscii(
11612 title=_("Type"),
11613 help=_("Either Containers, Images, Local Volumes or Build Cache"),
11614 allow_empty=True,
11615 ), "dict")
11617 register_check_parameters(
11618 RulespecGroupCheckParametersStorage,
11619 "heartbeat_crm",
11620 _("Heartbeat CRM general status"),
11621 Tuple(elements=[
11622 Integer(
11623 title=_("Maximum age"),
11624 help=_("Maximum accepted age of the reported data in seconds"),
11625 unit=_("seconds"),
11626 default_value=60,
11628 Optional(
11629 TextAscii(allow_empty=False),
11630 title=_("Expected DC"),
11631 help=_("The hostname of the expected distinguished controller of the cluster"),
11633 Optional(
11634 Integer(min_value=2, default_value=2),
11635 title=_("Number of Nodes"),
11636 help=_("The expected number of nodes in the cluster"),
11638 Optional(
11639 Integer(min_value=0,),
11640 title=_("Number of Resources"),
11641 help=_("The expected number of resources in the cluster"),
11644 None,
11645 match_type="first",
11648 register_check_parameters(
11649 RulespecGroupCheckParametersStorage, "heartbeat_crm_resources",
11650 _("Heartbeat CRM resource status"),
11651 Optional(
11652 TextAscii(allow_empty=False),
11653 title=_("Expected node"),
11654 help=_("The hostname of the expected node to hold this resource."),
11655 none_label=_("Do not enforce the resource to be hold by a specific node."),
11657 TextAscii(
11658 title=_("Resource Name"),
11659 help=_("The name of the cluster resource as shown in the service description."),
11660 allow_empty=False,
11661 ), "first")
11663 register_check_parameters(
11664 RulespecGroupCheckParametersApplications,
11665 "domino_tasks",
11666 _("Lotus Domino Tasks"),
11667 Dictionary(
11668 elements=[
11670 "process",
11671 Alternative(
11672 title=_("Name of the task"),
11673 style="dropdown",
11674 elements=[
11675 TextAscii(
11676 title=_("Exact name of the task"),
11677 size=50,
11679 Transform(
11680 RegExp(
11681 size=50,
11682 mode=RegExp.prefix,
11684 title=_("Regular expression matching tasks"),
11685 help=_("This regex must match the <i>beginning</i> of the complete "
11686 "command line of the task including arguments"),
11687 forth=lambda x: x[1:], # remove ~
11688 back=lambda x: "~" + x, # prefix ~
11690 FixedValue(
11691 None,
11692 totext="",
11693 title=_("Match all tasks"),
11696 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0))),
11697 ("warnmin",
11698 Integer(
11699 title=_("Minimum number of matched tasks for WARNING state"),
11700 default_value=1,
11702 ("okmin",
11703 Integer(
11704 title=_("Minimum number of matched tasks for OK state"),
11705 default_value=1,
11707 ("okmax",
11708 Integer(
11709 title=_("Maximum number of matched tasks for OK state"),
11710 default_value=99999,
11712 ("warnmax",
11713 Integer(
11714 title=_("Maximum number of matched tasks for WARNING state"),
11715 default_value=99999,
11718 required_keys=['warnmin', 'okmin', 'okmax', 'warnmax', 'process'],
11720 TextAscii(
11721 title=_("Name of service"),
11722 help=_("This name will be used in the description of the service"),
11723 allow_empty=False,
11724 regex="^[a-zA-Z_0-9 _.-]*$",
11725 regex_error=_("Please use only a-z, A-Z, 0-9, space, underscore, "
11726 "dot and hyphen for your service description"),
11728 match_type="dict",
11729 has_inventory=False)
11731 register_check_parameters(
11732 RulespecGroupCheckParametersApplications,
11733 "domino_mailqueues",
11734 _("Lotus Domino Mail Queues"),
11735 Dictionary(
11736 elements=[
11737 ("queue_length",
11738 Tuple(
11739 title=_("Number of Mails in Queue"),
11740 elements=[
11741 Integer(title=_("warning at"), default_value=300),
11742 Integer(title=_("critical at"), default_value=350),
11743 ])),
11745 required_keys=['queue_length'],
11747 DropdownChoice(
11748 choices=[
11749 ('lnDeadMail', _('Mails in Dead Queue')),
11750 ('lnWaitingMail', _('Mails in Waiting Queue')),
11751 ('lnMailHold', _('Mails in Hold Queue')),
11752 ('lnMailTotalPending', _('Total Pending Mails')),
11753 ('InMailWaitingforDNS', _('Mails Waiting for DNS Queue')),
11755 title=_("Domino Mail Queue Names"),
11757 match_type="dict",
11760 register_check_parameters(
11761 RulespecGroupCheckParametersApplications,
11762 "domino_users",
11763 _("Lotus Domino Users"),
11764 Tuple(
11765 title=_("Number of Lotus Domino Users"),
11766 elements=[
11767 Integer(title=_("warning at"), default_value=1000),
11768 Integer(title=_("critical at"), default_value=1500),
11770 None,
11771 match_type="first",
11774 register_check_parameters(
11775 RulespecGroupCheckParametersApplications,
11776 "domino_transactions",
11777 _("Lotus Domino Transactions"),
11778 Tuple(
11779 title=_("Number of Transactions per Minute on a Lotus Domino Server"),
11780 elements=[
11781 Integer(title=_("warning at"), default_value=30000),
11782 Integer(title=_("critical at"), default_value=35000),
11784 None,
11785 match_type="first",
11788 register_check_parameters(
11789 RulespecGroupCheckParametersApplications, "netscaler_dnsrates",
11790 _("Citrix Netscaler DNS counter rates"),
11791 Dictionary(
11792 help=_("Counter rates of DNS parameters for Citrix Netscaler Loadbalancer "
11793 "Appliances"),
11794 elements=[
11796 "query",
11797 Tuple(
11798 title=_("Upper Levels for Total Number of DNS queries"),
11799 elements=[
11800 Float(title=_("Warning at"), default_value=1500.0, unit="/sec"),
11801 Float(title=_("Critical at"), default_value=2000.0, unit="/sec")
11806 "answer",
11807 Tuple(
11808 title=_("Upper Levels for Total Number of DNS replies"),
11809 elements=[
11810 Float(title=_("Warning at"), default_value=1500.0, unit="/sec"),
11811 Float(title=_("Critical at"), default_value=2000.0, unit="/sec")
11815 ]), None, "dict")
11817 register_check_parameters(
11818 RulespecGroupCheckParametersApplications, "netscaler_tcp_conns",
11819 _("Citrix Netscaler Loadbalancer TCP Connections"),
11820 Dictionary(elements=[
11822 "client_conns",
11823 Tuple(
11824 title=_("Max. number of client connections"),
11825 elements=[
11826 Integer(
11827 title=_("Warning at"),
11828 default_value=25000,
11830 Integer(
11831 title=_("Critical at"),
11832 default_value=30000,
11837 "server_conns",
11838 Tuple(
11839 title=_("Max. number of server connections"),
11840 elements=[
11841 Integer(
11842 title=_("Warning at"),
11843 default_value=25000,
11845 Integer(
11846 title=_("Critical at"),
11847 default_value=30000,
11851 ]), None, "dict")
11853 register_check_parameters(
11854 RulespecGroupCheckParametersApplications,
11855 "netscaler_sslcerts",
11856 _("Citrix Netscaler SSL certificates"),
11857 Dictionary(
11858 elements=[
11860 'age_levels',
11861 Tuple(
11862 title=_("Remaining days of validity"),
11863 elements=[
11864 Integer(title=_("Warning below"), default_value=30, min_value=0),
11865 Integer(title=_("Critical below"), default_value=10, min_value=0),
11869 ],),
11870 TextAscii(title=_("Name of Certificate"),),
11871 match_type="dict")
11873 register_check_parameters(
11874 RulespecGroupCheckParametersEnvironment,
11875 "siemens_plc_flag",
11876 _("State of Siemens PLC Flags"),
11877 DropdownChoice(
11878 help=_("This rule sets the expected state, the one which should result in an OK state, "
11879 "of the monitored flags of Siemens PLC devices."),
11880 title=_("Expected flag state"),
11881 choices=[
11882 (True, _("Expect the flag to be: On")),
11883 (False, _("Expect the flag to be: Off")),
11885 default_value=True),
11886 TextAscii(
11887 title=_("Device Name and Value Ident"),
11888 help=_("You need to concatenate the device name which is configured in the special agent "
11889 "for the PLC device separated by a space with the ident of the value which is also "
11890 "configured in the special agent."),
11891 allow_empty=True),
11892 match_type="first",
11895 register_check_parameters(
11896 RulespecGroupCheckParametersEnvironment,
11897 "siemens_plc_duration",
11898 _("Siemens PLC Duration"),
11899 Dictionary(
11900 elements=[
11901 ('duration',
11902 Tuple(
11903 title=_("Duration"),
11904 elements=[
11905 Age(title=_("Warning at"),),
11906 Age(title=_("Critical at"),),
11907 ])),
11909 help=_("This rule is used to configure thresholds for duration values read from "
11910 "Siemens PLC devices."),
11911 title=_("Duration levels"),
11913 TextAscii(
11914 title=_("Device Name and Value Ident"),
11915 help=_("You need to concatenate the device name which is configured in the special agent "
11916 "for the PLC device separated by a space with the ident of the value which is also "
11917 "configured in the special agent."),
11919 match_type="dict",
11922 register_check_parameters(
11923 RulespecGroupCheckParametersEnvironment,
11924 "siemens_plc_counter",
11925 _("Siemens PLC Counter"),
11926 Dictionary(
11927 elements=[
11928 ('levels',
11929 Tuple(
11930 title=_("Counter level"),
11931 elements=[
11932 Integer(title=_("Warning at"),),
11933 Integer(title=_("Critical at"),),
11934 ])),
11936 help=_("This rule is used to configure thresholds for counter values read from "
11937 "Siemens PLC devices."),
11938 title=_("Counter levels"),
11940 TextAscii(
11941 title=_("Device Name and Value Ident"),
11942 help=_("You need to concatenate the device name which is configured in the special agent "
11943 "for the PLC device separated by a space with the ident of the value which is also "
11944 "configured in the special agent."),
11946 match_type="dict",
11949 register_check_parameters(
11950 RulespecGroupCheckParametersStorage, "bossock_fibers", _("Number of Running Bossock Fibers"),
11951 Tuple(
11952 title=_("Number of fibers"),
11953 elements=[
11954 Integer(title=_("Warning at"), unit=_("fibers")),
11955 Integer(title=_("Critical at"), unit=_("fibers")),
11956 ]), TextAscii(title=_("Node ID")), "first")
11958 register_check_parameters(
11959 RulespecGroupCheckParametersEnvironment, "carbon_monoxide", ("Carbon monoxide"),
11960 Dictionary(elements=[
11961 ("levels_ppm",
11962 Tuple(
11963 title="Levels in parts per million",
11964 elements=[
11965 Integer(title=_("Warning at"), unit=_("ppm"), default=10),
11966 Integer(title=_("Critical at"), unit=_("ppm"), default=25),
11967 ])),
11968 ]), None, "dict")