Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / cmk / gui / plugins / wato / check_parameters / unsorted.py
blob7121a7cb97e96f06027354010bac9fd9c8db3200
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 CascadingDropdown,
53 FixedValue,
54 Optional,
55 MonitoringState,
56 DualListChoice,
57 RadioChoice,
58 TextUnicode,
59 RegExpUnicode,
61 from cmk.gui.plugins.wato import (
62 RulespecGroupCheckParametersApplications,
63 RulespecGroupCheckParametersDiscovery,
64 RulespecGroupCheckParametersEnvironment,
65 RulespecGroupCheckParametersHardware,
66 RulespecGroupCheckParametersNetworking,
67 RulespecGroupCheckParametersOperatingSystem,
68 RulespecGroupCheckParametersStorage,
69 RulespecGroupCheckParametersVirtualization,
70 register_rule,
71 register_check_parameters,
72 UserIconOrAction,
73 Levels,
75 from cmk.gui.plugins.wato.check_parameters.ps import process_level_elements
76 from cmk.gui.plugins.wato.check_parameters.utils import (
77 match_dual_level_type,
78 get_free_used_dynamic_valuespec,
79 transform_filesystem_free,
80 filesystem_elements,
83 # TODO: Sort all rules and check parameters into the figlet header sections.
84 # Beware: there are dependencies, so sometimes the order matters. All rules
85 # that are not yet handles are in the last section: in "Unsorted". Move rules
86 # from there into their appropriate sections until "Unsorted" is empty.
87 # Create new rules directly in the correct secions.
89 # .--Networking----------------------------------------------------------.
90 # | _ _ _ _ _ |
91 # | | \ | | ___| |___ _____ _ __| | _(_)_ __ __ _ |
92 # | | \| |/ _ \ __\ \ /\ / / _ \| '__| |/ / | '_ \ / _` | |
93 # | | |\ | __/ |_ \ V V / (_) | | | <| | | | | (_| | |
94 # | |_| \_|\___|\__| \_/\_/ \___/|_| |_|\_\_|_| |_|\__, | |
95 # | |___/ |
96 # '----------------------------------------------------------------------'
98 register_rule(
99 RulespecGroupCheckParametersNetworking,
100 "ping_levels",
101 Dictionary(
102 title=_("PING and host check parameters"),
103 help=_("This rule sets the parameters for the host checks (via <tt>check_icmp</tt>) "
104 "and also for PING checks on ping-only-hosts. For the host checks only the "
105 "critical state is relevant, the warning levels are ignored."),
106 elements=check_icmp_params,
108 match="dict")
111 # .--Inventory-----------------------------------------------------------.
112 # | ___ _ |
113 # | |_ _|_ ____ _____ _ __ | |_ ___ _ __ _ _ |
114 # | | || '_ \ \ / / _ \ '_ \| __/ _ \| '__| | | | |
115 # | | || | | \ V / __/ | | | || (_) | | | |_| | |
116 # | |___|_| |_|\_/ \___|_| |_|\__\___/|_| \__, | |
117 # | |___/ |
118 # '----------------------------------------------------------------------'
121 def transform_ipmi_inventory_rules(p):
122 if not isinstance(p, dict):
123 return p
124 if p.get("summarize", True):
125 return 'summarize'
126 if p.get('ignored_sensors', []):
127 return ('single', {'ignored_sensors': p["ignored_sensors"]})
128 return ('single', {})
131 register_rule(
132 RulespecGroupCheckParametersDiscovery,
133 varname="inventory_ipmi_rules",
134 title=_("Discovery of IPMI sensors"),
135 valuespec=Transform(
136 CascadingDropdown(
137 orientation="vertical",
138 choices=
139 [("summarize", _("Summary")),
140 ("single", _("Single"),
141 Dictionary(
142 show_titles=True,
143 elements=[
144 ("ignored_sensors",
145 ListOfStrings(
146 title=_("Ignore the following IPMI sensors"),
147 help=_("Names of IPMI sensors that should be ignored during inventory "
148 "and when summarizing."
149 "The pattern specified here must match exactly the beginning of "
150 "the actual sensor name (case sensitive)."),
151 orientation="horizontal")),
152 ("ignored_sensorstates",
153 ListOfStrings(
154 title=_("Ignore the following IPMI sensor states"),
155 help=_(
156 "IPMI sensors with these states that should be ignored during inventory "
157 "and when summarizing."
158 "The pattern specified here must match exactly the beginning of "
159 "the actual sensor name (case sensitive)."),
160 orientation="horizontal",
162 ]))]),
163 forth=transform_ipmi_inventory_rules),
164 match='first')
166 register_rule(
167 RulespecGroupCheckParametersDiscovery,
168 varname="ewon_discovery_rules",
169 title=_("eWON Discovery"),
170 help=_("The ewon vpn routers can rely data from a secondary device via snmp. "
171 "It doesn't however allow discovery of the device type relayed this way. "
172 "To allow interpretation of the data you need to pick the device manually."),
173 valuespec=DropdownChoice(
174 title=_("Device Type"),
175 label=_("Select device type"),
176 choices=[
177 (None, _("None selected")),
178 ("oxyreduct", _("Wagner OxyReduct")),
180 default_value=None,
182 match='first')
184 register_rule(
185 RulespecGroupCheckParametersDiscovery,
186 varname="mssql_transactionlogs_discovery",
187 title=_("MSSQL Datafile and Transactionlog Discovery"),
188 valuespec=Dictionary(
189 elements=[
190 ("summarize_datafiles",
191 Checkbox(
192 title=_("Display only a summary of all Datafiles"),
193 label=_("Summarize Datafiles"),
195 ("summarize_transactionlogs",
196 Checkbox(
197 title=_("Display only a summary of all Transactionlogs"),
198 label=_("Summarize Transactionlogs"),
201 optional_keys=[]),
202 match="first")
204 register_rule(
205 RulespecGroupCheckParametersDiscovery,
206 varname="inventory_services_rules",
207 title=_("Windows Service Discovery"),
208 valuespec=Dictionary(
209 elements=[
210 ('services',
211 ListOfStrings(
212 title=_("Services (Regular Expressions)"),
213 help=_('Regular expressions matching the begining of the internal name '
214 'or the description of the service. '
215 'If no name is given then this rule will match all services. The '
216 'match is done on the <i>beginning</i> of the service name. It '
217 'is done <i>case sensitive</i>. You can do a case insensitive match '
218 'by prefixing the regular expression with <tt>(?i)</tt>. Example: '
219 '<tt>(?i).*mssql</tt> matches all services which contain <tt>MSSQL</tt> '
220 'or <tt>MsSQL</tt> or <tt>mssql</tt> or...'),
221 orientation="horizontal",
223 ('state',
224 DropdownChoice(
225 choices=[
226 ('running', _('Running')),
227 ('stopped', _('Stopped')),
229 title=_("Create check if service is in state"),
231 ('start_mode',
232 DropdownChoice(
233 choices=[
234 ('auto', _('Automatic')),
235 ('demand', _('Manual')),
236 ('disabled', _('Disabled')),
238 title=_("Create check if service is in start mode"),
241 help=_(
242 'This rule can be used to configure the inventory of the windows services check. '
243 'You can configure specific windows services to be monitored by the windows check by '
244 'selecting them by name, current state during the inventory, or start mode.'),
246 match='all',
249 register_rule(
250 RulespecGroupCheckParametersDiscovery,
251 varname="inventory_solaris_services_rules",
252 title=_("Solaris Service Discovery"),
253 valuespec=Dictionary(
254 elements=[
255 ('descriptions', ListOfStrings(title=_("Descriptions"))),
256 ('categories', ListOfStrings(title=_("Categories"))),
257 ('names', ListOfStrings(title=_("Names"))),
258 ('instances', ListOfStrings(title=_("Instances"))),
259 ('states',
260 ListOf(
261 DropdownChoice(
262 choices=[
263 ("online", _("online")),
264 ("disabled", _("disabled")),
265 ("maintenance", _("maintenance")),
266 ("legacy_run", _("legacy run")),
267 ],),
268 title=_("States"),
270 ('outcome',
271 Alternative(
272 title=_("Service name"),
273 style="dropdown",
274 elements=[
275 FixedValue("full_descr", title=_("Full Description"), totext=""),
276 FixedValue(
277 "descr_without_prefix",
278 title=_("Description without type prefix"),
279 totext=""),
283 help=_(
284 'This rule can be used to configure the discovery of the Solaris services check. '
285 'You can configure specific Solaris services to be monitored by the Solaris check by '
286 'selecting them by description, category, name, or current state during the discovery.'
289 match='all',
292 register_rule(
293 RulespecGroupCheckParametersDiscovery,
294 varname="discovery_systemd_units_services_rules",
295 title=_("Systemd Service Discovery"),
296 valuespec=Dictionary(
297 elements=[
298 ('descriptions', ListOfStrings(title=_("Descriptions"))),
299 ('names', ListOfStrings(title=_("Service unit names"))),
300 ('states',
301 ListOf(
302 DropdownChoice(
303 choices=[
304 ("active", "active"),
305 ("inactive", "inactive"),
306 ("failed", "failed"),
307 ],),
308 title=_("States"),
311 help=_('This rule can be used to configure the discovery of the Linux services check. '
312 'You can configure specific Linux services to be monitored by the Linux check by '
313 'selecting them by description, unit name, or current state during the discovery.'),
315 match='all',
318 register_rule(
319 RulespecGroupCheckParametersDiscovery,
320 varname="discovery_win_dhcp_pools",
321 title=_("Discovery of Windows DHCP Pools"),
322 valuespec=Dictionary(elements=[
323 ("empty_pools",
324 Checkbox(
325 title=_("Discovery of empty DHCP pools"),
326 label=_("Include empty pools into the monitoring"),
327 help=_("You can activate the creation of services for "
328 "DHCP pools, which contain no IP addresses."),
331 match='dict',
334 register_rule(
335 RulespecGroupCheckParametersDiscovery,
336 varname="inventory_if_rules",
337 title=_("Network Interface and Switch Port Discovery"),
338 valuespec=Dictionary(
339 elements=[
340 ("use_desc",
341 DropdownChoice(
342 choices=[
343 (True, _('Use description')),
344 (False, _('Do not use description')),
346 title=_("Description as service name for network interface checks"),
347 help=_(
348 "This option lets Check_MK use the interface description as item instead "
349 "of the port number. If no description is available then the port number is "
350 "used anyway."))),
351 ("use_alias",
352 DropdownChoice(
353 choices=[
354 (True, _('Use alias')),
355 (False, _('Do not use alias')),
357 title=_("Alias as service name for network interface checks"),
358 help=_(
359 "This option lets Check_MK use the alias of the port (ifAlias) as item instead "
360 "of the port number. If no alias is available then the port number is used "
361 "anyway."))),
362 ("pad_portnumbers",
363 DropdownChoice(
364 choices=[
365 (True, _('Pad port numbers with zeros')),
366 (False, _('Do not pad')),
368 title=_("Port numbers"),
369 help=_("If this option is activated then Check_MK will pad port numbers of "
370 "network interfaces with zeroes so that all port descriptions from "
371 "all ports of a host or switch have the same length and thus sort "
372 "currectly in the GUI. In versions prior to 1.1.13i3 there was no "
373 "padding. You can switch back to the old behaviour by disabling this "
374 "option. This will retain the old service descriptions and the old "
375 "performance data."),
377 ("match_alias",
378 ListOfStrings(
379 title=_("Match interface alias (regex)"),
380 help=_("Only discover interfaces whose alias matches one of the configured "
381 "regular expressions. The match is done on the beginning of the alias. "
382 "This allows you to select interfaces based on the alias without having "
383 "the alias be part of the service description."),
384 orientation="horizontal",
385 valuespec=RegExp(
386 size=32,
387 mode=RegExp.prefix,
390 ("match_desc",
391 ListOfStrings(
392 title=_("Match interface description (regex)"),
393 help=_(
394 "Only discover interfaces whose the description matches one of the configured "
395 "regular expressions. The match is done on the beginning of the description. "
396 "This allows you to select interfaces based on the description without having "
397 "the alias be part of the service description."),
398 orientation="horizontal",
399 valuespec=RegExp(
400 size=32,
401 mode=RegExp.prefix,
404 ("portstates",
405 ListChoice(
406 title=_("Network interface port states to discover"),
407 help=
408 _("When doing discovery on switches or other devices with network interfaces "
409 "then only ports found in one of the configured port states will be added to the monitoring. "
410 "Note: the state <i>admin down</i> is in fact not an <tt>ifOperStatus</tt> but represents the "
411 "<tt>ifAdminStatus</tt> of <tt>down</tt> - a port administratively switched off. If you check this option "
412 "then an alternate version of the check is being used that fetches the <tt>ifAdminState</tt> in addition. "
413 "This will add about 5% of additional SNMP traffic."),
414 choices=defines.interface_oper_states(),
415 toggle_all=True,
416 default_value=['1'],
418 ("porttypes",
419 DualListChoice(
420 title=_("Network interface port types to discover"),
421 help=_("When doing discovery on switches or other devices with network interfaces "
422 "then only ports of the specified types will be created services for."),
423 choices=defines.interface_port_types(),
424 custom_order=True,
425 rows=40,
426 toggle_all=True,
427 default_value=[
428 '6', '32', '62', '117', '127', '128', '129', '180', '181', '182', '205', '229'
431 ("rmon",
432 DropdownChoice(
433 choices=[
434 (True,
435 _("Create extra service with RMON statistics data (if available for the device)"
437 (False, _('Do not create extra services')),
439 title=_("Collect RMON statistics data"),
440 help=
441 _("If you enable this option, for every RMON capable switch port an additional service will "
442 "be created which is always OK and collects RMON data. This will give you detailed information "
443 "about the distribution of packet sizes transferred over the port. Note: currently "
444 "this extra RMON check does not honor the inventory settings for switch ports. In a future "
445 "version of Check_MK RMON data may be added to the normal interface service and not add "
446 "an additional service."),
449 help=_('This rule can be used to control the inventory for network ports. '
450 'You can configure the port types and port states for inventory'
451 'and the use of alias or description as service name.'),
453 match='list',
456 _brocade_fcport_adm_choices = [
457 (1, 'online(1)'),
458 (2, 'offline(2)'),
459 (3, 'testing(3)'),
460 (4, 'faulty(4)'),
463 _brocade_fcport_op_choices = [
464 (0, 'unkown(0)'),
465 (1, 'online(1)'),
466 (2, 'offline(2)'),
467 (3, 'testing(3)'),
468 (4, 'faulty(4)'),
471 _brocade_fcport_phy_choices = [
472 (1, 'noCard(1)'),
473 (2, 'noTransceiver(2)'),
474 (3, 'laserFault(3)'),
475 (4, 'noLight(4)'),
476 (5, 'noSync(5)'),
477 (6, 'inSync(6)'),
478 (7, 'portFault(7)'),
479 (8, 'diagFault(8)'),
480 (9, 'lockRef(9)'),
481 (10, 'validating(10)'),
482 (11, 'invalidModule(11)'),
483 (14, 'noSigDet(14)'),
484 (255, 'unkown(255)'),
487 register_rule(
488 RulespecGroupCheckParametersDiscovery,
489 varname="brocade_fcport_inventory",
490 title=_("Brocade Port Discovery"),
491 valuespec=Dictionary(
492 elements=[
493 ("use_portname",
494 Checkbox(
495 title=_("Use port name as service name"),
496 label=_("use port name"),
497 default_value=True,
498 help=_("This option lets Check_MK use the port name as item instead of the "
499 "port number. If no description is available then the port number is "
500 "used anyway."))),
501 ("show_isl",
502 Checkbox(
503 title=_("add \"ISL\" to service description for interswitch links"),
504 label=_("add ISL"),
505 default_value=True,
506 help=_("This option lets Check_MK add the string \"ISL\" to the service "
507 "description for interswitch links."))),
508 ("admstates",
509 ListChoice(
510 title=_("Administrative port states to discover"),
511 help=_(
512 "When doing service discovery on brocade switches only ports with the given administrative "
513 "states will be added to the monitoring system."),
514 choices=_brocade_fcport_adm_choices,
515 columns=1,
516 toggle_all=True,
517 default_value=['1', '3', '4'],
519 ("phystates",
520 ListChoice(
521 title=_("Physical port states to discover"),
522 help=_(
523 "When doing service discovery on brocade switches only ports with the given physical "
524 "states will be added to the monitoring system."),
525 choices=_brocade_fcport_phy_choices,
526 columns=1,
527 toggle_all=True,
528 default_value=[3, 4, 5, 6, 7, 8, 9, 10])),
529 ("opstates",
530 ListChoice(
531 title=_("Operational port states to discover"),
532 help=_(
533 "When doing service discovery on brocade switches only ports with the given operational "
534 "states will be added to the monitoring system."),
535 choices=_brocade_fcport_op_choices,
536 columns=1,
537 toggle_all=True,
538 default_value=[1, 2, 3, 4])),
540 help=_('This rule can be used to control the service discovery for brocade ports. '
541 'You can configure the port states for inventory '
542 'and the use of the description as service name.'),
544 match='dict',
548 # In version 1.2.4 the check parameters for the resulting ps check
549 # where defined in the dicovery rule. We moved that to an own rule
550 # in the classical check parameter style. In order to support old
551 # configuration we allow reading old discovery rules and ship these
552 # settings in an optional sub-dictionary.
553 def convert_inventory_processes(old_dict):
554 new_dict = {"default_params": {}}
555 for key, value in old_dict.items():
556 if key in [
557 'levels',
558 'handle_count',
559 'cpulevels',
560 'cpu_average',
561 'virtual_levels',
562 'resident_levels',
564 new_dict["default_params"][key] = value
565 elif key != "perfdata":
566 new_dict[key] = value
568 # New cpu rescaling load rule
569 if old_dict.get('cpu_rescale_max') is None:
570 new_dict['cpu_rescale_max'] = True
572 return new_dict
575 def forbid_re_delimiters_inside_groups(pattern, varprefix):
576 # Used as input validation in PS check wato config
577 group_re = r'\(.*?\)'
578 for match in re.findall(group_re, pattern):
579 for char in ['\\b', '$', '^']:
580 if char in match:
581 raise MKUserError(
582 varprefix,
583 _('"%s" is not allowed inside the regular expression group %s. '
584 'Bounding characters inside groups will vanish after discovery, '
585 'because processes are instanced for every matching group. '
586 'Thus enforce delimiters outside the group.') % (char, match))
589 register_rule(
590 RulespecGroupCheckParametersDiscovery,
591 varname="inventory_processes_rules",
592 title=_('Process Discovery'),
593 help=_(
594 "This ruleset defines criteria for automatically creating checks for running processes "
595 "based upon what is running when the service discovery is done. These services will be "
596 "created with default parameters. They will get critical when no process is running and "
597 "OK otherwise. You can parameterize the check with the ruleset <i>State and count of processes</i>."
599 valuespec=Transform(
600 Dictionary(
601 elements=[
602 ('descr',
603 TextAscii(
604 title=_('Process Name'),
605 style="dropdown",
606 allow_empty=False,
607 help=
608 _('<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 '
609 'expression and be prefixed with ~. For each <tt>%s</tt> in the description, the expression has to contain one "group". A group '
610 '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 '
611 'matching the pattern, it will substitute all such groups with the actual values when creating the check. That way one '
612 'rule can create several checks on a host.</p>'
613 '<p>If the pattern contains more groups then occurrances of <tt>%s</tt> in the service description then only the first matching '
614 'subexpressions are used for the service descriptions. The matched substrings corresponding to the remaining groups '
615 'are copied into the regular expression, nevertheless.</p>'
616 '<p>As an alternative to <tt>%s</tt> you may also use <tt>%1</tt>, <tt>%2</tt>, etc. '
617 'These will be replaced by the first, second, ... matching group. This allows you to reorder things.</p>'
621 'match',
622 Alternative(
623 title=_("Process Matching"),
624 style="dropdown",
625 elements=[
626 TextAscii(
627 title=_("Exact name of the process without argments"),
628 label=_("Executable:"),
629 size=50,
631 Transform(
632 RegExp(
633 size=50,
634 mode=RegExp.prefix,
635 validate=forbid_re_delimiters_inside_groups,
637 title=_("Regular expression matching command line"),
638 label=_("Command line:"),
639 help=
640 _("This regex must match the <i>beginning</i> of the complete "
641 "command line of the process including arguments.<br>"
642 "When using groups, matches will be instantiated "
643 "during process discovery. e.g. (py.*) will match python, python_dev "
644 "and python_test and discover 3 services. At check time, because "
645 "python is a substring of python_test and python_dev it will aggregate"
646 "all process that start with python. If that is not the intended behavior "
647 "please use a delimiter like '$' or '\\b' around the group, e.g. (py.*)$"
649 forth=lambda x: x[1:], # remove ~
650 back=lambda x: "~" + x, # prefix ~
652 FixedValue(
653 None,
654 totext="",
655 title=_("Match all processes"),
658 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0),
659 default_value='/usr/sbin/foo')),
660 ('user',
661 Alternative(
662 title=_('Name of the User'),
663 style="dropdown",
664 elements=[
665 FixedValue(
666 None,
667 totext="",
668 title=_("Match all users"),
670 TextAscii(
671 title=_('Exact name of the user'),
672 label=_("User:"),
674 FixedValue(
675 False,
676 title=_('Grab user from found processess'),
677 totext='',
680 help=
681 _('<p>The user specification can either be a user name (string). The inventory will then trigger only if that user matches '
682 'the user the process is running as and the resulting check will require that user. Alternatively you can specify '
683 '"grab user". If user is not selected the created check will not check for a specific user.</p>'
684 '<p>Specifying "grab user" makes the created check expect the process to run as the same user as during inventory: the user '
685 'name will be hardcoded into the check. In that case if you put %u into the service description, that will be replaced '
686 'by the actual user name during inventory. You need that if your rule might match for more than one user - your would '
687 'create duplicate services with the same description otherwise.</p><p>Windows users are specified by the namespace followed by '
688 'the actual user name. For example "\\\\NT AUTHORITY\\NETWORK SERVICE" or "\\\\CHKMKTEST\\Administrator".</p>'
691 ('icon',
692 UserIconOrAction(
693 title=_("Add custom icon or action"),
694 help=_(
695 "You can assign icons or actions to the found services in the status GUI."
698 ("cpu_rescale_max",
699 RadioChoice(
700 title=_("CPU rescale maximum load"),
701 help=_("CPU utilization is delivered by the Operating "
702 "System as a per CPU core basis. Thus each core contributes "
703 "with a 100% at full utilization, producing a maximum load "
704 "of N*100% (N=number of cores). For simplicity this maximum "
705 "can be rescaled down, making 100% the maximum and thinking "
706 "in terms of total CPU utilization."),
707 default_value=True,
708 orientation="vertical",
709 choices=[
710 (True, _("100% is all cores at full load")),
711 (False,
712 _("<b>N</b> * 100% as each core contributes with 100% at full load")),
713 ])),
714 ('default_params',
715 Dictionary(
716 title=_("Default parameters for detected services"),
717 help=
718 _("Here you can select default parameters that are being set "
719 "for detected services. Note: the preferred way for setting parameters is to use "
720 "the rule set <a href='wato.py?varname=checkgroup_parameters%3Apsmode=edit_ruleset'> "
721 "State and Count of Processes</a> instead. "
722 "A change there will immediately be active, while a change in this rule "
723 "requires a re-discovery of the services."),
724 elements=process_level_elements,
727 required_keys=["descr", "cpu_rescale_max"],
729 forth=convert_inventory_processes,
731 match='all',
734 register_rule(
735 RulespecGroupCheckParametersDiscovery,
736 varname="inv_domino_tasks_rules",
737 title=_('Lotus Domino Task Discovery'),
738 help=_("This rule controls the discovery of tasks on Lotus Domino systems. "
739 "Any changes later on require a host re-discovery"),
740 valuespec=Dictionary(
741 elements=[
742 ('descr',
743 TextAscii(
744 title=_('Service Description'),
745 allow_empty=False,
746 help=
747 _('<p>The service description may contain one or more occurances of <tt>%s</tt>. In this '
748 'case, the pattern must be a regular expression prefixed with ~. For each '
749 '<tt>%s</tt> in the description, the expression has to contain one "group". A group '
750 'is a subexpression enclosed in brackets, for example <tt>(.*)</tt> or '
751 '<tt>([a-zA-Z]+)</tt> or <tt>(...)</tt>. When the inventory finds a task '
752 'matching the pattern, it will substitute all such groups with the actual values when '
753 'creating the check. In this way one rule can create several checks on a host.</p>'
754 '<p>If the pattern contains more groups than occurrences of <tt>%s</tt> in the service '
755 'description, only the first matching subexpressions are used for the service '
756 'descriptions. The matched substrings corresponding to the remaining groups '
757 'are nevertheless copied into the regular expression.</p>'
758 '<p>As an alternative to <tt>%s</tt> you may also use <tt>%1</tt>, <tt>%2</tt>, etc. '
759 'These expressions will be replaced by the first, second, ... matching group, allowing '
760 'you to reorder things.</p>'),
763 'match',
764 Alternative(
765 title=_("Task Matching"),
766 elements=[
767 TextAscii(
768 title=_("Exact name of the task"),
769 size=50,
771 Transform(
772 RegExp(
773 size=50,
774 mode=RegExp.prefix,
776 title=_("Regular expression matching command line"),
777 help=_("This regex must match the <i>beginning</i> of the task"),
778 forth=lambda x: x[1:], # remove ~
779 back=lambda x: "~" + x, # prefix ~
781 FixedValue(
782 None,
783 totext="",
784 title=_("Match all tasks"),
787 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0),
788 default_value='foo')),
789 ('levels',
790 Tuple(
791 title=_('Levels'),
792 help=
793 _("Please note that if you specify and also if you modify levels here, the change is "
794 "activated only during an inventory. Saving this rule is not enough. This is due to "
795 "the nature of inventory rules."),
796 elements=[
797 Integer(
798 title=_("Critical below"),
799 unit=_("processes"),
800 default_value=1,
802 Integer(
803 title=_("Warning below"),
804 unit=_("processes"),
805 default_value=1,
807 Integer(
808 title=_("Warning above"),
809 unit=_("processes"),
810 default_value=1,
812 Integer(
813 title=_("Critical above"),
814 unit=_("processes"),
815 default_value=1,
820 required_keys=['match', 'levels', 'descr'],
822 match='all',
825 register_rule(
826 RulespecGroupCheckParametersDiscovery,
827 varname="inventory_sap_values",
828 title=_('SAP R/3 Single Value Inventory'),
829 valuespec=Dictionary(
830 elements=[
832 'match',
833 Alternative(
834 title=_("Node Path Matching"),
835 elements=[
836 TextAscii(
837 title=_("Exact path of the node"),
838 size=100,
840 Transform(
841 RegExp(
842 size=100,
843 mode=RegExp.prefix,
845 title=_("Regular expression matching the path"),
846 help=_("This regex must match the <i>beginning</i> of the complete "
847 "path of the node as reported by the agent"),
848 forth=lambda x: x[1:], # remove ~
849 back=lambda x: "~" + x, # prefix ~
851 FixedValue(
852 None,
853 totext="",
854 title=_("Match all nodes"),
857 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0),
858 default_value=
859 'SAP CCMS Monitor Templates/Dialog Overview/Dialog Response Time/ResponseTime')
861 ('limit_item_levels',
862 Integer(
863 title=_("Limit Path Levels for Service Names"),
864 unit=_('path levels'),
865 minvalue=1,
866 help=
867 _("The service descriptions of the inventorized services are named like the paths "
868 "in SAP. You can use this option to let the inventory function only use the last "
869 "x path levels for naming."),
872 optional_keys=['limit_item_levels'],
874 match='all',
877 register_rule(
878 RulespecGroupCheckParametersDiscovery,
879 varname="sap_value_groups",
880 title=_('SAP Value Grouping Patterns'),
881 help=_('The check <tt>sap.value</tt> normally creates one service for each SAP value. '
882 'By defining grouping patterns, you can switch to the check <tt>sap.value-groups</tt>. '
883 'That check monitors a list of SAP values at once.'),
884 valuespec=ListOf(
885 Tuple(
886 help=_("This defines one value grouping pattern"),
887 show_titles=True,
888 orientation="horizontal",
889 elements=[
890 TextAscii(title=_("Name of group"),),
891 Tuple(
892 show_titles=True,
893 orientation="vertical",
894 elements=[
895 RegExpUnicode(
896 title=_("Include Pattern"),
897 mode=RegExp.prefix,
899 RegExpUnicode(
900 title=_("Exclude Pattern"),
901 mode=RegExp.prefix,
907 add_label=_("Add pattern group"),
909 match='all',
912 register_rule(
913 RulespecGroupCheckParametersDiscovery,
914 varname="inventory_heartbeat_crm_rules",
915 title=_("Heartbeat CRM Discovery"),
916 valuespec=Dictionary(
917 elements=[
918 ("naildown_dc",
919 Checkbox(
920 title=_("Naildown the DC"),
921 label=_("Mark the currently distinguished controller as preferred one"),
922 help=_(
923 "Nails down the DC to the node which is the DC during discovery. The check "
924 "will report CRITICAL when another node becomes the DC during later checks."))
926 ("naildown_resources",
927 Checkbox(
928 title=_("Naildown the resources"),
929 label=_("Mark the nodes of the resources as preferred one"),
930 help=_(
931 "Nails down the resources to the node which is holding them during discovery. "
932 "The check will report CRITICAL when another holds the resource during later checks."
933 ))),
935 help=_('This rule can be used to control the discovery for Heartbeat CRM checks.'),
936 optional_keys=[],
938 match='dict',
941 register_rule(
942 RulespecGroupCheckParametersDiscovery,
943 varname="inventory_df_rules",
944 title=_("Discovery parameters for filesystem checks"),
945 valuespec=Dictionary(
946 elements=[
947 ("include_volume_name", Checkbox(title=_("Include Volume name in item"))),
948 ("ignore_fs_types",
949 ListChoice(
950 title=_("Filesystem types to ignore"),
951 choices=[
952 ("tmpfs", "tmpfs"),
953 ("nfs", "nfs"),
954 ("smbfs", "smbfs"),
955 ("cifs", "cifs"),
956 ("iso9660", "iso9660"),
958 default_value=["tmpfs", "nfs", "smbfs", "cifs", "iso9660"])),
959 ("never_ignore_mountpoints",
960 ListOf(
961 TextUnicode(),
962 title=_(u"Mountpoints to never ignore"),
963 help=_(
964 u"Regardless of filesystem type, these mountpoints will always be discovered."
965 u"Globbing or regular expressions are currently not supported."),
967 ],),
968 match="dict",
971 register_rule(
972 RulespecGroupCheckParametersDiscovery,
973 varname="inventory_mssql_counters_rules",
974 title=_("Include MSSQL Counters services"),
975 valuespec=Dictionary(
976 elements=[
977 ("add_zero_based_services", Checkbox(title=_("Include service with zero base."))),
979 optional_keys=[]),
980 match="dict",
983 register_rule(
984 RulespecGroupCheckParametersDiscovery,
985 varname="inventory_fujitsu_ca_ports",
986 title=_("Discovery of Fujtsu storage CA ports"),
987 valuespec=Dictionary(
988 elements=[
989 ("indices", ListOfStrings(title=_("CA port indices"))),
990 ("modes",
991 DualListChoice(
992 title=_("CA port modes"),
993 choices=[
994 ("CA", _("CA")),
995 ("RA", _("RA")),
996 ("CARA", _("CARA")),
997 ("Initiator", _("Initiator")),
999 row=4,
1000 size=30,
1002 ],),
1003 match="dict",
1006 register_rule(
1007 RulespecGroupCheckParametersDiscovery,
1008 varname="discovery_mssql_backup",
1009 title=_("Discovery of MSSQL backup"),
1010 valuespec=Dictionary(
1011 elements=[
1012 ("mode",
1013 DropdownChoice(
1014 title=_("Backup modes"),
1015 choices=[
1016 ("summary", _("Create a service for each instance")),
1017 ("per_type", _("Create a service for each instance and backup type")),
1018 ])),
1019 ],),
1020 match="dict",
1024 # .--Applications--------------------------------------------------------.
1025 # | _ _ _ _ _ |
1026 # | / \ _ __ _ __ | (_) ___ __ _| |_(_) ___ _ __ ___ |
1027 # | / _ \ | '_ \| '_ \| | |/ __/ _` | __| |/ _ \| '_ \/ __| |
1028 # | / ___ \| |_) | |_) | | | (_| (_| | |_| | (_) | | | \__ \ |
1029 # | /_/ \_\ .__/| .__/|_|_|\___\__,_|\__|_|\___/|_| |_|___/ |
1030 # | |_| |_| |
1031 # '----------------------------------------------------------------------'
1033 register_rule(
1034 RulespecGroupCheckParametersApplications,
1035 varname="logwatch_rules",
1036 title=_('Logwatch Patterns'),
1037 valuespec=Transform(
1038 Dictionary(
1039 elements=[
1040 ("reclassify_patterns",
1041 ListOf(
1042 Tuple(
1043 help=_("This defines one logfile pattern rule"),
1044 show_titles=True,
1045 orientation="horizontal",
1046 elements=[
1047 DropdownChoice(
1048 title=_("State"),
1049 choices=[
1050 ('C', _('CRITICAL')),
1051 ('W', _('WARNING')),
1052 ('O', _('OK')),
1053 ('I', _('IGNORE')),
1056 RegExpUnicode(
1057 title=_("Pattern (Regex)"),
1058 size=40,
1059 mode=RegExp.infix,
1061 TextUnicode(
1062 title=_("Comment"),
1063 size=40,
1066 title=_("Reclassify state matching regex pattern"),
1067 help=
1068 _('<p>You can define one or several patterns (regular expressions) in each logfile pattern rule. '
1069 'These patterns are applied to the selected logfiles to reclassify the '
1070 'matching log messages. The first pattern which matches a line will '
1071 'be used for reclassifying a message. You can use the '
1072 '<a href="wato.py?mode=pattern_editor">Logfile Pattern Analyzer</a> '
1073 'to test the rules you defined here.</p>'
1074 '<p>Select "Ignore" as state to get the matching logs deleted. Other states will keep the '
1075 'log entries but reclassify the state of them.</p>'),
1076 add_label=_("Add pattern"),
1078 ("reclassify_states",
1079 Dictionary(
1080 title=_("Reclassify complete state"),
1081 help=_(
1082 "This setting allows you to convert all incoming states to another state. "
1083 "The option is applied before the state conversion via regexes. So the regex values can "
1084 "modify the state even further."),
1085 elements=[
1086 ("c_to",
1087 DropdownChoice(
1088 title=_("Change CRITICAL State to"),
1089 choices=[
1090 ('C', _('CRITICAL')),
1091 ('W', _('WARNING')),
1092 ('O', _('OK')),
1093 ('I', _('IGNORE')),
1094 ('.', _('Context Info')),
1096 default_value="C",
1098 ("w_to",
1099 DropdownChoice(
1100 title=_("Change WARNING State to"),
1101 choices=[
1102 ('C', _('CRITICAL')),
1103 ('W', _('WARNING')),
1104 ('O', _('OK')),
1105 ('I', _('IGNORE')),
1106 ('.', _('Context Info')),
1108 default_value="W",
1110 ("o_to",
1111 DropdownChoice(
1112 title=_("Change OK State to"),
1113 choices=[
1114 ('C', _('CRITICAL')),
1115 ('W', _('WARNING')),
1116 ('O', _('OK')),
1117 ('I', _('IGNORE')),
1118 ('.', _('Context Info')),
1120 default_value="O",
1122 ("._to",
1123 DropdownChoice(
1124 title=_("Change Context Info to"),
1125 choices=[
1126 ('C', _('CRITICAL')),
1127 ('W', _('WARNING')),
1128 ('O', _('OK')),
1129 ('I', _('IGNORE')),
1130 ('.', _('Context Info')),
1132 default_value=".",
1135 optional_keys=False,
1138 optional_keys=["reclassify_states"],
1140 forth=lambda x: isinstance(x, dict) and x or {"reclassify_patterns": x}),
1141 itemtype='item',
1142 itemname='Logfile',
1143 itemhelp=_("Put the item names of the logfiles here. For example \"System$\" "
1144 "to select the service \"LOG System\". You can use regular "
1145 "expressions which must match the beginning of the logfile name."),
1146 match='all',
1150 # .--Unsorted--(Don't create new stuff here!)----------------------------.
1151 # | _ _ _ _ |
1152 # | | | | |_ __ ___ ___ _ __| |_ ___ __| | |
1153 # | | | | | '_ \/ __|/ _ \| '__| __/ _ \/ _` | |
1154 # | | |_| | | | \__ \ (_) | | | || __/ (_| | |
1155 # | \___/|_| |_|___/\___/|_| \__\___|\__,_| |
1156 # | |
1157 # +----------------------------------------------------------------------+
1158 # | All these rules have not been moved into their according sections. |
1159 # | Please move them as you come along - but beware of dependecies! |
1160 # | Remove this section as soon as it's empty. |
1161 # '----------------------------------------------------------------------'
1163 register_rule(
1164 RulespecGroupCheckParametersStorage,
1165 varname="filesystem_groups",
1166 title=_('Filesystem grouping patterns'),
1167 help=_('Normally the filesystem checks (<tt>df</tt>, <tt>hr_fs</tt> and others) '
1168 'will create a single service for each filesystem. '
1169 'By defining grouping '
1170 'patterns you can handle groups of filesystems like one filesystem. '
1171 'For each group you can define one or several patterns. '
1172 'The filesystems matching one of the patterns '
1173 'will be monitored like one big filesystem in a single service.'),
1174 valuespec=ListOf(
1175 Tuple(
1176 show_titles=True,
1177 orientation="horizontal",
1178 elements=[
1179 TextAscii(title=_("Name of group"),),
1180 TextAscii(
1181 title=_("Pattern for mount point (using * and ?)"),
1182 help=_("You can specify one or several patterns containing "
1183 "<tt>*</tt> and <tt>?</tt>, for example <tt>/spool/tmpspace*</tt>. "
1184 "The filesystems matching the patterns will be monitored "
1185 "like one big filesystem in a single service."),
1188 add_label=_("Add pattern"),
1190 match='all',
1193 register_rule(
1194 RulespecGroupCheckParametersStorage,
1195 varname="fileinfo_groups",
1196 title=_('File Grouping Patterns'),
1197 help=_('The check <tt>fileinfo</tt> monitors the age and size of '
1198 'a single file. Each file information that is sent '
1199 'by the agent will create one service. By defining grouping '
1200 'patterns you can switch to the check <tt>fileinfo.groups</tt>. '
1201 'That check monitors a list of files at once. You can set levels '
1202 'not only for the total size and the age of the oldest/youngest '
1203 'file but also on the count. You can define one or several '
1204 'patterns for a group containing <tt>*</tt> and <tt>?</tt>, for example '
1205 '<tt>/var/log/apache/*.log</tt>. Please see Python\'s fnmatch for more '
1206 'information regarding globbing patterns and special characters. '
1207 'If the pattern begins with a tilde then this pattern is interpreted as '
1208 'a regular expression instead of as a filename globbing pattern and '
1209 '<tt>*</tt> and <tt>?</tt> are treated differently. '
1210 'For files contained in a group '
1211 'the discovery will automatically create a group service instead '
1212 'of single services for each file. This rule also applies when '
1213 'you use manually configured checks instead of inventorized ones. '
1214 'Furthermore, the current time/date in a configurable format '
1215 'may be included in the include pattern. The syntax is as follows: '
1216 '$DATE:format-spec$ or $YESTERDAY:format-spec$, where format-spec '
1217 'is a list of time format directives of the unix date command. '
1218 'Example: $DATE:%Y%m%d$ is todays date, e.g. 20140127. A pattern '
1219 'of /var/tmp/backups/$DATE:%Y%m%d$.txt would search for .txt files '
1220 'with todays date as name in the directory /var/tmp/backups. '
1221 'The YESTERDAY syntax simply subtracts one day from the reference time.'),
1222 valuespec=ListOf(
1223 Tuple(
1224 help=_("This defines one file grouping pattern."),
1225 show_titles=True,
1226 orientation="horizontal",
1227 elements=[
1228 TextAscii(
1229 title=_("Name of group"),
1230 size=10,
1232 Transform(
1233 Tuple(
1234 show_titles=True,
1235 orientation="vertical",
1236 elements=[
1237 TextAscii(title=_("Include Pattern"), size=40),
1238 TextAscii(title=_("Exclude Pattern"), size=40),
1241 forth=lambda params: isinstance(params, str) and (params, '') or params),
1244 add_label=_("Add pattern group"),
1246 match='all',
1249 register_check_parameters(
1250 RulespecGroupCheckParametersOperatingSystem,
1251 "cpu_load",
1252 _("CPU load (not utilization!)"),
1253 Levels(
1254 help=_("The CPU load of a system is the number of processes currently being "
1255 "in the state <u>running</u>, i.e. either they occupy a CPU or wait "
1256 "for one. The <u>load average</u> is the averaged CPU load over the last 1, "
1257 "5 or 15 minutes. The following levels will be applied on the average "
1258 "load. On Linux system the 15-minute average load is used when applying "
1259 "those levels. The configured levels are multiplied with the number of "
1260 "CPUs, so you should configure the levels based on the value you want to "
1261 "be warned \"per CPU\"."),
1262 unit="per core",
1263 default_difference=(2.0, 4.0),
1264 default_levels=(5.0, 10.0),
1266 None,
1267 match_type="first",
1270 register_check_parameters(
1271 RulespecGroupCheckParametersOperatingSystem,
1272 "cpu_utilization",
1273 _("CPU utilization for Appliances"),
1274 Optional(
1275 Tuple(elements=[
1276 Percentage(title=_("Warning at a utilization of")),
1277 Percentage(title=_("Critical at a utilization of"))
1279 label=_("Alert on too high CPU utilization"),
1280 help=_("The CPU utilization sums up the percentages of CPU time that is used "
1281 "for user processes and kernel routines over all available cores within "
1282 "the last check interval. The possible range is from 0% to 100%"),
1283 default_value=(90.0, 95.0)),
1284 None,
1285 match_type="first",
1288 register_check_parameters(
1289 RulespecGroupCheckParametersOperatingSystem,
1290 "cpu_utilization_multiitem",
1291 _("CPU utilization of Devices with Modules"),
1292 Dictionary(
1293 help=_("The CPU utilization sums up the percentages of CPU time that is used "
1294 "for user processes and kernel routines over all available cores within "
1295 "the last check interval. The possible range is from 0% to 100%"),
1296 elements=[
1298 "levels",
1299 Tuple(
1300 title=_("Alert on too high CPU utilization"),
1301 elements=[
1302 Percentage(title=_("Warning at a utilization of"), default_value=90.0),
1303 Percentage(title=_("Critical at a utilization of"), default_value=95.0)
1308 TextAscii(title=_("Module name"), allow_empty=False),
1309 match_type="dict",
1312 register_check_parameters(
1313 RulespecGroupCheckParametersOperatingSystem,
1314 "fpga_utilization",
1315 _("FPGA utilization"),
1316 Dictionary(
1317 help=_("Give FPGA utilization levels in percent. The possible range is from 0% to 100%."),
1318 elements=[
1320 "levels",
1321 Tuple(
1322 title=_("Alert on too high FPGA utilization"),
1323 elements=[
1324 Percentage(title=_("Warning at a utilization of"), default_value=80.0),
1325 Percentage(title=_("Critical at a utilization of"), default_value=90.0)
1330 TextAscii(title=_("FPGA"), allow_empty=False),
1331 match_type="dict",
1335 def transform_humidity(p):
1336 if isinstance(p, (list, tuple)):
1337 p = {
1338 "levels_lower": (float(p[1]), float(p[0])),
1339 "levels": (float(p[2]), float(p[3])),
1341 return p
1344 register_check_parameters(
1345 RulespecGroupCheckParametersEnvironment,
1346 "humidity",
1347 _("Humidity Levels"),
1348 Transform(
1349 Dictionary(
1350 help=_("This Ruleset sets the threshold limits for humidity sensors"),
1351 elements=[
1352 ("levels",
1353 Tuple(
1354 title=_("Upper levels"),
1355 elements=[
1356 Percentage(title=_("Warning at")),
1357 Percentage(title=_("Critical at")),
1358 ])),
1359 ("levels_lower",
1360 Tuple(
1361 title=_("Lower levels"),
1362 elements=[
1363 Percentage(title=_("Warning below")),
1364 Percentage(title=_("Critical below")),
1365 ])),
1367 forth=transform_humidity,
1369 TextAscii(
1370 title=_("Sensor name"),
1371 help=_("The identifier of the sensor."),
1373 match_type="dict",
1376 register_check_parameters(
1377 RulespecGroupCheckParametersEnvironment,
1378 "single_humidity",
1379 _("Humidity Levels for devices with a single sensor"),
1380 Tuple(
1381 help=_("This Ruleset sets the threshold limits for humidity sensors"),
1382 elements=[
1383 Integer(title=_("Critical at or below"), unit="%"),
1384 Integer(title=_("Warning at or below"), unit="%"),
1385 Integer(title=_("Warning at or above"), unit="%"),
1386 Integer(title=_("Critical at or above"), unit="%"),
1388 None,
1389 match_type="first",
1392 db_levels_common = [
1393 ("levels",
1394 Alternative(
1395 title=_("Levels for the Tablespace usage"),
1396 default_value=(10.0, 5.0),
1397 elements=[
1398 Tuple(
1399 title=_("Percentage free space"),
1400 elements=[
1401 Percentage(title=_("Warning if below"), unit=_("% free")),
1402 Percentage(title=_("Critical if below"), unit=_("% free")),
1404 Tuple(
1405 title=_("Absolute free space"),
1406 elements=[
1407 Integer(title=_("Warning if below"), unit=_("MB"), default_value=1000),
1408 Integer(title=_("Critical if below"), unit=_("MB"), default_value=500),
1410 ListOf(
1411 Tuple(
1412 orientation="horizontal",
1413 elements=[
1414 Filesize(title=_("Tablespace larger than")),
1415 Alternative(
1416 title=_("Levels for the Tablespace size"),
1417 elements=[
1418 Tuple(
1419 title=_("Percentage free space"),
1420 elements=[
1421 Percentage(title=_("Warning if below"), unit=_("% free")),
1422 Percentage(title=_("Critical if below"), unit=_("% free")),
1424 Tuple(
1425 title=_("Absolute free space"),
1426 elements=[
1427 Integer(title=_("Warning if below"), unit=_("MB")),
1428 Integer(title=_("Critical if below"), unit=_("MB")),
1433 title=_('Dynamic levels'),
1435 ])),
1436 ("magic",
1437 Float(
1438 title=_("Magic factor (automatic level adaptation for large tablespaces)"),
1439 help=_("This is only be used in case of percentual levels"),
1440 minvalue=0.1,
1441 maxvalue=1.0,
1442 default_value=0.9)),
1443 ("magic_normsize",
1444 Integer(
1445 title=_("Reference size for magic factor"), minvalue=1, default_value=1000, unit=_("MB"))),
1446 ("magic_maxlevels",
1447 Tuple(
1448 title=_("Maximum levels if using magic factor"),
1449 help=_("The tablespace levels will never be raise above these values, when using "
1450 "the magic factor and the tablespace is very small."),
1451 elements=[
1452 Percentage(
1453 title=_("Maximum warning level"),
1454 unit=_("% free"),
1455 allow_int=True,
1456 default_value=60.0),
1457 Percentage(
1458 title=_("Maximum critical level"),
1459 unit=_("% free"),
1460 allow_int=True,
1461 default_value=50.0)
1465 register_check_parameters(
1466 RulespecGroupCheckParametersApplications,
1467 "oracle_tablespaces",
1468 _("Oracle Tablespaces"),
1469 Dictionary(
1470 help=_("A tablespace is a container for segments (tables, indexes, etc). A "
1471 "database consists of one or more tablespaces, each made up of one or "
1472 "more data files. Tables and indexes are created within a particular "
1473 "tablespace. "
1474 "This rule allows you to define checks on the size of tablespaces."),
1475 elements=db_levels_common + [
1476 ("autoextend",
1477 DropdownChoice(
1478 title=_("Expected autoextend setting"),
1479 choices=[
1480 (True, _("Autoextend is expected to be ON")),
1481 (False, _("Autoextend is expected to be OFF")),
1482 (None, _("Autoextend will be ignored")),
1483 ])),
1484 ("autoextend_severity",
1485 MonitoringState(
1486 title=_("Severity of invalid autoextend setting"),
1487 default_value=2,
1489 ("defaultincrement",
1490 DropdownChoice(
1491 title=_("Default Increment"),
1492 choices=[
1493 (True, _("State is WARNING in case the next extent has the default size.")),
1494 (False, _("Ignore default increment")),
1495 ])),
1496 ("map_file_online_states",
1497 ListOf(
1498 Tuple(
1499 orientation="horizontal",
1500 elements=[
1501 DropdownChoice(choices=[
1502 ("RECOVER", _("Recover")),
1503 ("OFFLINE", _("Offline")),
1505 MonitoringState()
1507 title=_('Map file online states'),
1509 ("temptablespace",
1510 DropdownChoice(
1511 title=_("Monitor temporary Tablespace"),
1512 choices=[
1513 (False, _("Ignore temporary Tablespaces (Default)")),
1514 (True, _("Apply rule to temporary Tablespaces")),
1515 ])),
1518 TextAscii(
1519 title=_("Explicit tablespaces"),
1520 help=
1521 _("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>"
1523 regex=r'.+\..+',
1524 allow_empty=False),
1525 match_type="dict",
1528 register_check_parameters(
1529 RulespecGroupCheckParametersApplications,
1530 "oracle_processes",
1531 _("Oracle Processes"),
1532 Dictionary(
1533 help=_(
1534 "Here you can override the default levels for the ORACLE Processes check. The levels "
1535 "are applied on the number of used processes in percentage of the configured limit."),
1536 elements=[
1537 ("levels",
1538 Tuple(
1539 title=_("Levels for used processes"),
1540 elements=[
1541 Percentage(title=_("Warning if more than"), default_value=70.0),
1542 Percentage(title=_("Critical if more than"), default_value=90.0)
1543 ])),
1545 optional_keys=False,
1547 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
1548 "dict",
1551 register_check_parameters(
1552 RulespecGroupCheckParametersApplications,
1553 "oracle_recovery_area",
1554 _("Oracle Recovery Area"),
1555 Dictionary(elements=[("levels",
1556 Tuple(
1557 title=_("Levels for used space (reclaimable is considered as free)"),
1558 elements=[
1559 Percentage(title=_("warning at"), default_value=70.0),
1560 Percentage(title=_("critical at"), default_value=90.0),
1561 ]))]),
1562 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
1563 "dict",
1566 register_check_parameters(
1567 RulespecGroupCheckParametersApplications,
1568 "oracle_dataguard_stats",
1569 _("Oracle Data-Guard Stats"),
1570 Dictionary(
1571 help=
1572 _("The Data-Guard statistics are available in Oracle Enterprise Edition with enabled Data-Guard. "
1573 "The <tt>init.ora</tt> parameter <tt>dg_broker_start</tt> must be <tt>TRUE</tt> for this check. "
1574 "The apply and transport lag can be configured with this rule."),
1575 elements=[
1576 ("apply_lag",
1577 Tuple(
1578 title=_("Apply Lag Maximum Time"),
1579 help=_("The maximum limit for the apply lag in <tt>v$dataguard_stats</tt>."),
1580 elements=[Age(title=_("Warning at"),),
1581 Age(title=_("Critical at"),)])),
1582 ("apply_lag_min",
1583 Tuple(
1584 title=_("Apply Lag Minimum Time"),
1585 help=_(
1586 "The minimum limit for the apply lag in <tt>v$dataguard_stats</tt>. "
1587 "This is only useful if also <i>Apply Lag Maximum Time</i> has been configured."
1589 elements=[Age(title=_("Warning at"),),
1590 Age(title=_("Critical at"),)])),
1591 ("transport_lag",
1592 Tuple(
1593 title=_("Transport Lag"),
1594 help=_("The limit for the transport lag in <tt>v$dataguard_stats</tt>"),
1595 elements=[Age(title=_("Warning at"),),
1596 Age(title=_("Critical at"),)])),
1598 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
1599 "dict",
1602 register_check_parameters(
1603 RulespecGroupCheckParametersApplications,
1604 "oracle_undostat",
1605 _("Oracle Undo Retention"),
1606 Dictionary(elements=[
1607 ("levels",
1608 Tuple(
1609 title=_("Levels for remaining undo retention"),
1610 elements=[
1611 Age(title=_("warning if less then"), default_value=600),
1612 Age(title=_("critical if less then"), default_value=300),
1613 ])),
1615 'nospaceerrcnt_state',
1616 MonitoringState(
1617 default_value=2,
1618 title=_("State in case of non space error count is greater then 0: "),
1622 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
1623 "dict",
1626 register_check_parameters(
1627 RulespecGroupCheckParametersApplications,
1628 "oracle_rman",
1629 _("Oracle RMAN Backups"),
1630 Dictionary(elements=[("levels",
1631 Tuple(
1632 title=_("Maximum Age for RMAN backups"),
1633 elements=[
1634 Age(title=_("warning if older than"), default_value=1800),
1635 Age(title=_("critical if older than"), default_value=3600),
1636 ]))]),
1637 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
1638 "dict",
1641 register_check_parameters(
1642 RulespecGroupCheckParametersApplications,
1643 "oracle_recovery_status",
1644 _("Oracle Recovery Status"),
1645 Dictionary(elements=[("levels",
1646 Tuple(
1647 title=_("Levels for checkpoint time"),
1648 elements=[
1649 Age(title=_("warning if higher then"), default_value=1800),
1650 Age(title=_("critical if higher then"), default_value=3600),
1651 ])),
1652 ("backup_age",
1653 Tuple(
1654 title=_("Levels for user managed backup files"),
1655 help=_("Important! This checks is only for monitoring of datafiles "
1656 "who were left in backup mode. "
1657 "(alter database datafile ... begin backup;) "),
1658 elements=[
1659 Age(title=_("warning if higher then"), default_value=1800),
1660 Age(title=_("critical if higher then"), default_value=3600),
1661 ]))]),
1662 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
1663 "dict",
1666 register_check_parameters(
1667 RulespecGroupCheckParametersApplications,
1668 "oracle_jobs",
1669 _("Oracle Scheduler Job"),
1670 Dictionary(
1671 help=_("A scheduler job is an object in an ORACLE database which could be "
1672 "compared to a cron job on Unix. "),
1673 elements=[
1674 ("run_duration",
1675 Tuple(
1676 title=_("Maximum run duration for last execution"),
1677 help=_("Here you can define an upper limit for the run duration of "
1678 "last execution of the job."),
1679 elements=[
1680 Age(title=_("warning at")),
1681 Age(title=_("critical at")),
1682 ])),
1683 ("disabled",
1684 DropdownChoice(
1685 title=_("Job State"),
1686 help=_("The state of the job is ignored per default."),
1687 totext="",
1688 choices=[
1689 (True, _("Ignore the state of the Job")),
1690 (False, _("Consider the state of the job")),
1693 ("status_disabled_jobs",
1694 MonitoringState(title="Status of service in case of disabled job", default_value=0)),
1695 ("status_missing_jobs",
1696 MonitoringState(
1697 title=_("Status of service in case of missing job."),
1698 default_value=2,
1701 TextAscii(
1702 title=_("Scheduler Job Name"),
1703 help=_("Here you can set explicit Scheduler-Jobs by defining them via SID, Job-Owner "
1704 "and Job-Name, separated by a dot, for example <tt>TUX12C.SYS.PURGE_LOG</tt>"),
1705 regex=r'.+\..+',
1706 allow_empty=False),
1707 match_type="dict",
1710 register_check_parameters(
1711 RulespecGroupCheckParametersApplications,
1712 "oracle_instance",
1713 _("Oracle Instance"),
1714 Dictionary(
1715 title=_("Consider state of Archivelogmode: "),
1716 elements=[
1717 ('archivelog',
1718 MonitoringState(
1719 default_value=0,
1720 title=_("State in case of Archivelogmode is enabled: "),
1723 'noarchivelog',
1724 MonitoringState(
1725 default_value=1,
1726 title=_("State in case of Archivelogmode is disabled: "),
1730 'forcelogging',
1731 MonitoringState(
1732 default_value=0,
1733 title=_("State in case of Force Logging is enabled: "),
1737 'noforcelogging',
1738 MonitoringState(
1739 default_value=1,
1740 title=_("State in case of Force Logging is disabled: "),
1744 'logins',
1745 MonitoringState(
1746 default_value=2,
1747 title=_("State in case of logins are not possible: "),
1751 'primarynotopen',
1752 MonitoringState(
1753 default_value=2,
1754 title=_("State in case of Database is PRIMARY and not OPEN: "),
1757 ('uptime_min',
1758 Tuple(
1759 title=_("Minimum required uptime"),
1760 elements=[
1761 Age(title=_("Warning if below")),
1762 Age(title=_("Critical if below")),
1763 ])),
1764 ('ignore_noarchivelog',
1765 Checkbox(
1766 title=_("Ignore state of no-archive log"),
1767 label=_("Enable"),
1768 help=_("If active, only a single summary item is displayed. The summary "
1769 "will explicitly mention sensors in warn/crit state but the "
1770 "sensors that are ok are aggregated."),
1771 default_value=False)),
1774 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
1775 match_type="dict",
1778 register_check_parameters(
1779 RulespecGroupCheckParametersApplications, "asm_diskgroup",
1780 _("ASM Disk Group (used space and growth)"),
1781 Dictionary(
1782 elements=filesystem_elements + [
1783 ("req_mir_free",
1784 DropdownChoice(
1785 title=_("Handling for required mirror space"),
1786 totext="",
1787 choices=[
1788 (False, _("Do not regard required mirror space as free space")),
1789 (True, _("Regard required mirror space as free space")),
1791 help=_(
1792 "ASM calculates the free space depending on free_mb or required mirror "
1793 "free space. Enable this option to set the check against required "
1794 "mirror free space. This only works for normal or high redundancy Disk Groups."
1795 ))),
1797 hidden_keys=["flex_levels"],
1799 TextAscii(
1800 title=_("ASM Disk Group"),
1801 help=_("Specify the name of the ASM Disk Group "),
1802 allow_empty=False), "dict")
1805 def _vs_mssql_backup_age(title):
1806 return Alternative(
1807 title=_("%s" % title),
1808 style="dropdown",
1809 elements=[
1810 Tuple(
1811 title=_("Set levels"),
1812 elements=[
1813 Age(title=_("Warning if older than")),
1814 Age(title=_("Critical if older than")),
1816 Tuple(
1817 title=_("No levels"),
1818 elements=[
1819 FixedValue(None, totext=""),
1820 FixedValue(None, totext=""),
1824 register_check_parameters(
1825 RulespecGroupCheckParametersApplications,
1826 "mssql_backup",
1827 _("MSSQL Backup summary"),
1828 Transform(
1829 Dictionary(
1830 help = _("This rule allows you to set limits on the age of backups for "
1831 "different backup types. If your agent does not support "
1832 "backup types (e.g. <i>Log Backup</i>, <i>Database Diff "
1833 "Backup</i>, etc.) you can use the option <i>Database Backup"
1834 "</i> to set a general limit"),
1835 elements = [
1836 ("database", _vs_mssql_backup_age("Database backup")),
1837 ("database_diff", _vs_mssql_backup_age("Database diff backup")),
1838 ("log", _vs_mssql_backup_age("Log backup")),
1839 ("file_or_filegroup", _vs_mssql_backup_age("File or filegroup backup")),
1840 ("file_diff", _vs_mssql_backup_age("File diff backup")),
1841 ("partial", _vs_mssql_backup_age("Partial backup")),
1842 ("partial_diff", _vs_mssql_backup_age("Partial diff backup")),
1843 ("unspecific", _vs_mssql_backup_age("Unspecific backup")),
1844 ("not_found", MonitoringState(title=_("State if no backup found"))),
1847 forth = lambda params: (params if isinstance(params, dict)
1848 else {'database': (params[0], params[1])})
1850 TextAscii(
1851 title = _("Service descriptions"),
1852 allow_empty = False),
1853 "first",
1856 register_check_parameters(
1857 RulespecGroupCheckParametersApplications,
1858 "mssql_backup_per_type",
1859 _("MSSQL Backup"),
1860 Dictionary(elements=[
1861 ("levels", _vs_mssql_backup_age("Upper levels for the backup age")),
1863 TextAscii(title=_("Backup name"), allow_empty=False),
1864 "dict",
1867 register_check_parameters(
1868 RulespecGroupCheckParametersApplications, "mssql_file_sizes",
1869 _("MSSQL Log and Data File Sizes"),
1870 Dictionary(
1871 title=_("File Size Levels"),
1872 elements=[
1873 ("data_files",
1874 Tuple(
1875 title=_("Levels for Datafiles"),
1876 elements=[
1877 Filesize(title=_("Warning at")),
1878 Filesize(title=_("Critical at")),
1879 ])),
1880 ("log_files",
1881 Tuple(
1882 title=_("Log files: Absolute upper thresholds"),
1883 elements=[Filesize(title=_("Warning at")),
1884 Filesize(title=_("Critical at"))])),
1885 ("log_files_used",
1886 Alternative(
1887 title=_("Levels for log files used"),
1888 elements=[
1889 Tuple(
1890 title=_("Upper absolute levels"),
1891 elements=[
1892 Filesize(title=_("Warning at")),
1893 Filesize(title=_("Critical at"))
1895 Tuple(
1896 title=_("Upper percentage levels"),
1897 elements=[
1898 Percentage(title=_("Warning at")),
1899 Percentage(title=_("Critical at"))
1901 ])),
1902 ]), TextAscii(title=_("Service descriptions"), allow_empty=False), "dict")
1904 register_check_parameters(
1905 RulespecGroupCheckParametersApplications,
1906 "mssql_tablespaces",
1907 _("MSSQL Size of Tablespace"),
1908 Dictionary(
1909 elements=[
1910 ("size",
1911 Tuple(
1912 title=_("Upper levels for size"),
1913 elements=[Filesize(title=_("Warning at")),
1914 Filesize(title=_("Critical at"))])),
1915 ("reserved",
1916 Alternative(
1917 title=_("Upper levels for reserved space"),
1918 elements=[
1919 Tuple(
1920 title=_("Absolute levels"),
1921 elements=[
1922 Filesize(title=_("Warning at")),
1923 Filesize(title=_("Critical at"))
1925 Tuple(
1926 title=_("Percentage levels"),
1927 elements=[
1928 Percentage(title=_("Warning at")),
1929 Percentage(title=_("Critical at"))
1931 ])),
1932 ("data",
1933 Alternative(
1934 title=_("Upper levels for data"),
1935 elements=[
1936 Tuple(
1937 title=_("Absolute levels"),
1938 elements=[
1939 Filesize(title=_("Warning at")),
1940 Filesize(title=_("Critical at"))
1942 Tuple(
1943 title=_("Percentage levels"),
1944 elements=[
1945 Percentage(title=_("Warning at")),
1946 Percentage(title=_("Critical at"))
1948 ])),
1949 ("indexes",
1950 Alternative(
1951 title=_("Upper levels for indexes"),
1952 elements=[
1953 Tuple(
1954 title=_("Absolute levels"),
1955 elements=[
1956 Filesize(title=_("Warning at")),
1957 Filesize(title=_("Critical at"))
1959 Tuple(
1960 title=_("Percentage levels"),
1961 elements=[
1962 Percentage(title=_("Warning at")),
1963 Percentage(title=_("Critical at"))
1965 ])),
1966 ("unused",
1967 Alternative(
1968 title=_("Upper levels for unused space"),
1969 elements=[
1970 Tuple(
1971 title=_("Absolute levels"),
1972 elements=[
1973 Filesize(title=_("Warning at")),
1974 Filesize(title=_("Critical at"))
1976 Tuple(
1977 title=_("Percentage levels"),
1978 elements=[
1979 Percentage(title=_("Warning at")),
1980 Percentage(title=_("Critical at"))
1982 ])),
1983 ("unallocated",
1984 Alternative(
1985 title=_("Lower levels for unallocated space"),
1986 elements=[
1987 Tuple(
1988 title=_("Absolute levels"),
1989 elements=[
1990 Filesize(title=_("Warning below")),
1991 Filesize(title=_("Critical below"))
1993 Tuple(
1994 title=_("Percentage levels"),
1995 elements=[
1996 Percentage(title=_("Warning below")),
1997 Percentage(title=_("Critical below"))
1999 ])),
2000 ],),
2001 TextAscii(title=_("Tablespace name"), allow_empty=False),
2002 match_type="dict",
2005 register_check_parameters(
2006 RulespecGroupCheckParametersApplications,
2007 "mssql_page_activity",
2008 _("MSSQL Page Activity"),
2009 Dictionary(
2010 title=_("Page Activity Levels"),
2011 elements=[
2012 ("page_reads/sec",
2013 Tuple(
2014 title=_("Reads/sec"),
2015 elements=[
2016 Float(title=_("warning at"), unit=_("/sec")),
2017 Float(title=_("critical at"), unit=_("/sec")),
2018 ])),
2019 ("page_writes/sec",
2020 Tuple(
2021 title=_("Writes/sec"),
2022 elements=[
2023 Float(title=_("warning at"), unit=_("/sec")),
2024 Float(title=_("critical at"), unit=_("/sec")),
2025 ])),
2026 ("page_lookups/sec",
2027 Tuple(
2028 title=_("Lookups/sec"),
2029 elements=[
2030 Float(title=_("warning at"), unit=_("/sec")),
2031 Float(title=_("critical at"), unit=_("/sec")),
2032 ])),
2034 TextAscii(title=_("Service descriptions"), allow_empty=False),
2035 match_type="dict")
2038 def levels_absolute_or_dynamic(name, value):
2039 return Alternative(
2040 title=_("Levels of %s %s") % (name, value),
2041 default_value=(80.0, 90.0),
2042 elements=[
2043 Tuple(
2044 title=_("Percentage %s space") % value,
2045 elements=[
2046 Percentage(title=_("Warning at"), unit=_("% used")),
2047 Percentage(title=_("Critical at"), unit=_("% used")),
2049 Tuple(
2050 title=_("Absolute %s space") % value,
2051 elements=[
2052 Integer(title=_("Warning at"), unit=_("MB"), default_value=500),
2053 Integer(title=_("Critical at"), unit=_("MB"), default_value=1000),
2055 ListOf(
2056 Tuple(
2057 orientation="horizontal",
2058 elements=[
2059 Filesize(title=_(" larger than")),
2060 Alternative(
2061 title=_("Levels for the %s %s size") % (name, value),
2062 elements=[
2063 Tuple(
2064 title=_("Percentage %s space") % value,
2065 elements=[
2066 Percentage(title=_("Warning at"), unit=_("% used")),
2067 Percentage(title=_("Critical at"), unit=_("% used")),
2069 Tuple(
2070 title=_("Absolute free space"),
2071 elements=[
2072 Integer(title=_("Warning at"), unit=_("MB")),
2073 Integer(title=_("Critical at"), unit=_("MB")),
2078 title=_('Dynamic levels'),
2083 register_check_parameters(
2084 RulespecGroupCheckParametersApplications, "mssql_transactionlogs",
2085 _("MSSQL Transactionlog Sizes"),
2086 Dictionary(
2087 title=_("File Size Levels"),
2088 help=_("Specify levels for transactionlogs of a database. Please note that relative "
2089 "levels will only work if there is a max_size set for the file on the database "
2090 "side."),
2091 elements=[
2092 ("used_levels", levels_absolute_or_dynamic(_("Transactionlog"), _("used"))),
2093 ("allocated_used_levels",
2094 levels_absolute_or_dynamic(_("Transactionlog"), _("used of allocation"))),
2095 ("allocated_levels", levels_absolute_or_dynamic(_("Transactionlog"), _("allocated"))),
2096 ]), TextAscii(title=_("Database Name"), allow_empty=False), "dict")
2098 register_check_parameters(
2099 RulespecGroupCheckParametersApplications, "mssql_datafiles", _("MSSQL Datafile Sizes"),
2100 Dictionary(
2101 title=_("File Size Levels"),
2102 help=_("Specify levels for datafiles of a database. Please note that relative "
2103 "levels will only work if there is a max_size set for the file on the database "
2104 "side."),
2105 elements=[
2106 ("used_levels", levels_absolute_or_dynamic(_("Datafile"), _("used"))),
2107 ("allocated_used_levels",
2108 levels_absolute_or_dynamic(_("Datafile"), _("used of allocation"))),
2109 ("allocated_levels", levels_absolute_or_dynamic(_("Datafile"), _("allocated"))),
2110 ]), TextAscii(title=_("Database Name"), allow_empty=False), "dict")
2112 register_check_parameters(
2113 RulespecGroupCheckParametersApplications,
2114 "vm_snapshots",
2115 _("Virtual Machine Snapshots"),
2116 Dictionary(elements=[
2117 ("age",
2118 Tuple(
2119 title=_("Age of the last snapshot"),
2120 elements=[
2121 Age(title=_("Warning if older than")),
2122 Age(title=_("Critical if older than"))
2123 ])),
2124 ("age_oldest",
2125 Tuple(
2126 title=_("Age of the oldest snapshot"),
2127 elements=[
2128 Age(title=_("Warning if older than")),
2129 Age(title=_("Critical if older than"))
2130 ])),
2132 None,
2133 match_type="dict",
2136 register_check_parameters(
2137 RulespecGroupCheckParametersApplications,
2138 "veeam_backup",
2139 _("Veeam: Time since last Backup"),
2140 Dictionary(elements=[("age",
2141 Tuple(
2142 title=_("Time since end of last backup"),
2143 elements=[
2144 Age(title=_("Warning if older than"), default_value=108000),
2145 Age(title=_("Critical if older than"), default_value=172800)
2146 ]))]),
2147 TextAscii(title=_("Job name")),
2148 match_type="dict",
2151 register_check_parameters(
2152 RulespecGroupCheckParametersApplications,
2153 "backup_timemachine",
2154 _("Age of timemachine backup"),
2155 Dictionary(elements=[("age",
2156 Tuple(
2157 title=_("Maximum age of latest timemachine backup"),
2158 elements=[
2159 Age(title=_("Warning if older than"), default_value=86400),
2160 Age(title=_("Critical if older than"), default_value=172800)
2161 ]))]),
2162 None,
2163 match_type="dict",
2166 register_check_parameters(
2167 RulespecGroupCheckParametersApplications,
2168 "job",
2169 _("Age of jobs controlled by mk-job"),
2170 Dictionary(elements=[
2171 ("age",
2172 Tuple(
2173 title=_("Maximum time since last start of job execution"),
2174 elements=[
2175 Age(title=_("Warning at"), default_value=0),
2176 Age(title=_("Critical at"), default_value=0)
2177 ])),
2178 ("outcome_on_cluster",
2179 DropdownChoice(
2180 title=_("Clusters: Prefered check result of local checks"),
2181 help=_("If you're running local checks on clusters via clustered services rule "
2182 "you can influence the check result with this rule. You can choose between "
2183 "best or worst state. Default setting is worst state."),
2184 choices=[
2185 ("worst", _("Worst state")),
2186 ("best", _("Best state")),
2188 default_value="worst")),
2190 TextAscii(title=_("Job name"),),
2191 match_type="dict",
2194 register_check_parameters(
2195 RulespecGroupCheckParametersApplications,
2196 "mssql_counters_locks",
2197 _("MSSQL Locks"),
2198 Dictionary(
2199 help=_("This check monitors locking related information of MSSQL tablespaces."),
2200 elements=[
2202 "lock_requests/sec",
2203 Tuple(
2204 title=_("Lock Requests / sec"),
2205 help=
2206 _("Number of new locks and lock conversions per second requested from the lock manager."
2208 elements=[
2209 Float(title=_("Warning at"), unit=_("requests/sec")),
2210 Float(title=_("Critical at"), unit=_("requests/sec")),
2215 "lock_timeouts/sec",
2216 Tuple(
2217 title=_("Lock Timeouts / sec"),
2218 help=
2219 _("Number of lock requests per second that timed out, including requests for NOWAIT locks."
2221 elements=[
2222 Float(title=_("Warning at"), unit=_("timeouts/sec")),
2223 Float(title=_("Critical at"), unit=_("timeouts/sec")),
2228 "number_of_deadlocks/sec",
2229 Tuple(
2230 title=_("Number of Deadlocks / sec"),
2231 help=_("Number of lock requests per second that resulted in a deadlock."),
2232 elements=[
2233 Float(title=_("Warning at"), unit=_("deadlocks/sec")),
2234 Float(title=_("Critical at"), unit=_("deadlocks/sec")),
2239 "lock_waits/sec",
2240 Tuple(
2241 title=_("Lock Waits / sec"),
2242 help=_("Number of lock requests per second that required the caller to wait."),
2243 elements=[
2244 Float(title=_("Warning at"), unit=_("waits/sec")),
2245 Float(title=_("Critical at"), unit=_("waits/sec")),
2250 TextAscii(title=_("Service descriptions"), allow_empty=False),
2251 match_type="dict",
2254 mssql_waittypes = [
2255 "ABR",
2256 "ASSEMBLY_LOAD",
2257 "ASYNC_DISKPOOL_LOCK",
2258 "ASYNC_IO_COMPLETION",
2259 "ASYNC_NETWORK_IO",
2260 "AUDIT_GROUPCACHE_LOCK",
2261 "AUDIT_LOGINCACHE_LOCK",
2262 "AUDIT_ON_DEMAND_TARGET_LOCK",
2263 "AUDIT_XE_SESSION_MGR",
2264 "BACKUP",
2265 "BACKUP_OPERATOR",
2266 "BACKUPBUFFER",
2267 "BACKUPIO",
2268 "BACKUPTHREAD",
2269 "BAD_PAGE_PROCESS",
2270 "BROKER_CONNECTION_RECEIVE_TASK",
2271 "BROKER_ENDPOINT_STATE_MUTEX",
2272 "BROKER_EVENTHANDLER",
2273 "BROKER_INIT",
2274 "BROKER_MASTERSTART",
2275 "BROKER_RECEIVE_WAITFOR",
2276 "BROKER_REGISTERALLENDPOINTS",
2277 "BROKER_SERVICE",
2278 "BROKER_SHUTDOWN",
2279 "BROKER_TASK_STOP",
2280 "BROKER_TO_FLUSH",
2281 "BROKER_TRANSMITTER",
2282 "BUILTIN_HASHKEY_MUTEX",
2283 "CHECK_PRINT_RECORD",
2284 "CHECKPOINT_QUEUE",
2285 "CHKPT",
2286 "CLEAR_DB",
2287 "CLR_AUTO_EVENT",
2288 "CLR_CRST",
2289 "CLR_JOIN",
2290 "CLR_MANUAL_EVENT",
2291 "CLR_MEMORY_SPY",
2292 "CLR_MONITOR",
2293 "CLR_RWLOCK_READER",
2294 "CLR_RWLOCK_WRITER",
2295 "CLR_SEMAPHORE",
2296 "CLR_TASK_START",
2297 "CLRHOST_STATE_ACCESS",
2298 "CMEMTHREAD",
2299 "CXCONSUMER",
2300 "CXPACKET",
2301 "CXROWSET_SYNC",
2302 "DAC_INIT",
2303 "DBMIRROR_DBM_EVENT",
2304 "DBMIRROR_DBM_MUTEX",
2305 "DBMIRROR_EVENTS_QUEUE",
2306 "DBMIRROR_SEND",
2307 "DBMIRROR_WORKER_QUEUE",
2308 "DBMIRRORING_CMD",
2309 "DEADLOCK_ENUM_MUTEX",
2310 "DEADLOCK_TASK_SEARCH",
2311 "DEBUG",
2312 "DISABLE_VERSIONING",
2313 "DISKIO_SUSPEND",
2314 "DISPATCHER_QUEUE_SEMAPHORE",
2315 "DLL_LOADING_MUTEX",
2316 "DROPTEMP",
2317 "DTC",
2318 "DTC_ABORT_REQUEST",
2319 "DTC_RESOLVE",
2320 "DTC_STATE",
2321 "DTC_TMDOWN_REQUEST",
2322 "DTC_WAITFOR_OUTCOME",
2323 "DUMP_LOG_COORDINATOR",
2324 "DUMPTRIGGER",
2325 "EC",
2326 "EE_PMOLOCK",
2327 "EE_SPECPROC_MAP_INIT",
2328 "ENABLE_VERSIONING",
2329 "ERROR_REPORTING_MANAGER",
2330 "EXCHANGE",
2331 "EXECSYNC",
2332 "EXECUTION_PIPE_EVENT_INTERNAL",
2333 "FAILPOINT",
2334 "FCB_REPLICA_READ",
2335 "FCB_REPLICA_WRITE",
2336 "FS_FC_RWLOCK",
2337 "FS_GARBAGE_COLLECTOR_SHUTDOWN",
2338 "FS_HEADER_RWLOCK",
2339 "FS_LOGTRUNC_RWLOCK",
2340 "FSA_FORCE_OWN_XACT",
2341 "FSAGENT",
2342 "FSTR_CONFIG_MUTEX",
2343 "FSTR_CONFIG_RWLOCK",
2344 "FT_COMPROWSET_RWLOCK",
2345 "FT_IFTS_RWLOCK",
2346 "FT_IFTS_SCHEDULER_IDLE_WAIT",
2347 "FT_IFTSHC_MUTEX",
2348 "FT_IFTSISM_MUTEX",
2349 "FT_MASTER_MERGE",
2350 "FT_METADATA_MUTEX",
2351 "FT_RESTART_CRAWL",
2352 "FULLTEXT",
2353 "GUARDIAN",
2354 "HADR_AG_MUTEX",
2355 "HADR_AR_CRITICAL_SECTION_ENTRY",
2356 "HADR_AR_MANAGER_MUTEX",
2357 "HADR_ARCONTROLLER_NOTIFICATIONS_SUBSCRIBER_LIST",
2358 "HADR_BACKUP_BULK_LOCK",
2359 "HADR_BACKUP_QUEUE",
2360 "HADR_CLUSAPI_CALL",
2361 "HADR_COMPRESSED_CACHE_SYNC",
2362 "HADR_DATABASE_FLOW_CONTROL",
2363 "HADR_DATABASE_VERSIONING_STATE",
2364 "HADR_DATABASE_WAIT_FOR_RESTART",
2365 "HADR_DATABASE_WAIT_FOR_TRANSITION_TO_VERSIONING",
2366 "HADR_DB_COMMAND",
2367 "HADR_DB_OP_COMPLETION_SYNC",
2368 "HADR_DB_OP_START_SYNC",
2369 "HADR_DBR_SUBSCRIBER",
2370 "HADR_DBR_SUBSCRIBER_FILTER_LIST",
2371 "HADR_DBSTATECHANGE_SYNC",
2372 "HADR_FILESTREAM_BLOCK_FLUSH",
2373 "HADR_FILESTREAM_FILE_CLOSE",
2374 "HADR_FILESTREAM_FILE_REQUEST",
2375 "HADR_FILESTREAM_IOMGR",
2376 "HADR_FILESTREAM_IOMGR_IOCOMPLETION",
2377 "HADR_FILESTREAM_MANAGER",
2378 "HADR_GROUP_COMMIT",
2379 "HADR_LOGCAPTURE_SYNC",
2380 "HADR_LOGCAPTURE_WAIT",
2381 "HADR_LOGPROGRESS_SYNC",
2382 "HADR_NOTIFICATION_DEQUEUE",
2383 "HADR_NOTIFICATION_WORKER_EXCLUSIVE_ACCESS",
2384 "HADR_NOTIFICATION_WORKER_STARTUP_SYNC",
2385 "HADR_NOTIFICATION_WORKER_TERMINATION_SYNC",
2386 "HADR_PARTNER_SYNC",
2387 "HADR_READ_ALL_NETWORKS",
2388 "HADR_RECOVERY_WAIT_FOR_CONNECTION",
2389 "HADR_RECOVERY_WAIT_FOR_UNDO",
2390 "HADR_REPLICAINFO_SYNC",
2391 "HADR_SYNC_COMMIT",
2392 "HADR_SYNCHRONIZING_THROTTLE",
2393 "HADR_TDS_LISTENER_SYNC",
2394 "HADR_TDS_LISTENER_SYNC_PROCESSING",
2395 "HADR_TIMER_TASK",
2396 "HADR_TRANSPORT_DBRLIST",
2397 "HADR_TRANSPORT_FLOW_CONTROL",
2398 "HADR_TRANSPORT_SESSION",
2399 "HADR_WORK_POOL",
2400 "HADR_WORK_QUEUE",
2401 "HADR_XRF_STACK_ACCESS",
2402 "HTTP_ENUMERATION",
2403 "HTTP_START",
2404 "IMPPROV_IOWAIT",
2405 "INTERNAL_TESTING",
2406 "IO_AUDIT_MUTEX",
2407 "IO_COMPLETION",
2408 "IO_RETRY",
2409 "IOAFF_RANGE_QUEUE",
2410 "KSOURCE_WAKEUP",
2411 "KTM_ENLISTMENT",
2412 "KTM_RECOVERY_MANAGER",
2413 "KTM_RECOVERY_RESOLUTION",
2414 "LATCH_DT",
2415 "LATCH_EX",
2416 "LATCH_KP",
2417 "LATCH_NL",
2418 "LATCH_SH",
2419 "LATCH_UP",
2420 "LAZYWRITER_SLEEP",
2421 "LCK_M_BU",
2422 "LCK_M_BU_ABORT_BLOCKERS",
2423 "LCK_M_BU_LOW_PRIORITY",
2424 "LCK_M_IS",
2425 "LCK_M_IS_ABORT_BLOCKERS",
2426 "LCK_M_IS_LOW_PRIORITY",
2427 "LCK_M_IU",
2428 "LCK_M_IU_ABORT_BLOCKERS",
2429 "LCK_M_IU_LOW_PRIORITY",
2430 "LCK_M_IX",
2431 "LCK_M_IX_ABORT_BLOCKERS",
2432 "LCK_M_IX_LOW_PRIORITY",
2433 "LCK_M_RIn_NL",
2434 "LCK_M_RIn_NL_ABORT_BLOCKERS",
2435 "LCK_M_RIn_NL_LOW_PRIORITY",
2436 "LCK_M_RIn_S",
2437 "LCK_M_RIn_S_ABORT_BLOCKERS",
2438 "LCK_M_RIn_S_LOW_PRIORITY",
2439 "LCK_M_RIn_U",
2440 "LCK_M_RIn_U_ABORT_BLOCKERS",
2441 "LCK_M_RIn_U_LOW_PRIORITY",
2442 "LCK_M_RIn_X",
2443 "LCK_M_RIn_X_ABORT_BLOCKERS",
2444 "LCK_M_RIn_X_LOW_PRIORITY",
2445 "LCK_M_RS_S",
2446 "LCK_M_RS_S_ABORT_BLOCKERS",
2447 "LCK_M_RS_S_LOW_PRIORITY",
2448 "LCK_M_RS_U",
2449 "LCK_M_RS_U_ABORT_BLOCKERS",
2450 "LCK_M_RS_U_LOW_PRIORITY",
2451 "LCK_M_RX_S",
2452 "LCK_M_RX_S_ABORT_BLOCKERS",
2453 "LCK_M_RX_S_LOW_PRIORITY",
2454 "LCK_M_RX_U",
2455 "LCK_M_RX_U_ABORT_BLOCKERS",
2456 "LCK_M_RX_U_LOW_PRIORITY",
2457 "LCK_M_RX_X",
2458 "LCK_M_RX_X_ABORT_BLOCKERS",
2459 "LCK_M_RX_X_LOW_PRIORITY",
2460 "LCK_M_S",
2461 "LCK_M_S_ABORT_BLOCKERS",
2462 "LCK_M_S_LOW_PRIORITY",
2463 "LCK_M_SCH_M",
2464 "LCK_M_SCH_M_ABORT_BLOCKERS",
2465 "LCK_M_SCH_M_LOW_PRIORITY",
2466 "LCK_M_SCH_S",
2467 "LCK_M_SCH_S_ABORT_BLOCKERS",
2468 "LCK_M_SCH_S_LOW_PRIORITY",
2469 "LCK_M_SIU",
2470 "LCK_M_SIU_ABORT_BLOCKERS",
2471 "LCK_M_SIU_LOW_PRIORITY",
2472 "LCK_M_SIX",
2473 "LCK_M_SIX_ABORT_BLOCKERS",
2474 "LCK_M_SIX_LOW_PRIORITY",
2475 "LCK_M_U",
2476 "LCK_M_U_ABORT_BLOCKERS",
2477 "LCK_M_U_LOW_PRIORITY",
2478 "LCK_M_UIX",
2479 "LCK_M_UIX_ABORT_BLOCKERS",
2480 "LCK_M_UIX_LOW_PRIORITY",
2481 "LCK_M_X",
2482 "LCK_M_X_ABORT_BLOCKERS",
2483 "LCK_M_X_LOW_PRIORITY",
2484 "LOGBUFFER",
2485 "LOGGENERATION",
2486 "LOGMGR",
2487 "LOGMGR_FLUSH",
2488 "LOGMGR_QUEUE",
2489 "LOGMGR_RESERVE_APPEND",
2490 "LOWFAIL_MEMMGR_QUEUE",
2491 "MEMORY_ALLOCATION_EXT",
2492 "MISCELLANEOUS",
2493 "MSQL_DQ",
2494 "MSQL_XACT_MGR_MUTEX",
2495 "MSQL_XACT_MUTEX",
2496 "MSQL_XP",
2497 "MSSEARCH",
2498 "NET_WAITFOR_PACKET",
2499 "OLEDB",
2500 "ONDEMAND_TASK_QUEUE",
2501 "PAGEIOLATCH_DT",
2502 "PAGEIOLATCH_EX",
2503 "PAGEIOLATCH_KP",
2504 "PAGEIOLATCH_NL",
2505 "PAGEIOLATCH_SH",
2506 "PAGEIOLATCH_UP",
2507 "PAGELATCH_DT",
2508 "PAGELATCH_EX",
2509 "PAGELATCH_KP",
2510 "PAGELATCH_NL",
2511 "PAGELATCH_SH",
2512 "PAGELATCH_UP",
2513 "PARALLEL_BACKUP_QUEUE",
2514 "PREEMPTIVE_ABR",
2515 "PREEMPTIVE_AUDIT_ACCESS_EVENTLOG",
2516 "PREEMPTIVE_AUDIT_ACCESS_SECLOG",
2517 "PREEMPTIVE_CLOSEBACKUPMEDIA",
2518 "PREEMPTIVE_CLOSEBACKUPTAPE",
2519 "PREEMPTIVE_CLOSEBACKUPVDIDEVICE",
2520 "PREEMPTIVE_CLUSAPI_CLUSTERRESOURCECONTROL",
2521 "PREEMPTIVE_COM_COCREATEINSTANCE",
2522 "PREEMPTIVE_HADR_LEASE_MECHANISM",
2523 "PREEMPTIVE_SOSTESTING",
2524 "PREEMPTIVE_STRESSDRIVER",
2525 "PREEMPTIVE_TESTING",
2526 "PREEMPTIVE_XETESTING",
2527 "PRINT_ROLLBACK_PROGRESS",
2528 "PWAIT_HADR_CHANGE_NOTIFIER_TERMINATION_SYNC",
2529 "PWAIT_HADR_CLUSTER_INTEGRATION",
2530 "PWAIT_HADR_OFFLINE_COMPLETED",
2531 "PWAIT_HADR_ONLINE_COMPLETED",
2532 "PWAIT_HADR_POST_ONLINE_COMPLETED",
2533 "PWAIT_HADR_WORKITEM_COMPLETED",
2534 "PWAIT_MD_LOGIN_STATS",
2535 "PWAIT_MD_RELATION_CACHE",
2536 "PWAIT_MD_SERVER_CACHE",
2537 "PWAIT_MD_UPGRADE_CONFIG",
2538 "PWAIT_METADATA_LAZYCACHE_RWLOCk",
2539 "QPJOB_KILL",
2540 "QPJOB_WAITFOR_ABORT",
2541 "QRY_MEM_GRANT_INFO_MUTEX",
2542 "QUERY_ERRHDL_SERVICE_DONE",
2543 "QUERY_EXECUTION_INDEX_SORT_EVENT_OPEN",
2544 "QUERY_NOTIFICATION_MGR_MUTEX",
2545 "QUERY_NOTIFICATION_SUBSCRIPTION_MUTEX",
2546 "QUERY_NOTIFICATION_TABLE_MGR_MUTEX",
2547 "QUERY_NOTIFICATION_UNITTEST_MUTEX",
2548 "QUERY_OPTIMIZER_PRINT_MUTEX",
2549 "QUERY_TRACEOUT",
2550 "QUERY_WAIT_ERRHDL_SERVICE",
2551 "RECOVER_CHANGEDB",
2552 "REPL_CACHE_ACCESS",
2553 "REPL_SCHEMA_ACCESS",
2554 "REPLICA_WRITES",
2555 "REQUEST_DISPENSER_PAUSE",
2556 "REQUEST_FOR_DEADLOCK_SEARCH",
2557 "RESMGR_THROTTLED",
2558 "RESOURCE_QUEUE",
2559 "RESOURCE_SEMAPHORE",
2560 "RESOURCE_SEMAPHORE_MUTEX",
2561 "RESOURCE_SEMAPHORE_QUERY_COMPILE",
2562 "RESOURCE_SEMAPHORE_SMALL_QUERY",
2563 "SEC_DROP_TEMP_KEY",
2564 "SECURITY_MUTEX",
2565 "SEQUENTIAL_GUID",
2566 "SERVER_IDLE_CHECK",
2567 "SHUTDOWN",
2568 "SLEEP_BPOOL_FLUSH",
2569 "SLEEP_DBSTARTUP",
2570 "SLEEP_DCOMSTARTUP",
2571 "SLEEP_MSDBSTARTUP",
2572 "SLEEP_SYSTEMTASK",
2573 "SLEEP_TASK",
2574 "SLEEP_TEMPDBSTARTUP",
2575 "SNI_CRITICAL_SECTION",
2576 "SNI_HTTP_WAITFOR_",
2577 "SNI_LISTENER_ACCESS",
2578 "SNI_TASK_COMPLETION",
2579 "SOAP_READ",
2580 "SOAP_WRITE",
2581 "SOS_CALLBACK_REMOVAL",
2582 "SOS_DISPATCHER_MUTEX",
2583 "SOS_LOCALALLOCATORLIST",
2584 "SOS_MEMORY_USAGE_ADJUSTMENT",
2585 "SOS_OBJECT_STORE_DESTROY_MUTEX",
2586 "SOS_PHYS_PAGE_CACHE",
2587 "SOS_PROCESS_AFFINITY_MUTEX",
2588 "SOS_RESERVEDMEMBLOCKLIST",
2589 "SOS_SCHEDULER_YIELD",
2590 "SOS_SMALL_PAGE_ALLOC",
2591 "SOS_STACKSTORE_INIT_MUTEX",
2592 "SOS_SYNC_TASK_ENQUEUE_EVENT",
2593 "SOS_VIRTUALMEMORY_LOW",
2594 "SOSHOST_EVENT",
2595 "SOSHOST_INTERNAL",
2596 "SOSHOST_MUTEX",
2597 "SOSHOST_RWLOCK",
2598 "SOSHOST_SEMAPHORE",
2599 "SOSHOST_SLEEP",
2600 "SOSHOST_TRACELOCK",
2601 "SOSHOST_WAITFORDONE",
2602 "SQLCLR_APPDOMAIN",
2603 "SQLCLR_ASSEMBLY",
2604 "SQLCLR_DEADLOCK_DETECTION",
2605 "SQLCLR_QUANTUM_PUNISHMENT",
2606 "SQLSORT_NORMMUTEX",
2607 "SQLSORT_SORTMUTEX",
2608 "SQLTRACE_BUFFER_FLUSH",
2609 "SQLTRACE_FILE_BUFFER",
2610 "SQLTRACE_SHUTDOWN",
2611 "SQLTRACE_WAIT_ENTRIES",
2612 "SRVPROC_SHUTDOWN",
2613 "TEMPOBJ",
2614 "THREADPOOL",
2615 "TIMEPRIV_TIMEPERIOD",
2616 "TRACEWRITE",
2617 "TRAN_MARKLATCH_DT",
2618 "TRAN_MARKLATCH_EX",
2619 "TRAN_MARKLATCH_KP",
2620 "TRAN_MARKLATCH_NL",
2621 "TRAN_MARKLATCH_SH",
2622 "TRAN_MARKLATCH_UP",
2623 "TRANSACTION_MUTEX",
2624 "UTIL_PAGE_ALLOC",
2625 "VIA_ACCEPT",
2626 "VIEW_DEFINITION_MUTEX",
2627 "WAIT_FOR_RESULTS",
2628 "WAIT_XTP_CKPT_CLOSE",
2629 "WAIT_XTP_CKPT_ENABLED",
2630 "WAIT_XTP_CKPT_STATE_LOCK",
2631 "WAIT_XTP_GUEST",
2632 "WAIT_XTP_HOST_WAIT",
2633 "WAIT_XTP_OFFLINE_CKPT_LOG_IO",
2634 "WAIT_XTP_OFFLINE_CKPT_NEW_LOG",
2635 "WAIT_XTP_PROCEDURE_ENTRY",
2636 "WAIT_XTP_RECOVERY",
2637 "WAIT_XTP_TASK_SHUTDOWN",
2638 "WAIT_XTP_TRAN_COMMIT",
2639 "WAIT_XTP_TRAN_DEPENDENCY",
2640 "WAITFOR",
2641 "WAITFOR_TASKSHUTDOWN",
2642 "WAITSTAT_MUTEX",
2643 "WCC",
2644 "WORKTBL_DROP",
2645 "WRITE_COMPLETION",
2646 "WRITELOG",
2647 "XACT_OWN_TRANSACTION",
2648 "XACT_RECLAIM_SESSION",
2649 "XACTLOCKINFO",
2650 "XACTWORKSPACE_MUTEX",
2651 "XE_BUFFERMGR_ALLPROCESSED_EVENT",
2652 "XE_BUFFERMGR_FREEBUF_EVENT",
2653 "XE_DISPATCHER_CONFIG_SESSION_LIST",
2654 "XE_DISPATCHER_JOIN",
2655 "XE_DISPATCHER_WAIT",
2656 "XE_MODULEMGR_SYNC",
2657 "XE_OLS_LOCK",
2658 "XE_PACKAGE_LOCK_BACKOFF",
2659 "XTPPROC_CACHE_ACCESS",
2660 "XTPPROC_PARTITIONED_STACK_CREATE",
2663 register_check_parameters(
2664 RulespecGroupCheckParametersApplications,
2665 "mssql_blocked_sessions",
2666 _("MSSQL Blocked Sessions"),
2667 Dictionary(
2668 elements=[
2669 ("state",
2670 MonitoringState(
2671 title=_("State of MSSQL Blocked Sessions is treated as"),
2672 help=_("The default state if there is at least one "
2673 "blocked session."),
2674 default_value=2,
2676 ("waittime",
2677 Tuple(
2678 title=_("Levels for wait"),
2679 help=_("The threshholds for wait_duration_ms. Will "
2680 "overwrite the default state set above."),
2681 default_value=(0, 0),
2682 elements=[
2683 Float(title=_("Warning at"), unit=_("seconds"), display_format="%.3f"),
2684 Float(title=_("Critical at"), unit=_("seconds"), display_format="%.3f"),
2685 ])),
2686 ("ignore_waittypes",
2687 DualListChoice(
2688 title=_("Ignore wait types"),
2689 rows=40,
2690 choices=[(entry, entry) for entry in mssql_waittypes],
2692 ],),
2693 None,
2694 "dict",
2695 deprecated=True,
2698 register_check_parameters(
2699 RulespecGroupCheckParametersApplications,
2700 "mssql_instance_blocked_sessions",
2701 _("MSSQL Blocked Sessions"),
2702 Dictionary(
2703 elements=[
2704 ("state",
2705 MonitoringState(
2706 title=_("State of MSSQL Blocked Sessions is treated as"),
2707 help=_("The default state if there is at least one "
2708 "blocked session."),
2709 default_value=2,
2711 ("waittime",
2712 Tuple(
2713 title=_("Levels for wait"),
2714 help=_("The threshholds for wait_duration_ms. Will "
2715 "overwrite the default state set above."),
2716 default_value=(0, 0),
2717 elements=[
2718 Float(title=_("Warning at"), unit=_("seconds"), display_format="%.3f"),
2719 Float(title=_("Critical at"), unit=_("seconds"), display_format="%.3f"),
2720 ])),
2721 ("ignore_waittypes",
2722 DualListChoice(
2723 title=_("Ignore wait types"),
2724 rows=40,
2725 choices=[(entry, entry) for entry in mssql_waittypes],
2727 ],),
2728 TextAscii(title=_("Instance identifier")),
2729 "dict",
2732 register_check_parameters(
2733 RulespecGroupCheckParametersApplications,
2734 "mysql_sessions",
2735 _("MySQL Sessions & Connections"),
2736 Dictionary(
2737 help=_("This check monitors the current number of active sessions to the MySQL "
2738 "database server as well as the connection rate."),
2739 elements=[
2741 "total",
2742 Tuple(
2743 title=_("Number of current sessions"),
2744 elements=[
2745 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
2746 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
2751 "running",
2752 Tuple(
2753 title=_("Number of currently running sessions"),
2754 help=_("Levels for the number of sessions that are currently active"),
2755 elements=[
2756 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
2757 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
2762 "connections",
2763 Tuple(
2764 title=_("Number of new connections per second"),
2765 elements=[
2766 Integer(title=_("Warning at"), unit=_("connection/sec"), default_value=20),
2767 Integer(title=_("Critical at"), unit=_("connection/sec"), default_value=40),
2772 TextAscii(
2773 title=_("Instance"),
2774 help=_("Only needed if you have multiple MySQL Instances on one server"),
2776 "dict",
2779 register_check_parameters(
2780 RulespecGroupCheckParametersApplications,
2781 "mysql_innodb_io",
2782 _("MySQL InnoDB Throughput"),
2783 Dictionary(
2784 elements=[("read",
2785 Tuple(
2786 title=_("Read throughput"),
2787 elements=[
2788 Float(title=_("warning at"), unit=_("MB/s")),
2789 Float(title=_("critical at"), unit=_("MB/s"))
2790 ])),
2791 ("write",
2792 Tuple(
2793 title=_("Write throughput"),
2794 elements=[
2795 Float(title=_("warning at"), unit=_("MB/s")),
2796 Float(title=_("critical at"), unit=_("MB/s"))
2797 ])),
2798 ("average",
2799 Integer(
2800 title=_("Average"),
2801 help=_("When averaging is set, a floating average value "
2802 "of the disk throughput is computed and the levels for read "
2803 "and write will be applied to the average instead of the current "
2804 "value."),
2805 minvalue=1,
2806 default_value=5,
2807 unit=_("minutes")))]),
2808 TextAscii(
2809 title=_("Instance"),
2810 help=_("Only needed if you have multiple MySQL Instances on one server"),
2812 "dict",
2815 register_check_parameters(
2816 RulespecGroupCheckParametersApplications,
2817 "mysql_connections",
2818 _("MySQL Connections"),
2819 Dictionary(elements=[
2820 ("perc_used",
2821 Tuple(
2822 title=_("Max. parallel connections"),
2823 help=_("Compares the maximum number of connections that have been "
2824 "in use simultaneously since the server started with the maximum simultaneous "
2825 "connections allowed by the configuration of the server. This threshold "
2826 "makes the check raise warning/critical states if the percentage is equal to "
2827 "or above the configured levels."),
2828 elements=[
2829 Percentage(title=_("Warning at")),
2830 Percentage(title=_("Critical at")),
2831 ])),
2833 TextAscii(
2834 title=_("Instance"),
2835 help=_("Only needed if you have multiple MySQL Instances on one server"),
2837 "dict",
2840 register_check_parameters(
2841 RulespecGroupCheckParametersApplications,
2842 "mysql_slave",
2843 _("MySQL Slave"),
2844 Dictionary(
2845 elements=[
2846 ("seconds_behind_master",
2847 Tuple(
2848 title=_("Max. time behind the master"),
2849 help=_(
2850 "Compares the time which the slave can be behind the master. "
2851 "This rule makes the check raise warning/critical states if the time is equal to "
2852 "or above the configured levels."),
2853 elements=[
2854 Age(title=_("Warning at")),
2855 Age(title=_("Critical at")),
2856 ])),
2858 optional_keys=None),
2859 TextAscii(
2860 title=_("Instance"),
2861 help=_("Only needed if you have multiple MySQL Instances on one server"),
2863 "dict",
2866 register_check_parameters(
2867 RulespecGroupCheckParametersApplications, "db_bloat", _("Database Bloat (PostgreSQL)"),
2868 Dictionary(
2869 help=_("This rule allows you to configure bloat levels for a databases tablespace and "
2870 "indexspace."),
2871 elements=[
2872 ("table_bloat_abs",
2873 Tuple(
2874 title=_("Table absolute bloat levels"),
2875 elements=[
2876 Filesize(title=_("Warning at")),
2877 Filesize(title=_("Critical at")),
2878 ])),
2879 ("table_bloat_perc",
2880 Tuple(
2881 title=_("Table percentage bloat levels"),
2882 help=_("Percentage in respect to the optimal utilization. "
2883 "For example if an alarm should raise at 50% wasted space, you need "
2884 "to configure 150%"),
2885 elements=[
2886 Percentage(title=_("Warning at"), maxvalue=None),
2887 Percentage(title=_("Critical at"), maxvalue=None),
2888 ])),
2889 ("index_bloat_abs",
2890 Tuple(
2891 title=_("Index absolute levels"),
2892 elements=[
2893 Filesize(title=_("Warning at")),
2894 Filesize(title=_("Critical at")),
2895 ])),
2896 ("index_bloat_perc",
2897 Tuple(
2898 title=_("Index percentage bloat levels"),
2899 help=_("Percentage in respect to the optimal utilization. "
2900 "For example if an alarm should raise at 50% wasted space, you need "
2901 "to configure 150%"),
2902 elements=[
2903 Percentage(title=_("Warning at"), maxvalue=None),
2904 Percentage(title=_("Critical at"), maxvalue=None),
2905 ])),
2906 ]), TextAscii(title=_("Name of the database"),), "dict")
2908 register_check_parameters(
2909 RulespecGroupCheckParametersApplications, "db_connections",
2910 _("Database Connections (PostgreSQL/MongoDB)"),
2911 Dictionary(
2912 help=_("This rule allows you to configure the number of maximum concurrent "
2913 "connections for a given database."),
2914 elements=[
2915 ("levels_perc",
2916 Tuple(
2917 title=_("Percentage of maximum available connections"),
2918 elements=[
2919 Percentage(title=_("Warning at"), unit=_("% of maximum connections")),
2920 Percentage(title=_("Critical at"), unit=_("% of maximum connections")),
2921 ])),
2922 ("levels_abs",
2923 Tuple(
2924 title=_("Absolute number of connections"),
2925 elements=[
2926 Integer(title=_("Warning at"), minvalue=0, unit=_("connections")),
2927 Integer(title=_("Critical at"), minvalue=0, unit=_("connections")),
2928 ])),
2929 ]), TextAscii(title=_("Name of the database"),), "dict")
2931 register_check_parameters(
2932 RulespecGroupCheckParametersApplications, "postgres_locks", _("PostgreSQL Locks"),
2933 Dictionary(
2934 help=_(
2935 "This rule allows you to configure the limits for the SharedAccess and Exclusive Locks "
2936 "for a PostgreSQL database."),
2937 elements=[
2938 ("levels_shared",
2939 Tuple(
2940 title=_("Shared Access Locks"),
2941 elements=[
2942 Integer(title=_("Warning at"), minvalue=0),
2943 Integer(title=_("Critical at"), minvalue=0),
2944 ])),
2945 ("levels_exclusive",
2946 Tuple(
2947 title=_("Exclusive Locks"),
2948 elements=[
2949 Integer(title=_("Warning at"), minvalue=0),
2950 Integer(title=_("Critical at"), minvalue=0),
2951 ])),
2952 ]), TextAscii(title=_("Name of the database"),), "dict")
2954 register_check_parameters(
2955 RulespecGroupCheckParametersApplications, "postgres_maintenance",
2956 _("PostgreSQL VACUUM and ANALYZE"),
2957 Dictionary(
2958 help=_("With this rule you can set limits for the VACUUM and ANALYZE operation of "
2959 "a PostgreSQL database. Keep in mind that each table within a database is checked "
2960 "with this limits."),
2961 elements=[
2962 ("last_vacuum",
2963 Tuple(
2964 title=_("Time since the last VACUUM"),
2965 elements=[
2966 Age(title=_("Warning if older than"), default_value=86400 * 7),
2967 Age(title=_("Critical if older than"), default_value=86400 * 14)
2968 ])),
2969 ("last_analyze",
2970 Tuple(
2971 title=_("Time since the last ANALYZE"),
2972 elements=[
2973 Age(title=_("Warning if older than"), default_value=86400 * 7),
2974 Age(title=_("Critical if older than"), default_value=86400 * 14)
2975 ])),
2976 ("never_analyze_vacuum",
2977 Tuple(
2978 title=_("Age of never analyzed/vacuumed tables"),
2979 elements=[
2980 Age(title=_("Warning if older than"), default_value=86400 * 7),
2981 Age(title=_("Critical if older than"), default_value=86400 * 14)
2982 ])),
2983 ]), TextAscii(title=_("Name of the database"),), "dict")
2985 register_check_parameters(
2986 RulespecGroupCheckParametersApplications, "f5_connections", _("F5 Loadbalancer Connections"),
2987 Dictionary(elements=[
2988 ("conns",
2989 Levels(
2990 title=_("Max. number of connections"),
2991 default_value=None,
2992 default_levels=(25000, 30000))),
2993 ("ssl_conns",
2994 Levels(
2995 title=_("Max. number of SSL connections"),
2996 default_value=None,
2997 default_levels=(25000, 30000))),
2998 ("connections_rate",
2999 Levels(
3000 title=_("Maximum connections per second"),
3001 default_value=None,
3002 default_levels=(500, 1000))),
3003 ("connections_rate_lower",
3004 Tuple(
3005 title=_("Minimum connections per second"),
3006 elements=[
3007 Integer(title=_("Warning at")),
3008 Integer(title=_("Critical at")),
3011 ("http_req_rate",
3012 Levels(
3013 title=_("HTTP requests per second"), default_value=None, default_levels=(500, 1000))),
3014 ]), None, "dict")
3016 register_check_parameters(
3017 RulespecGroupCheckParametersApplications,
3018 "cisco_fw_connections",
3019 _("Cisco ASA Firewall Connections"),
3020 Dictionary(elements=[
3021 ("connections",
3022 Tuple(
3023 help=_("This rule sets limits to the current number of connections through "
3024 "a Cisco ASA firewall."),
3025 title=_("Maximum number of firewall connections"),
3026 elements=[
3027 Integer(title=_("Warning at")),
3028 Integer(title=_("Critical at")),
3032 None,
3033 "dict",
3036 register_check_parameters(
3037 RulespecGroupCheckParametersApplications,
3038 "checkpoint_connections",
3039 _("Checkpoint Firewall Connections"),
3040 Tuple(
3041 help=_("This rule sets limits to the current number of connections through "
3042 "a Checkpoint firewall."),
3043 title=_("Maximum number of firewall connections"),
3044 elements=[
3045 Integer(title=_("Warning at"), default_value=40000),
3046 Integer(title=_("Critical at"), default_value=50000),
3049 None,
3050 match_type="first",
3053 register_check_parameters(
3054 RulespecGroupCheckParametersApplications, "checkpoint_packets",
3055 _("Checkpoint Firewall Packet Rates"),
3056 Dictionary(elements=[
3057 ("accepted",
3058 Levels(
3059 title=_("Maximum Rate of Accepted Packets"),
3060 default_value=None,
3061 default_levels=(100000, 200000),
3062 unit="pkts/sec")),
3063 ("rejected",
3064 Levels(
3065 title=_("Maximum Rate of Rejected Packets"),
3066 default_value=None,
3067 default_levels=(100000, 200000),
3068 unit="pkts/sec")),
3069 ("dropped",
3070 Levels(
3071 title=_("Maximum Rate of Dropped Packets"),
3072 default_value=None,
3073 default_levels=(100000, 200000),
3074 unit="pkts/sec")),
3075 ("logged",
3076 Levels(
3077 title=_("Maximum Rate of Logged Packets"),
3078 default_value=None,
3079 default_levels=(100000, 200000),
3080 unit="pkts/sec")),
3081 ]), None, "dict")
3083 register_check_parameters(
3084 RulespecGroupCheckParametersApplications, "f5_pools", _("F5 Loadbalancer Pools"),
3085 Tuple(
3086 title=_("Minimum number of pool members"),
3087 elements=[
3088 Integer(title=_("Warning if below"), unit=_("Members ")),
3089 Integer(title=_("Critical if below"), unit=_("Members")),
3091 ), TextAscii(title=_("Name of pool")), "first")
3093 register_check_parameters(
3094 RulespecGroupCheckParametersApplications, "mysql_db_size", _("Size of MySQL databases"),
3095 Optional(
3096 Tuple(elements=[
3097 Filesize(title=_("warning at")),
3098 Filesize(title=_("critical at")),
3100 help=_("The check will trigger a warning or critical state if the size of the "
3101 "database exceeds these levels."),
3102 title=_("Impose limits on the size of the database"),
3104 TextAscii(
3105 title=_("Name of the database"),
3106 help=_("Don't forget the instance: instance:dbname"),
3107 ), "first")
3109 register_check_parameters(
3110 RulespecGroupCheckParametersApplications,
3111 "postgres_sessions",
3112 _("PostgreSQL Sessions"),
3113 Dictionary(
3114 help=_("This check monitors the current number of active and idle sessions on PostgreSQL"),
3115 elements=[
3117 "total",
3118 Tuple(
3119 title=_("Number of current sessions"),
3120 elements=[
3121 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
3122 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
3127 "running",
3128 Tuple(
3129 title=_("Number of currently running sessions"),
3130 help=_("Levels for the number of sessions that are currently active"),
3131 elements=[
3132 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
3133 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
3138 None,
3139 match_type="dict",
3140 deprecated=True,
3143 register_check_parameters(
3144 RulespecGroupCheckParametersApplications,
3145 "postgres_instance_sessions",
3146 _("PostgreSQL Sessions"),
3147 Dictionary(
3148 help=_("This check monitors the current number of active and idle sessions on PostgreSQL"),
3149 elements=[
3151 "total",
3152 Tuple(
3153 title=_("Number of current sessions"),
3154 elements=[
3155 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
3156 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
3161 "running",
3162 Tuple(
3163 title=_("Number of currently running sessions"),
3164 help=_("Levels for the number of sessions that are currently active"),
3165 elements=[
3166 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
3167 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
3172 TextAscii(title=_("Instance")),
3173 match_type="dict",
3176 register_check_parameters(
3177 RulespecGroupCheckParametersApplications,
3178 "asa_svc_sessions",
3179 _("Cisco SSl VPN Client Sessions"),
3180 Tuple(
3181 title=_("Number of active sessions"),
3182 help=_("This check monitors the current number of active sessions"),
3183 elements=[
3184 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
3185 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
3188 None,
3189 match_type="first",
3193 def convert_oracle_sessions(value):
3194 if isinstance(value, tuple):
3195 return {'sessions_abs': value}
3196 if 'sessions_abs' not in value:
3197 value['sessions_abs'] = (100, 200)
3198 return value
3201 register_check_parameters(
3202 RulespecGroupCheckParametersApplications,
3203 "oracle_sessions",
3204 _("Oracle Sessions"),
3205 Transform(
3206 Dictionary(
3207 elements=[
3208 ("sessions_abs",
3209 Alternative(
3210 title=_("Absolute levels of active sessions"),
3211 style="dropdown",
3212 help=_("This check monitors the current number of active sessions on Oracle"),
3213 elements=[
3214 FixedValue(None, title=_("Do not use absolute levels"), totext=""),
3215 Tuple(
3216 title=_("Number of active sessions"),
3217 elements=[
3218 Integer(
3219 title=_("Warning at"), unit=_("sessions"), default_value=100),
3220 Integer(
3221 title=_("Critical at"), unit=_("sessions"), default_value=200),
3227 "sessions_perc",
3228 Tuple(
3229 title=_("Relative levels of active sessions."),
3230 help=
3231 _("Set upper levels of active sessions relative to max. number of sessions. This is optional."
3233 elements=[
3234 Percentage(title=_("Warning at")),
3235 Percentage(title=_("Critical at")),
3240 optional_keys=["sessions_perc"],
3242 forth=convert_oracle_sessions),
3243 TextAscii(title=_("Database name"), allow_empty=False),
3244 match_type="first",
3247 register_check_parameters(
3248 RulespecGroupCheckParametersApplications,
3249 "oracle_locks",
3250 _("Oracle Locks"),
3251 Dictionary(elements=[("levels",
3252 Tuple(
3253 title=_("Levels for minimum wait time for a lock"),
3254 elements=[
3255 Age(title=_("warning if higher then"), default_value=1800),
3256 Age(title=_("critical if higher then"), default_value=3600),
3257 ]))]),
3258 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
3259 "dict",
3262 register_check_parameters(
3263 RulespecGroupCheckParametersApplications,
3264 "oracle_longactivesessions",
3265 _("Oracle Long Active Sessions"),
3266 Dictionary(elements=[("levels",
3267 Tuple(
3268 title=_("Levels of active sessions"),
3269 elements=[
3270 Integer(title=_("Warning if more than"), unit=_("sessions")),
3271 Integer(title=_("Critical if more than"), unit=_("sessions")),
3272 ]))]),
3273 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
3274 "dict",
3277 register_check_parameters(
3278 RulespecGroupCheckParametersApplications,
3279 "postgres_stat_database",
3280 _("PostgreSQL Database Statistics"),
3281 Dictionary(
3282 help=_(
3283 "This check monitors how often database objects in a PostgreSQL Database are accessed"),
3284 elements=[
3286 "blocks_read",
3287 Tuple(
3288 title=_("Blocks read"),
3289 elements=[
3290 Float(title=_("Warning at"), unit=_("blocks/s")),
3291 Float(title=_("Critical at"), unit=_("blocks/s")),
3296 "xact_commit",
3297 Tuple(
3298 title=_("Commits"),
3299 elements=[
3300 Float(title=_("Warning at"), unit=_("/s")),
3301 Float(title=_("Critical at"), unit=_("/s")),
3306 "tup_fetched",
3307 Tuple(
3308 title=_("Fetches"),
3309 elements=[
3310 Float(title=_("Warning at"), unit=_("/s")),
3311 Float(title=_("Critical at"), unit=_("/s")),
3316 "tup_deleted",
3317 Tuple(
3318 title=_("Deletes"),
3319 elements=[
3320 Float(title=_("Warning at"), unit=_("/s")),
3321 Float(title=_("Critical at"), unit=_("/s")),
3326 "tup_updated",
3327 Tuple(
3328 title=_("Updates"),
3329 elements=[
3330 Float(title=_("Warning at"), unit=_("/s")),
3331 Float(title=_("Critical at"), unit=_("/s")),
3336 "tup_inserted",
3337 Tuple(
3338 title=_("Inserts"),
3339 elements=[
3340 Float(title=_("Warning at"), unit=_("/s")),
3341 Float(title=_("Critical at"), unit=_("/s")),
3347 TextAscii(title=_("Database name"), allow_empty=False),
3348 match_type="dict",
3351 register_check_parameters(
3352 RulespecGroupCheckParametersApplications,
3353 "win_dhcp_pools",
3354 _("DHCP Pools for Windows and Linux"),
3355 Transform(
3356 Dictionary(
3357 elements = [
3358 ("free_leases",
3359 Alternative(
3360 title = _("Free leases levels"),
3361 elements = [
3362 Tuple(
3363 title = _("Free leases levels in percent"),
3364 elements = [
3365 Percentage(title = _("Warning if below"), default_value = 10.0),
3366 Percentage(title = _("Critical if below"), default_value = 5.0)
3369 Tuple(
3370 title = _("Absolute free leases levels"),
3371 elements = [
3372 Integer(title = _("Warning if below"), unit = _("free leases")),
3373 Integer(title = _("Critical if below"), unit = _("free leases"))
3379 ("used_leases",
3380 Alternative(
3381 title = _("Used leases levels"),
3382 elements = [
3383 Tuple(
3384 title = _("Used leases levels in percent"),
3385 elements = [
3386 Percentage(title = _("Warning if below")),
3387 Percentage(title = _("Critical if below"))
3390 Tuple(
3391 title = _("Absolute used leases levels"),
3392 elements = [
3393 Integer(title = _("Warning if below"), unit = _("used leases")),
3394 Integer(title = _("Critical if below"), unit = _("used leases"))
3402 forth = lambda params: isinstance(params, tuple) and {"free_leases" : (float(params[0]), float(params[1]))} or params,
3404 TextAscii(
3405 title = _("Pool name"),
3406 allow_empty = False,
3408 match_type = "first",
3411 register_check_parameters(
3412 RulespecGroupCheckParametersOperatingSystem,
3413 "threads",
3414 _("Number of threads"),
3415 Tuple(
3416 help=_(
3417 "These levels check the number of currently existing threads on the system. Each process has at "
3418 "least one thread."),
3419 elements=[
3420 Integer(title=_("Warning at"), unit=_("threads"), default_value=1000),
3421 Integer(title=_("Critical at"), unit=_("threads"), default_value=2000)
3423 None,
3424 match_type="first",
3427 register_check_parameters(
3428 RulespecGroupCheckParametersOperatingSystem,
3429 "logins",
3430 _("Number of Logins on System"),
3431 Tuple(
3432 help=_("This rule defines upper limits for the number of logins on a system."),
3433 elements=[
3434 Integer(title=_("Warning at"), unit=_("users"), default_value=20),
3435 Integer(title=_("Critical at"), unit=_("users"), default_value=30)
3437 None,
3438 match_type="first",
3441 register_check_parameters(
3442 RulespecGroupCheckParametersApplications,
3443 "vms_procs",
3444 _("Number of processes on OpenVMS"),
3445 Optional(
3446 Tuple(elements=[
3447 Integer(title=_("Warning at"), unit=_("processes"), default_value=100),
3448 Integer(title=_("Critical at"), unit=_("processes"), default_value=200)
3450 title=_("Impose levels on number of processes"),
3452 None,
3453 match_type="first",
3456 register_check_parameters(
3457 RulespecGroupCheckParametersOperatingSystem, "vm_counter",
3458 _("Number of kernel events per second"),
3459 Levels(
3460 help=_("This ruleset applies to several similar checks measing various kernel "
3461 "events like context switches, process creations and major page faults. "
3462 "Please create separate rules for each type of kernel counter you "
3463 "want to set levels for."),
3464 unit=_("events per second"),
3465 default_levels=(1000, 5000),
3466 default_difference=(500.0, 1000.0),
3467 default_value=None,
3469 DropdownChoice(
3470 title=_("kernel counter"),
3471 choices=[("Context Switches", _("Context Switches")),
3472 ("Process Creations", _("Process Creations")),
3473 ("Major Page Faults", _("Major Page Faults"))]), "first")
3475 register_check_parameters(
3476 RulespecGroupCheckParametersStorage,
3477 "ibm_svc_total_latency",
3478 _("IBM SVC: Levels for total disk latency"),
3479 Dictionary(elements=[
3480 ("read",
3481 Levels(
3482 title=_("Read latency"),
3483 unit=_("ms"),
3484 default_value=None,
3485 default_levels=(50.0, 100.0))),
3486 ("write",
3487 Levels(
3488 title=_("Write latency"),
3489 unit=_("ms"),
3490 default_value=None,
3491 default_levels=(50.0, 100.0))),
3493 DropdownChoice(
3494 choices=[
3495 ("Drives", _("Total latency for all drives")),
3496 ("MDisks", _("Total latency for all MDisks")),
3497 ("VDisks", _("Total latency for all VDisks")),
3499 title=_("Disk/Drive type"),
3500 help=_("Please enter <tt>Drives</tt>, <tt>Mdisks</tt> or <tt>VDisks</tt> here.")),
3501 match_type="dict",
3505 def transform_ibm_svc_host(params):
3506 if params is None:
3507 # Old inventory rule until version 1.2.7
3508 # params were None instead of emtpy dictionary
3509 params = {'always_ok': False}
3511 if 'always_ok' in params:
3512 if params['always_ok'] is False:
3513 params = {'degraded_hosts': (1, 1), 'offline_hosts': (1, 1), 'other_hosts': (1, 1)}
3514 else:
3515 params = {}
3516 return params
3519 register_check_parameters(
3520 RulespecGroupCheckParametersStorage,
3521 "ibm_svc_host",
3522 _("IBM SVC: Options for SVC Hosts Check"),
3523 Transform(
3524 Dictionary(elements=[
3526 "active_hosts",
3527 Tuple(
3528 title=_("Count of active hosts"),
3529 elements=[
3530 Integer(title=_("Warning at or below"), minvalue=0, unit=_("active hosts")),
3531 Integer(
3532 title=_("Critical at or below"), minvalue=0, unit=_("active hosts")),
3536 "inactive_hosts",
3537 Tuple(
3538 title=_("Count of inactive hosts"),
3539 elements=[
3540 Integer(
3541 title=_("Warning at or above"), minvalue=0, unit=_("inactive hosts")),
3542 Integer(
3543 title=_("Critical at or above"), minvalue=0, unit=_("inactive hosts")),
3547 "degraded_hosts",
3548 Tuple(
3549 title=_("Count of degraded hosts"),
3550 elements=[
3551 Integer(
3552 title=_("Warning at or above"), minvalue=0, unit=_("degraded hosts")),
3553 Integer(
3554 title=_("Critical at or above"), minvalue=0, unit=_("degraded hosts")),
3558 "offline_hosts",
3559 Tuple(
3560 title=_("Count of offline hosts"),
3561 elements=[
3562 Integer(
3563 title=_("Warning at or above"), minvalue=0, unit=_("offline hosts")),
3564 Integer(
3565 title=_("Critical at or above"), minvalue=0, unit=_("offline hosts")),
3569 "other_hosts",
3570 Tuple(
3571 title=_("Count of other hosts"),
3572 elements=[
3573 Integer(title=_("Warning at or above"), minvalue=0, unit=_("other hosts")),
3574 Integer(title=_("Critical at or above"), minvalue=0, unit=_("other hosts")),
3578 forth=transform_ibm_svc_host,
3580 None,
3581 "dict",
3584 register_check_parameters(
3585 RulespecGroupCheckParametersStorage,
3586 "ibm_svc_mdisk",
3587 _("IBM SVC: Options for SVC Disk Check"),
3588 Dictionary(
3589 optional_keys=False,
3590 elements=[
3592 "online_state",
3593 MonitoringState(
3594 title=_("Resulting state if disk is online"),
3595 default_value=0,
3599 "degraded_state",
3600 MonitoringState(
3601 title=_("Resulting state if disk is degraded"),
3602 default_value=1,
3606 "offline_state",
3607 MonitoringState(
3608 title=_("Resulting state if disk is offline"),
3609 default_value=2,
3613 "excluded_state",
3614 MonitoringState(
3615 title=_("Resulting state if disk is excluded"),
3616 default_value=2,
3620 "managed_mode",
3621 MonitoringState(
3622 title=_("Resulting state if disk is in managed mode"),
3623 default_value=0,
3627 "array_mode",
3628 MonitoringState(
3629 title=_("Resulting state if disk is in array mode"),
3630 default_value=0,
3634 "image_mode",
3635 MonitoringState(
3636 title=_("Resulting state if disk is in image mode"),
3637 default_value=0,
3641 "unmanaged_mode",
3642 MonitoringState(
3643 title=_("Resulting state if disk is in unmanaged mode"),
3644 default_value=1,
3648 TextAscii(
3649 title=_("IBM SVC disk"),
3650 help=_("Name of the disk, e.g. mdisk0"),
3652 "dict",
3655 register_check_parameters(
3656 RulespecGroupCheckParametersStorage,
3657 "diskstat",
3658 _("Levels for disk IO"),
3659 Dictionary(
3660 help=_(
3661 "With this rule you can set limits for various disk IO statistics. "
3662 "Keep in mind that not all of these settings may be applicable for the actual "
3663 "check. For example, if the check doesn't provide a <i>Read wait</i> information in its "
3664 "output, any configuration setting referring to <i>Read wait</i> will have no effect."),
3665 elements=[
3666 ("read",
3667 Levels(
3668 title=_("Read throughput"),
3669 unit=_("MB/s"),
3670 default_levels=(50.0, 100.0),
3672 ("write",
3673 Levels(
3674 title=_("Write throughput"),
3675 unit=_("MB/s"),
3676 default_levels=(50.0, 100.0),
3678 ("utilization",
3679 Levels(
3680 title=_("Disk Utilization"),
3681 unit=_("%"),
3682 default_levels=(80.0, 90.0),
3684 ("latency", Levels(
3685 title=_("Disk Latency"),
3686 unit=_("ms"),
3687 default_levels=(80.0, 160.0),
3689 ("read_wait", Levels(title=_("Read wait"), unit=_("ms"), default_levels=(30.0, 50.0))),
3690 ("write_wait", Levels(title=_("Write wait"), unit=_("ms"), default_levels=(30.0,
3691 50.0))),
3692 ("average",
3693 Age(
3694 title=_("Averaging"),
3695 help=_(
3696 "When averaging is set, then all of the disk's metrics are averaged "
3697 "over the selected interval - rather then the check interval. This allows "
3698 "you to make your monitoring less reactive to short peaks. But it will also "
3699 "introduce a loss of accuracy in your graphs. "),
3700 default_value=300,
3702 ("read_ios",
3703 Levels(title=_("Read operations"), unit=_("1/s"), default_levels=(400.0, 600.0))),
3704 ("write_ios",
3705 Levels(title=_("Write operations"), unit=_("1/s"), default_levels=(300.0, 400.0))),
3707 TextAscii(
3708 title=_("Device"),
3709 help=_(
3710 "For a summarized throughput of all disks, specify <tt>SUMMARY</tt>, "
3711 "a per-disk IO is specified by the drive letter, a colon and a slash on Windows "
3712 "(e.g. <tt>C:/</tt>) or by the device name on Linux/UNIX (e.g. <tt>/dev/sda</tt>).")),
3713 "dict",
3716 register_check_parameters(
3717 RulespecGroupCheckParametersStorage, "disk_io", _("Levels on disk IO (old style checks)"),
3718 Dictionary(elements=[
3719 ("read",
3720 Levels(
3721 title=_("Read throughput"),
3722 unit=_("MB/s"),
3723 default_value=None,
3724 default_levels=(50.0, 100.0))),
3725 ("write",
3726 Levels(
3727 title=_("Write throughput"),
3728 unit=_("MB/s"),
3729 default_value=None,
3730 default_levels=(50.0, 100.0))),
3731 ("average",
3732 Integer(
3733 title=_("Average"),
3734 help=_("When averaging is set, a floating average value "
3735 "of the disk throughput is computed and the levels for read "
3736 "and write will be applied to the average instead of the current "
3737 "value."),
3738 default_value=5,
3739 minvalue=1,
3740 unit=_("minutes"))),
3741 ("latency",
3742 Tuple(
3743 title=_("IO Latency"),
3744 elements=[
3745 Float(title=_("warning at"), unit=_("ms"), default_value=80.0),
3746 Float(title=_("critical at"), unit=_("ms"), default_value=160.0),
3747 ])),
3749 "latency_perfdata",
3750 Checkbox(
3751 title=_("Performance Data for Latency"),
3752 label=_("Collect performance data for disk latency"),
3753 help=_("Note: enabling performance data for the latency might "
3754 "cause incompatibilities with existing historical data "
3755 "if you are running PNP4Nagios in SINGLE mode.")),
3757 ("read_ql",
3758 Tuple(
3759 title=_("Read Queue-Length"),
3760 elements=[
3761 Float(title=_("warning at"), default_value=80.0),
3762 Float(title=_("critical at"), default_value=90.0),
3763 ])),
3764 ("write_ql",
3765 Tuple(
3766 title=_("Write Queue-Length"),
3767 elements=[
3768 Float(title=_("warning at"), default_value=80.0),
3769 Float(title=_("critical at"), default_value=90.0),
3770 ])),
3772 "ql_perfdata",
3773 Checkbox(
3774 title=_("Performance Data for Queue Length"),
3775 label=_("Collect performance data for disk latency"),
3776 help=_("Note: enabling performance data for the latency might "
3777 "cause incompatibilities with existing historical data "
3778 "if you are running PNP4Nagios in SINGLE mode.")),
3781 TextAscii(
3782 title=_("Device"),
3783 help=_(
3784 "For a summarized throughput of all disks, specify <tt>SUMMARY</tt>, for a "
3785 "sum of read or write throughput write <tt>read</tt> or <tt>write</tt> resp. "
3786 "A per-disk IO is specified by the drive letter, a colon and a slash on Windows "
3787 "(e.g. <tt>C:/</tt>) or by the device name on Linux/UNIX (e.g. <tt>/dev/sda</tt>).")),
3788 "dict")
3790 register_rule(
3791 RulespecGroupCheckParametersStorage,
3792 "diskstat_inventory",
3793 ListChoice(
3794 title=_("Discovery mode for Disk IO check"),
3795 help=_("This rule controls which and how many checks will be created "
3796 "for monitoring individual physical and logical disks. "
3797 "Note: the option <i>Create a summary for all read, one for "
3798 "write</i> has been removed. Some checks will still support "
3799 "this settings, but it will be removed there soon."),
3800 choices=[
3801 ("summary", _("Create a summary over all physical disks")),
3802 # This option is still supported by some checks, but is deprecated and
3803 # we fade it out...
3804 # ( "legacy", _("Create a summary for all read, one for write") ),
3805 ("physical", _("Create a separate check for each physical disk")),
3806 ("lvm", _("Create a separate check for each LVM volume (Linux)")),
3807 ("vxvm", _("Creata a separate check for each VxVM volume (Linux)")),
3808 ("diskless", _("Creata a separate check for each partition (XEN)")),
3810 default_value=['summary'],
3812 match="first")
3815 def transform_if_groups_forth(params):
3816 for param in params:
3817 if param.get("name"):
3818 param["group_name"] = param["name"]
3819 del param["name"]
3820 if param.get("include_items"):
3821 param["items"] = param["include_items"]
3822 del param["include_items"]
3823 if param.get("single") is not None:
3824 if param["single"]:
3825 param["group_presence"] = "instead"
3826 else:
3827 param["group_presence"] = "separate"
3828 del param["single"]
3829 return params
3832 vs_elements_if_groups_matches = [
3833 ("iftype",
3834 Transform(
3835 DropdownChoice(
3836 title=_("Select interface port type"),
3837 choices=defines.interface_port_types(),
3838 help=_("Only interfaces with the given port type are put into this group. "
3839 "For example 53 (propVirtual)."),
3841 forth=str,
3842 back=int,
3844 ("items",
3845 ListOfStrings(
3846 title=_("Restrict interface items"),
3847 help=_("Only interface with these item names are put into this group."),
3851 vs_elements_if_groups_group = [
3852 ("group_name",
3853 TextAscii(
3854 title=_("Group name"),
3855 help=_("Name of group in service description"),
3856 allow_empty=False,
3858 ("group_presence",
3859 DropdownChoice(
3860 title=_("Group interface presence"),
3861 help=_("Determine whether the group interface is created as an "
3862 "separate service or not. In second case the choosen interface "
3863 "services disapear."),
3864 choices=[
3865 ("separate", _("List grouped interfaces separately")),
3866 ("instead", _("List grouped interfaces instead")),
3868 default_value="instead",
3872 register_rule(
3873 RulespecGroupCheckParametersNetworking,
3874 varname="if_groups",
3875 title=_('Network interface groups'),
3876 help=_(
3877 'Normally the Interface checks create a single service for interface. '
3878 'By defining if-group patterns multiple interfaces can be combined together. '
3879 'A single service is created for this interface group showing the total traffic amount '
3880 'of its members. You can configure if interfaces which are identified as group interfaces '
3881 'should not show up as single service. You can restrict grouped interfaces by iftype and the '
3882 'item name of the single interface.'),
3883 valuespec=Transform(
3884 Alternative(
3885 style="dropdown",
3886 elements=[
3887 ListOf(
3888 title=_("Groups on single host"),
3889 add_label=_("Add pattern"),
3890 valuespec=Dictionary(
3891 elements=vs_elements_if_groups_group + vs_elements_if_groups_matches,
3892 required_keys=["group_name", "group_presence"]),
3894 ListOf(
3895 magic="@!!",
3896 title=_("Groups on cluster"),
3897 add_label=_("Add pattern"),
3898 valuespec=Dictionary(
3899 elements=vs_elements_if_groups_group +
3900 [("node_patterns",
3901 ListOf(
3902 title=_("Patterns for each node"),
3903 add_label=_("Add pattern"),
3904 valuespec=Dictionary(
3905 elements=[("node_name", TextAscii(title=_("Node name")))] +
3906 vs_elements_if_groups_matches,
3907 required_keys=["node_name"]),
3908 allow_empty=False,
3909 ))],
3910 optional_keys=[])),
3913 forth=transform_if_groups_forth),
3914 match='all',
3917 register_rule(
3918 RulespecGroupCheckParametersDiscovery,
3919 varname="winperf_msx_queues_inventory",
3920 title=_('MS Exchange Message Queues Discovery'),
3921 help=_(
3922 'Per default the offsets of all Windows performance counters are preconfigured in the check. '
3923 'If the format of your counters object is not compatible then you can adapt the counter '
3924 'offsets manually.'),
3925 valuespec=ListOf(
3926 Tuple(
3927 orientation="horizontal",
3928 elements=[
3929 TextAscii(
3930 title=_("Name of Counter"),
3931 help=_("Name of the Counter to be monitored."),
3932 size=50,
3933 allow_empty=False,
3935 Integer(
3936 title=_("Offset"),
3937 help=_("The offset of the information relative to counter base"),
3938 allow_empty=False,
3941 movable=False,
3942 add_label=_("Add Counter")),
3943 match='all',
3946 mailqueue_params = Dictionary(
3947 elements=[
3949 "deferred",
3950 Tuple(
3951 title=_("Mails in outgoing mail queue/deferred mails"),
3952 help=_("This rule is applied to the number of E-Mails currently "
3953 "in the deferred mail queue, or in the general outgoing mail "
3954 "queue, if such a distinction is not available."),
3955 elements=[
3956 Integer(title=_("Warning at"), unit=_("mails"), default_value=10),
3957 Integer(title=_("Critical at"), unit=_("mails"), default_value=20),
3962 "active",
3963 Tuple(
3964 title=_("Mails in active mail queue"),
3965 help=_("This rule is applied to the number of E-Mails currently "
3966 "in the active mail queue"),
3967 elements=[
3968 Integer(title=_("Warning at"), unit=_("mails"), default_value=800),
3969 Integer(title=_("Critical at"), unit=_("mails"), default_value=1000),
3974 optional_keys=["active"],
3977 register_check_parameters(
3978 RulespecGroupCheckParametersApplications,
3979 "mailqueue_length",
3980 _("Number of mails in outgoing mail queue"),
3981 Transform(
3982 mailqueue_params,
3983 forth=lambda old: not isinstance(old, dict) and {"deferred": old} or old,
3985 None,
3986 match_type="dict",
3987 deprecated=True,
3990 register_check_parameters(
3991 RulespecGroupCheckParametersApplications,
3992 "mail_queue_length",
3993 _("Number of mails in outgoing mail queue"),
3994 Transform(
3995 mailqueue_params,
3996 forth=lambda old: not isinstance(old, dict) and {"deferred": old} or old,
3998 TextAscii(title=_("Mail queue name")),
3999 match_type="dict",
4002 register_check_parameters(
4003 RulespecGroupCheckParametersApplications, "mail_latency", _("Mail Latency"),
4004 Tuple(
4005 title=_("Upper levels for Mail Latency"),
4006 elements=[
4007 Age(title=_("Warning at"), default_value=40),
4008 Age(title=_("Critical at"), default_value=60),
4009 ]), None, "first")
4011 register_check_parameters(
4012 RulespecGroupCheckParametersStorage,
4013 "zpool_status",
4014 _("ZFS storage pool status"),
4015 None,
4016 None,
4017 match_type="first",
4020 register_check_parameters(
4021 RulespecGroupCheckParametersVirtualization,
4022 "vm_state",
4023 _("Overall state of a virtual machine (for example ESX VMs)"),
4024 None,
4025 None,
4026 match_type="first",
4029 register_check_parameters(
4030 RulespecGroupCheckParametersHardware,
4031 "hw_errors",
4032 _("Simple checks for BIOS/Hardware errors"),
4033 None,
4034 None,
4035 match_type="first",
4038 register_check_parameters(
4039 RulespecGroupCheckParametersApplications, "omd_status", _("OMD site status"), None,
4040 TextAscii(
4041 title=_("Name of the OMD site"),
4042 help=_("The name of the OMD site to check the status for")), "first")
4044 register_check_parameters(
4045 RulespecGroupCheckParametersStorage, "network_fs",
4046 _("Network filesystem - overall status (e.g. NFS)"),
4047 Dictionary(
4048 elements=[
4050 "has_perfdata",
4051 DropdownChoice(
4052 title=_("Performance data settings"),
4053 choices=[
4054 (True, _("Enable performance data")),
4055 (False, _("Disable performance data")),
4057 default_value=False),
4059 ],),
4060 TextAscii(
4061 title=_("Name of the mount point"), help=_("For NFS enter the name of the mount point.")),
4062 "dict")
4064 register_check_parameters(
4065 RulespecGroupCheckParametersStorage,
4066 "windows_multipath",
4067 _("Windows Multipath Count"),
4068 Alternative(
4069 help=_("This rules sets the expected number of active paths for a multipath LUN."),
4070 title=_("Expected number of active paths"),
4071 elements=[
4072 Integer(title=_("Expected number of active paths")),
4073 Tuple(
4074 title=_("Expected percentage of active paths"),
4075 elements=[
4076 Integer(title=_("Expected number of active paths")),
4077 Percentage(title=_("Warning if less then")),
4078 Percentage(title=_("Critical if less then")),
4081 None,
4082 "first",
4085 register_check_parameters(
4086 RulespecGroupCheckParametersStorage, "multipath", _("Linux and Solaris Multipath Count"),
4087 Alternative(
4088 help=_("This rules sets the expected number of active paths for a multipath LUN "
4089 "on Linux and Solaris hosts"),
4090 title=_("Expected number of active paths"),
4091 elements=[
4092 Integer(title=_("Expected number of active paths")),
4093 Tuple(
4094 title=_("Expected percentage of active paths"),
4095 elements=[
4096 Percentage(title=_("Warning if less then")),
4097 Percentage(title=_("Critical if less then")),
4100 TextAscii(
4101 title=_("Name of the MP LUN"),
4102 help=_("For Linux multipathing this is either the UUID (e.g. "
4103 "60a9800043346937686f456f59386741), or the configured "
4104 "alias.")), "first")
4106 register_rule(
4107 RulespecGroupCheckParametersStorage,
4108 varname="inventory_multipath_rules",
4109 title=_("Linux Multipath Inventory"),
4110 valuespec=Dictionary(
4111 elements=[
4112 ("use_alias",
4113 Checkbox(
4114 title=_("Use the multipath alias as service name, if one is set"),
4115 label=_("use alias"),
4116 help=_(
4117 "If a multipath device has an alias then you can use it for specifying "
4118 "the device instead of the UUID. The alias will then be part of the service "
4119 "description. The UUID will be displayed in the plugin output."))),
4121 help=_(
4122 "This rule controls whether the UUID or the alias is used in the service description during "
4123 "discovery of Multipath devices on Linux."),
4125 match='dict',
4128 register_check_parameters(
4129 RulespecGroupCheckParametersStorage, "multipath_count", _("ESX Multipath Count"),
4130 Alternative(
4131 help=_("This rules sets the expected number of active paths for a multipath LUN "
4132 "on ESX servers"),
4133 title=_("Match type"),
4134 elements=[
4135 FixedValue(
4136 None,
4137 title=_("OK if standby count is zero or equals active paths."),
4138 totext="",
4140 Dictionary(
4141 title=_("Custom settings"),
4142 elements=[
4143 (element,
4144 Transform(
4145 Tuple(
4146 title=description,
4147 elements=[
4148 Integer(title=_("Critical if less than")),
4149 Integer(title=_("Warning if less than")),
4150 Integer(title=_("Warning if more than")),
4151 Integer(title=_("Critical if more than")),
4153 forth=lambda x: len(x) == 2 and (0, 0, x[0], x[1]) or x))
4154 for (element,
4155 description) in [("active", _("Active paths")), (
4156 "dead", _("Dead paths")), (
4157 "disabled", _("Disabled paths")), (
4158 "standby", _("Standby paths")), ("unknown",
4159 _("Unknown paths"))]
4161 ]), TextAscii(title=_("Path ID")), "first")
4163 register_check_parameters(
4164 RulespecGroupCheckParametersStorage, "hpux_multipath", _("HP-UX Multipath Count"),
4165 Tuple(
4166 title=_("Expected path situation"),
4167 help=_("This rules sets the expected number of various paths for a multipath LUN "
4168 "on HPUX servers"),
4169 elements=[
4170 Integer(title=_("Number of active paths")),
4171 Integer(title=_("Number of standby paths")),
4172 Integer(title=_("Number of failed paths")),
4173 Integer(title=_("Number of unopen paths")),
4174 ]), TextAscii(title=_("WWID of the LUN")), "first")
4176 register_check_parameters(
4177 RulespecGroupCheckParametersStorage,
4178 "drbd",
4179 _("DR:BD roles and diskstates"),
4180 Dictionary(elements=[(
4181 "roles",
4182 Alternative(
4183 title=_("Roles"),
4184 elements=[
4185 FixedValue(None, totext="", title=_("Do not monitor")),
4186 ListOf(
4187 Tuple(
4188 orientation="horizontal",
4189 elements=[
4190 DropdownChoice(
4191 title=_("DRBD shows up as"),
4192 default_value="running",
4193 choices=[("primary_secondary", _("Primary / Secondary")
4194 ), ("primary_primary", _("Primary / Primary")
4195 ), ("secondary_primary", _("Secondary / Primary")
4196 ), ("secondary_secondary",
4197 _("Secondary / Secondary"))]),
4198 MonitoringState(title=_("Resulting state"),),
4200 default_value=("ignore", 0)),
4201 title=_("Set roles"),
4202 add_label=_("Add role rule"))
4203 ])),
4205 "diskstates",
4206 Alternative(
4207 title=_("Diskstates"),
4208 elements=[
4209 FixedValue(None, totext="", title=_("Do not monitor")),
4210 ListOf(
4211 Tuple(
4212 elements=[
4213 DropdownChoice(
4214 title=_("Diskstate"),
4215 choices=[
4216 ("primary_Diskless",
4217 _("Primary - Diskless")),
4218 ("primary_Attaching",
4219 _("Primary - Attaching")),
4220 ("primary_Failed", _("Primary - Failed")),
4221 ("primary_Negotiating",
4222 _("Primary - Negotiating")),
4223 ("primary_Inconsistent",
4224 _("Primary - Inconsistent")),
4225 ("primary_Outdated",
4226 _("Primary - Outdated")),
4227 ("primary_DUnknown",
4228 _("Primary - DUnknown")),
4229 ("primary_Consistent",
4230 _("Primary - Consistent")),
4231 ("primary_UpToDate",
4232 _("Primary - UpToDate")),
4233 ("secondary_Diskless",
4234 _("Secondary - Diskless")),
4235 ("secondary_Attaching",
4236 _("Secondary - Attaching")),
4237 ("secondary_Failed",
4238 _("Secondary - Failed")),
4239 ("secondary_Negotiating",
4240 _("Secondary - Negotiating")),
4241 ("secondary_Inconsistent",
4242 _("Secondary - Inconsistent")),
4243 ("secondary_Outdated",
4244 _("Secondary - Outdated")),
4245 ("secondary_DUnknown",
4246 _("Secondary - DUnknown")),
4247 ("secondary_Consistent",
4248 _("Secondary - Consistent")),
4249 ("secondary_UpToDate",
4250 _("Secondary - UpToDate")),
4252 MonitoringState(title=_("Resulting state"))
4254 orientation="horizontal",
4256 title=_("Set diskstates"),
4257 add_label=_("Add diskstate rule"))
4259 )]),
4260 TextAscii(title=_("DRBD device")),
4261 match_type="dict",
4264 register_check_parameters(
4265 RulespecGroupCheckParametersStorage,
4266 "snapvault",
4267 _("NetApp Snapvaults / Snapmirror Lag Time"),
4268 Dictionary(
4269 elements=
4271 "lag_time",
4272 Tuple(
4273 title=_("Default levels"),
4274 elements=[
4275 Age(title=_("Warning at")),
4276 Age(title=_("Critical at")),
4280 ("policy_lag_time",
4281 ListOf(
4282 Tuple(
4283 orientation="horizontal",
4284 elements=[
4285 TextAscii(title=_("Policy name")),
4286 Tuple(
4287 title=_("Maximum age"),
4288 elements=[
4289 Age(title=_("Warning at")),
4290 Age(title=_("Critical at")),
4294 title=_('Policy specific levels (Clustermode only)'),
4295 help=_(
4296 "Here you can specify levels for different policies which overrule the levels "
4297 "from the <i>Default levels</i> parameter. This setting only works in NetApp Clustermode setups."
4299 allow_empty=False,
4300 ))],),
4301 TextAscii(title=_("Source Path"), allow_empty=False),
4302 "dict",
4305 register_check_parameters(
4306 RulespecGroupCheckParametersStorage,
4307 "netapp_snapshots",
4308 _("NetApp Snapshot Reserve"),
4309 Dictionary(
4310 elements=[
4311 ("levels",
4312 Tuple(
4313 title=_("Levels for used configured reserve"),
4314 elements=[
4315 Percentage(title=_("Warning at or above"), unit="%", default_value=85.0),
4316 Percentage(title=_("Critical at or above"), unit="%", default_value=90.0),
4317 ])),
4318 ("state_noreserve", MonitoringState(title=_("State if no reserve is configured"),)),
4319 ],),
4320 TextAscii(title=_("Volume name")),
4321 match_type="dict",
4324 register_check_parameters(
4325 RulespecGroupCheckParametersStorage,
4326 "netapp_disks",
4327 _("Filer Disk Levels (NetApp, IBM SVC)"),
4328 Transform(
4329 Dictionary(
4330 elements=[
4331 ("failed_spare_ratio",
4332 Tuple(
4333 title=_("Failed to spare ratio"),
4334 help=_("You can set a limit to the failed to spare disk ratio. "
4335 "The ratio is calculated with <i>spare / (failed + spare)</i>."),
4336 elements=[
4337 Percentage(title=_("Warning at or above"), default_value=1.0),
4338 Percentage(title=_("Critical at or above"), default_value=50.0),
4339 ])),
4340 ("offline_spare_ratio",
4341 Tuple(
4342 title=_("Offline to spare ratio"),
4343 help=_("You can set a limit to the offline to spare disk ratio. "
4344 "The ratio is calculated with <i>spare / (offline + spare)</i>."),
4345 elements=[
4346 Percentage(title=_("Warning at or above"), default_value=1.0),
4347 Percentage(title=_("Critical at or above"), default_value=50.0),
4348 ])),
4349 ("number_of_spare_disks",
4350 Tuple(
4351 title=_("Number of spare disks"),
4352 help=_("You can set a lower limit to the absolute number of spare disks."),
4353 elements=[
4354 Integer(title=_("Warning below"), default_value=2, min_value=0),
4355 Integer(title=_("Critical below"), default_value=1, min_value=0),
4356 ])),
4357 ],),
4358 forth=
4359 lambda a: "broken_spare_ratio" in a and {"failed_spare_ratio": a["broken_spare_ratio"]} or a
4361 None,
4362 match_type="dict",
4365 register_check_parameters(
4366 RulespecGroupCheckParametersStorage,
4367 "netapp_volumes",
4368 _("NetApp Volumes"),
4369 Dictionary(elements=[
4370 ("levels",
4371 Alternative(
4372 title=_("Levels for volume"),
4373 show_alternative_title=True,
4374 default_value=(80.0, 90.0),
4375 match=match_dual_level_type,
4376 elements=[
4377 get_free_used_dynamic_valuespec("used", "volume"),
4378 Transform(
4379 get_free_used_dynamic_valuespec("free", "volume", default_value=(20.0, 10.0)),
4380 allow_empty=False,
4381 forth=transform_filesystem_free,
4382 back=transform_filesystem_free)
4383 ])),
4384 ("perfdata",
4385 ListChoice(
4386 title=_("Performance data for protocols"),
4387 help=_("Specify for which protocol performance data should get recorded."),
4388 choices=[
4389 ("", _("Summarized data of all protocols")),
4390 ("nfs", _("NFS")),
4391 ("cifs", _("CIFS")),
4392 ("san", _("SAN")),
4393 ("fcp", _("FCP")),
4394 ("iscsi", _("iSCSI")),
4397 ("magic",
4398 Float(
4399 title=_("Magic factor (automatic level adaptation for large volumes)"),
4400 default_value=0.8,
4401 minvalue=0.1,
4402 maxvalue=1.0)),
4403 ("magic_normsize",
4404 Integer(
4405 title=_("Reference size for magic factor"), default_value=20, minvalue=1, unit=_("GB"))
4407 ("levels_low",
4408 Tuple(
4409 title=_("Minimum levels if using magic factor"),
4410 help=_("The volume levels will never fall below these values, when using "
4411 "the magic factor and the volume is very small."),
4412 elements=[
4413 Percentage(
4414 title=_("Warning if above"),
4415 unit=_("% usage"),
4416 allow_int=True,
4417 default_value=50),
4418 Percentage(
4419 title=_("Critical if above"),
4420 unit=_("% usage"),
4421 allow_int=True,
4422 default_value=60)
4423 ])),
4424 ("inodes_levels",
4425 Alternative(
4426 title=_("Levels for Inodes"),
4427 help=_("The number of remaining inodes on the filesystem. "
4428 "Please note that this setting has no effect on some filesystem checks."),
4429 elements=[
4430 Tuple(
4431 title=_("Percentage free"),
4432 elements=[
4433 Percentage(title=_("Warning if less than")),
4434 Percentage(title=_("Critical if less than")),
4436 Tuple(
4437 title=_("Absolute free"),
4438 elements=[
4439 Integer(
4440 title=_("Warning if less than"),
4441 size=10,
4442 unit=_("inodes"),
4443 minvalue=0,
4444 default_value=10000),
4445 Integer(
4446 title=_("Critical if less than"),
4447 size=10,
4448 unit=_("inodes"),
4449 minvalue=0,
4450 default_value=5000),
4453 default_value=(10.0, 5.0),
4455 ("show_inodes",
4456 DropdownChoice(
4457 title=_("Display inode usage in check output..."),
4458 choices=[
4459 ("onproblem", _("Only in case of a problem")),
4460 ("onlow", _("Only in case of a problem or if inodes are below 50%")),
4461 ("always", _("Always")),
4463 default_value="onlow",
4465 ("trend_range",
4466 Optional(
4467 Integer(
4468 title=_("Time Range for filesystem trend computation"),
4469 default_value=24,
4470 minvalue=1,
4471 unit=_("hours")),
4472 title=_("Trend computation"),
4473 label=_("Enable trend computation"))),
4474 ("trend_mb",
4475 Tuple(
4476 title=_("Levels on trends in MB per time range"),
4477 elements=[
4478 Integer(title=_("Warning at"), unit=_("MB / range"), default_value=100),
4479 Integer(title=_("Critical at"), unit=_("MB / range"), default_value=200)
4480 ])),
4481 ("trend_perc",
4482 Tuple(
4483 title=_("Levels for the percentual growth per time range"),
4484 elements=[
4485 Percentage(
4486 title=_("Warning at"),
4487 unit=_("% / range"),
4488 default_value=5,
4490 Percentage(
4491 title=_("Critical at"),
4492 unit=_("% / range"),
4493 default_value=10,
4495 ])),
4496 ("trend_timeleft",
4497 Tuple(
4498 title=_("Levels on the time left until the filesystem gets full"),
4499 elements=[
4500 Integer(
4501 title=_("Warning if below"),
4502 unit=_("hours"),
4503 default_value=12,
4505 Integer(
4506 title=_("Critical if below"),
4507 unit=_("hours"),
4508 default_value=6,
4510 ])),
4511 ("trend_showtimeleft",
4512 Checkbox(
4513 title=_("Display time left in check output"),
4514 label=_("Enable"),
4515 help=_("Normally, the time left until the disk is full is only displayed when "
4516 "the configured levels have been breached. If you set this option "
4517 "the check always reports this information"))),
4518 ("trend_perfdata",
4519 Checkbox(
4520 title=_("Trend performance data"),
4521 label=_("Enable generation of performance data from trends"))),
4523 TextAscii(title=_("Volume name")),
4524 match_type="dict",
4527 register_check_parameters(
4528 RulespecGroupCheckParametersStorage,
4529 "netapp_luns",
4530 _("NetApp LUNs"),
4531 Dictionary(
4532 title=_("Configure levels for used space"),
4533 elements=[
4534 ("ignore_levels",
4535 FixedValue(
4536 title=_("Ignore used space (this option disables any other options)"),
4537 help=_(
4538 "Some luns, e.g. jfs formatted, tend to report incorrect used space values"),
4539 label=_("Ignore used space"),
4540 value=True,
4541 totext="",
4543 ("levels",
4544 Alternative(
4545 title=_("Levels for LUN"),
4546 show_alternative_title=True,
4547 default_value=(80.0, 90.0),
4548 match=match_dual_level_type,
4549 elements=[
4550 get_free_used_dynamic_valuespec("used", "LUN"),
4551 Transform(
4552 get_free_used_dynamic_valuespec("free", "LUN", default_value=(20.0, 10.0)),
4553 allow_empty=False,
4554 forth=transform_filesystem_free,
4555 back=transform_filesystem_free,
4557 ])),
4558 ("trend_range",
4559 Optional(
4560 Integer(
4561 title=_("Time Range for lun filesystem trend computation"),
4562 default_value=24,
4563 minvalue=1,
4564 unit=_("hours")),
4565 title=_("Trend computation"),
4566 label=_("Enable trend computation"))),
4567 ("trend_mb",
4568 Tuple(
4569 title=_("Levels on trends in MB per time range"),
4570 elements=[
4571 Integer(title=_("Warning at"), unit=_("MB / range"), default_value=100),
4572 Integer(title=_("Critical at"), unit=_("MB / range"), default_value=200)
4573 ])),
4574 ("trend_perc",
4575 Tuple(
4576 title=_("Levels for the percentual growth per time range"),
4577 elements=[
4578 Percentage(
4579 title=_("Warning at"),
4580 unit=_("% / range"),
4581 default_value=5,
4583 Percentage(
4584 title=_("Critical at"),
4585 unit=_("% / range"),
4586 default_value=10,
4588 ])),
4589 ("trend_timeleft",
4590 Tuple(
4591 title=_("Levels on the time left until the lun filesystem gets full"),
4592 elements=[
4593 Integer(
4594 title=_("Warning if below"),
4595 unit=_("hours"),
4596 default_value=12,
4598 Integer(
4599 title=_("Critical if below"),
4600 unit=_("hours"),
4601 default_value=6,
4603 ])),
4604 ("trend_showtimeleft",
4605 Checkbox(
4606 title=_("Display time left in check output"),
4607 label=_("Enable"),
4608 help=_(
4609 "Normally, the time left until the lun filesystem is full is only displayed when "
4610 "the configured levels have been breached. If you set this option "
4611 "the check always reports this information"))),
4612 ("trend_perfdata",
4613 Checkbox(
4614 title=_("Trend performance data"),
4615 label=_("Enable generation of performance data from trends"))),
4616 ("read_only",
4617 Checkbox(
4618 title=_("LUN is read-only"),
4619 help=_("Display a warning if a LUN is not read-only. Without "
4620 "this setting a warning will be displayed if a LUN is "
4621 "read-only."),
4622 label=_("Enable"))),
4624 TextAscii(title=_("LUN name")),
4625 match_type="dict",
4628 register_check_parameters(
4629 RulespecGroupCheckParametersApplications,
4630 "services",
4631 _("Windows Services"),
4632 Dictionary(elements=[
4633 ("additional_servicenames",
4634 ListOfStrings(
4635 title=_("Alternative names for the service"),
4636 help=_("Here you can specify alternative names that the service might have. "
4637 "This helps when the exact spelling of the services can changed from "
4638 "one version to another."),
4640 ("states",
4641 ListOf(
4642 Tuple(
4643 orientation="horizontal",
4644 elements=[
4645 DropdownChoice(
4646 title=_("Expected state"),
4647 default_value="running",
4648 choices=[(None,
4649 _("ignore the state")), ("running",
4650 _("running")), ("stopped",
4651 _("stopped"))]),
4652 DropdownChoice(
4653 title=_("Start type"),
4654 default_value="auto",
4655 choices=[
4656 (None, _("ignore the start type")),
4657 ("demand",
4658 _("demand")),
4659 ("disabled", _("disabled")),
4660 ("auto", _("auto")),
4661 ("unknown", _("unknown (old agent)")),
4663 MonitoringState(title=_("Resulting state"),),
4665 default_value=("running", "auto", 0)),
4666 title=_("Services states"),
4667 help=_("You can specify a separate monitoring state for each possible "
4668 "combination of service state and start type. If you do not use "
4669 "this parameter, then only running/auto will be assumed to be OK."),
4670 )), (
4671 "else",
4672 MonitoringState(
4673 title=_("State if no entry matches"),
4674 default_value=2,
4677 ('icon',
4678 UserIconOrAction(
4679 title=_("Add custom icon or action"),
4680 help=_("You can assign icons or actions to the found services in the status GUI."),
4683 TextAscii(
4684 title=_("Name of the service"),
4685 help=_("Please Please note, that the agent replaces spaces in "
4686 "the service names with underscores. If you are unsure about the "
4687 "correct spelling of the name then please look at the output of "
4688 "the agent (cmk -d HOSTNAME). The service names are in the first "
4689 "column of the section &lt;&lt;&lt;services&gt;&gt;&gt;. Please "
4690 "do not mix up the service name with the display name of the service."
4691 "The latter one is just being displayed as a further information."),
4692 allow_empty=False),
4693 match_type="dict",
4696 register_check_parameters(
4697 RulespecGroupCheckParametersApplications,
4698 "solaris_services",
4699 _("Solaris Services"),
4700 Dictionary(
4701 elements=[
4702 ("additional_servicenames",
4703 ListOfStrings(
4704 title=_("Alternative names for the service"),
4705 help=_("Here you can specify alternative names that the service might have. "
4706 "This helps when the exact spelling of the services can changed from "
4707 "one version to another."),
4709 ("states",
4710 ListOf(
4711 Tuple(
4712 orientation="horizontal",
4713 elements=[
4714 DropdownChoice(
4715 title=_("Expected state"),
4716 choices=[
4717 (None, _("Ignore the state")),
4718 ("online", _("Online")),
4719 ("disabled", _("Disabled")),
4720 ("maintenance", _("Maintenance")),
4721 ("legacy_run", _("Legacy run")),
4723 DropdownChoice(
4724 title=_("STIME"),
4725 choices=[
4726 (None, _("Ignore")),
4727 (True, _("Has changed")),
4728 (False, _("Did not changed")),
4730 MonitoringState(title=_("Resulting state"),),
4733 title=_("Services states"),
4734 help=_("You can specify a separate monitoring state for each possible "
4735 "combination of service state. If you do not use this parameter, "
4736 "then only online/legacy_run will be assumed to be OK."),
4738 ("else", MonitoringState(
4739 title=_("State if no entry matches"),
4740 default_value=2,
4742 ],),
4743 TextAscii(title=_("Name of the service"), allow_empty=False),
4744 match_type="dict",
4747 register_check_parameters(
4748 RulespecGroupCheckParametersApplications,
4749 "winperf_ts_sessions",
4750 _("Windows Terminal Server Sessions"),
4751 Dictionary(
4752 help=_("This check monitors number of active and inactive terminal "
4753 "server sessions."),
4754 elements=[
4756 "active",
4757 Tuple(
4758 title=_("Number of active sessions"),
4759 elements=[
4760 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
4761 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
4766 "inactive",
4767 Tuple(
4768 title=_("Number of inactive sessions"),
4769 help=_("Levels for the number of sessions that are currently inactive"),
4770 elements=[
4771 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
4772 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
4777 None,
4778 match_type="dict",
4781 register_check_parameters(
4782 RulespecGroupCheckParametersStorage, "raid", _("RAID: overall state"), None,
4783 TextAscii(
4784 title=_("Name of the device"),
4785 help=_("For Linux MD specify the device name without the "
4786 "<tt>/dev/</tt>, e.g. <tt>md0</tt>, for hardware raids "
4787 "please refer to the manual of the actual check being used.")), "first")
4789 register_check_parameters(
4790 RulespecGroupCheckParametersStorage, "raid_summary", _("RAID: summary state"),
4791 Dictionary(elements=[
4792 ("use_device_states",
4793 DropdownChoice(
4794 title=_("Use device states and overwrite expected status"),
4795 choices=[
4796 (False, _("Ignore")),
4797 (True, _("Use device states")),
4799 default_value=True,
4801 ]), None, "dict")
4803 register_check_parameters(
4804 RulespecGroupCheckParametersStorage, "raid_disk", _("RAID: state of a single disk"),
4805 Transform(
4806 Dictionary(elements=[
4808 "expected_state",
4809 TextAscii(
4810 title=_("Expected state"),
4811 help=_("State the disk is expected to be in. Typical good states "
4812 "are online, host spare, OK and the like. The exact way of how "
4813 "to specify a state depends on the check and hard type being used. "
4814 "Please take examples from discovered checks for reference.")),
4816 ("use_device_states",
4817 DropdownChoice(
4818 title=_("Use device states and overwrite expected status"),
4819 choices=[
4820 (False, _("Ignore")),
4821 (True, _("Use device states")),
4823 default_value=True,
4826 forth=lambda x: isinstance(x, str) and {"expected_state": x} or x,
4828 TextAscii(
4829 title=_("Number or ID of the disk"),
4830 help=_("How the disks are named depends on the type of hardware being "
4831 "used. Please look at already discovered checks for examples.")), "first")
4833 register_check_parameters(
4834 RulespecGroupCheckParametersStorage, "pfm_health", _("PCIe flash module"),
4835 Dictionary(
4836 elements=[
4838 "health_lifetime_perc",
4839 Tuple(
4840 title=_("Lower levels for health lifetime"),
4841 elements=[
4842 Percentage(title=_("Warning if below"), default_value=10),
4843 Percentage(title=_("Critical if below"), default_value=5)
4847 ],),
4848 TextAscii(
4849 title=_("Number or ID of the disk"),
4850 help=_("How the disks are named depends on the type of hardware being "
4851 "used. Please look at already discovered checks for examples.")), "dict")
4853 register_check_parameters(
4854 RulespecGroupCheckParametersEnvironment,
4855 "switch_contact",
4856 _("Switch contact state"),
4857 DropdownChoice(
4858 help=_("This rule sets the required state of a switch contact"),
4859 label=_("Required switch contact state"),
4860 choices=[
4861 ("open", "Switch contact is <b>open</b>"),
4862 ("closed", "Switch contact is <b>closed</b>"),
4863 ("ignore", "Ignore switch contact state"),
4866 TextAscii(title=_("Sensor"), allow_empty=False),
4867 match_type="first",
4870 register_check_parameters(
4871 RulespecGroupCheckParametersEnvironment,
4872 "plugs",
4873 _("State of PDU Plugs"),
4874 DropdownChoice(
4875 help=_("This rule sets the required state of a PDU plug. It is meant to "
4876 "be independent of the hardware manufacturer."),
4877 title=_("Required plug state"),
4878 choices=[
4879 ("on", _("Plug is ON")),
4880 ("off", _("Plug is OFF")),
4882 default_value="on"),
4883 TextAscii(
4884 title=_("Plug item number or name"),
4885 help=
4886 _("Whether you need the number or the name depends on the check. Just take a look to the service description."
4888 allow_empty=True),
4889 match_type="first",
4892 # New temperature rule for modern temperature checks that have the
4893 # sensor type (e.g. "CPU", "Chassis", etc.) as the beginning of their
4894 # item (e.g. "CPU 1", "Chassis 17/11"). This will replace all other
4895 # temperature rulesets in future. Note: those few temperature checks
4896 # that do *not* use an item, need to be converted to use one single
4897 # item (other than None).
4898 register_check_parameters(
4899 RulespecGroupCheckParametersEnvironment,
4900 "temperature",
4901 _("Temperature"),
4902 Transform(
4903 Dictionary(elements=[
4904 ("levels",
4905 Tuple(
4906 title=_("Upper Temperature Levels"),
4907 elements=[
4908 Float(title=_("Warning at"), unit=u"°C", default_value=26),
4909 Float(title=_("Critical at"), unit=u"°C", default_value=30),
4910 ])),
4911 ("levels_lower",
4912 Tuple(
4913 title=_("Lower Temperature Levels"),
4914 elements=[
4915 Float(title=_("Warning below"), unit=u"°C", default_value=0),
4916 Float(title=_("Critical below"), unit=u"°C", default_value=-10),
4917 ])),
4918 ("output_unit",
4919 DropdownChoice(
4920 title=_("Display values in "),
4921 choices=[
4922 ("c", _("Celsius")),
4923 ("f", _("Fahrenheit")),
4924 ("k", _("Kelvin")),
4925 ])),
4926 ("input_unit",
4927 DropdownChoice(
4928 title=_("Override unit of sensor"),
4929 help=_("In some rare cases the unit that is signalled by the sensor "
4930 "is wrong and e.g. the sensor sends values in Fahrenheit while "
4931 "they are misinterpreted as Celsius. With this setting you can "
4932 "force the reading of the sensor to be interpreted as customized. "),
4933 choices=[
4934 ("c", _("Celsius")),
4935 ("f", _("Fahrenheit")),
4936 ("k", _("Kelvin")),
4937 ])),
4938 ("device_levels_handling",
4939 DropdownChoice(
4940 title=_("Interpretation of the device's own temperature status"),
4941 choices=[
4942 ("usr", _("Ignore device's own levels")),
4943 ("dev", _("Only use device's levels, ignore yours")),
4944 ("best", _("Use least critical of your and device's levels")),
4945 ("worst", _("Use most critical of your and device's levels")),
4946 ("devdefault", _("Use device's levels if present, otherwise yours")),
4947 ("usrdefault", _("Use your own levels if present, otherwise the device's")),
4949 default_value="usrdefault",
4952 "trend_compute",
4953 Dictionary(
4954 title=_("Trend computation"),
4955 label=_("Enable trend computation"),
4956 elements=[
4957 ("period",
4958 Integer(
4959 title=_("Observation period for temperature trend computation"),
4960 default_value=30,
4961 minvalue=5,
4962 unit=_("minutes"))),
4963 ("trend_levels",
4964 Tuple(
4965 title=_("Levels on temperature increase per period"),
4966 elements=[
4967 Integer(
4968 title=_("Warning at"),
4969 unit=u"°C / " + _("period"),
4970 default_value=5),
4971 Integer(
4972 title=_("Critical at"),
4973 unit=u"°C / " + _("period"),
4974 default_value=10)
4975 ])),
4976 ("trend_levels_lower",
4977 Tuple(
4978 title=_("Levels on temperature decrease per period"),
4979 elements=[
4980 Integer(
4981 title=_("Warning at"),
4982 unit=u"°C / " + _("period"),
4983 default_value=5),
4984 Integer(
4985 title=_("Critical at"),
4986 unit=u"°C / " + _("period"),
4987 default_value=10)
4988 ])),
4989 ("trend_timeleft",
4990 Tuple(
4991 title=
4992 _("Levels on the time left until a critical temperature (upper or lower) is reached"
4994 elements=[
4995 Integer(
4996 title=_("Warning if below"),
4997 unit=_("minutes"),
4998 default_value=240,
5000 Integer(
5001 title=_("Critical if below"),
5002 unit=_("minutes"),
5003 default_value=120,
5007 optional_keys=["trend_levels", "trend_levels_lower", "trend_timeleft"],
5011 forth=lambda v: isinstance(v, tuple) and {"levels": v} or v,
5013 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
5014 "dict",
5017 register_check_parameters(
5018 RulespecGroupCheckParametersEnvironment,
5019 "room_temperature",
5020 _("Room temperature (external thermal sensors)"),
5021 Tuple(
5022 help=_("Temperature levels for external thermometers that are used "
5023 "for monitoring the temperature of a datacenter. An example "
5024 "is the webthem from W&T."),
5025 elements=[
5026 Integer(title=_("warning at"), unit=u"°C", default_value=26),
5027 Integer(title=_("critical at"), unit=u"°C", default_value=30),
5029 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
5030 "first",
5031 deprecated=True,
5034 register_check_parameters(
5035 RulespecGroupCheckParametersEnvironment,
5036 "hw_single_temperature",
5037 _("Host/Device temperature"),
5038 Tuple(
5039 help=_("Temperature levels for hardware devices with "
5040 "a single temperature sensor."),
5041 elements=[
5042 Integer(title=_("warning at"), unit=u"°C", default_value=35),
5043 Integer(title=_("critical at"), unit=u"°C", default_value=40),
5045 None,
5046 "first",
5047 deprecated=True,
5050 register_check_parameters(
5051 RulespecGroupCheckParametersEnvironment, "evolt",
5052 _("Voltage levels (UPS / PDU / Other Devices)"),
5053 Tuple(
5054 help=_("Voltage Levels for devices like UPS or PDUs. "
5055 "Several phases may be addressed independently."),
5056 elements=[
5057 Integer(title=_("warning if below"), unit="V", default_value=210),
5058 Integer(title=_("critical if below"), unit="V", default_value=180),
5060 TextAscii(title=_("Phase"),
5061 help=_("The identifier of the phase the power is related to.")), "first")
5063 register_check_parameters(
5064 RulespecGroupCheckParametersEnvironment, "efreq", _("Nominal Frequencies"),
5065 Tuple(
5066 help=_("Levels for the nominal frequencies of AC devices "
5067 "like UPSs or PDUs. Several phases may be addressed independently."),
5068 elements=[
5069 Integer(title=_("warning if below"), unit="Hz", default_value=40),
5070 Integer(title=_("critical if below"), unit="Hz", default_value=45),
5072 TextAscii(title=_("Phase"), help=_("The identifier of the phase the power is related to.")),
5073 "first")
5075 register_check_parameters(
5076 RulespecGroupCheckParametersEnvironment, "epower", _("Electrical Power"),
5077 Tuple(
5078 help=_("Levels for the electrical power consumption of a device "
5079 "like a UPS or a PDU. Several phases may be addressed independently."),
5080 elements=[
5081 Integer(title=_("warning if below"), unit="Watt", default_value=20),
5082 Integer(title=_("critical if below"), unit="Watt", default_value=1),
5084 TextAscii(title=_("Phase"), help=_("The identifier of the phase the power is related to.")),
5085 "first")
5087 register_check_parameters(
5088 RulespecGroupCheckParametersEnvironment, "ups_out_load",
5089 _("Parameters for output loads of UPSs and PDUs"),
5090 Tuple(elements=[
5091 Integer(title=_("warning at"), unit=u"%", default_value=85),
5092 Integer(title=_("critical at"), unit=u"%", default_value=90),
5093 ]), TextAscii(title=_("Phase"), help=_("The identifier of the phase the power is related to.")),
5094 "first")
5096 register_check_parameters(
5097 RulespecGroupCheckParametersEnvironment, "epower_single",
5098 _("Electrical Power for Devices with only one phase"),
5099 Tuple(
5100 help=_("Levels for the electrical power consumption of a device "),
5101 elements=[
5102 Integer(title=_("warning if at"), unit="Watt", default_value=300),
5103 Integer(title=_("critical if at"), unit="Watt", default_value=400),
5104 ]), None, "first")
5106 register_check_parameters(
5107 RulespecGroupCheckParametersEnvironment,
5108 "hw_temperature",
5109 _("Hardware temperature, multiple sensors"),
5110 Tuple(
5111 help=_("Temperature levels for hardware devices like "
5112 "Brocade switches with (potentially) several "
5113 "temperature sensors. Sensor IDs can be selected "
5114 "in the rule."),
5115 elements=[
5116 Integer(title=_("warning at"), unit=u"°C", default_value=35),
5117 Integer(title=_("critical at"), unit=u"°C", default_value=40),
5119 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
5120 "first",
5121 deprecated=True,
5124 register_check_parameters(
5125 RulespecGroupCheckParametersEnvironment,
5126 "hw_temperature_single",
5127 _("Hardware temperature, single sensor"),
5128 Tuple(
5129 help=_("Temperature levels for hardware devices like "
5130 "DELL Powerconnect that have just one temperature sensor. "),
5131 elements=[
5132 Integer(title=_("warning at"), unit=u"°C", default_value=35),
5133 Integer(title=_("critical at"), unit=u"°C", default_value=40),
5135 None,
5136 "first",
5137 deprecated=True,
5140 register_check_parameters(
5141 RulespecGroupCheckParametersEnvironment,
5142 "disk_temperature",
5143 _("Harddisk temperature (e.g. via SMART)"),
5144 Tuple(
5145 help=_("Temperature levels for hard disks, that is determined e.g. via SMART"),
5146 elements=[
5147 Integer(title=_("warning at"), unit=u"°C", default_value=35),
5148 Integer(title=_("critical at"), unit=u"°C", default_value=40),
5150 TextAscii(
5151 title=_("Hard disk device"),
5152 help=_("The identificator of the hard disk device, e.g. <tt>/dev/sda</tt>.")),
5153 "first",
5154 deprecated=True,
5157 register_check_parameters(
5158 RulespecGroupCheckParametersEnvironment, "eaton_enviroment",
5159 _("Temperature and Humidity for Eaton UPS"),
5160 Dictionary(elements=[
5161 ("temp",
5162 Tuple(
5163 title=_("Temperature"),
5164 elements=[
5165 Integer(title=_("warning at"), unit=u"°C", default_value=26),
5166 Integer(title=_("critical at"), unit=u"°C", default_value=30),
5167 ])),
5168 ("remote_temp",
5169 Tuple(
5170 title=_("Remote Temperature"),
5171 elements=[
5172 Integer(title=_("warning at"), unit=u"°C", default_value=26),
5173 Integer(title=_("critical at"), unit=u"°C", default_value=30),
5174 ])),
5175 ("humidity",
5176 Tuple(
5177 title=_("Humidity"),
5178 elements=[
5179 Integer(title=_("warning at"), unit=u"%", default_value=60),
5180 Integer(title=_("critical at"), unit=u"%", default_value=75),
5181 ])),
5182 ]), None, "dict")
5184 phase_elements = [
5185 ("voltage",
5186 Tuple(
5187 title=_("Voltage"),
5188 elements=[
5189 Integer(title=_("warning if below"), unit=u"V", default_value=210),
5190 Integer(title=_("critical if below"), unit=u"V", default_value=200),
5193 ("power",
5194 Tuple(
5195 title=_("Power"),
5196 elements=[
5197 Integer(title=_("warning at"), unit=u"W", default_value=1000),
5198 Integer(title=_("critical at"), unit=u"W", default_value=1200),
5201 ("appower",
5202 Tuple(
5203 title=_("Apparent Power"),
5204 elements=[
5205 Integer(title=_("warning at"), unit=u"VA", default_value=1100),
5206 Integer(title=_("critical at"), unit=u"VA", default_value=1300),
5209 ("current",
5210 Tuple(
5211 title=_("Current"),
5212 elements=[
5213 Integer(title=_("warning at"), unit=u"A", default_value=5),
5214 Integer(title=_("critical at"), unit=u"A", default_value=10),
5217 ("frequency",
5218 Tuple(
5219 title=_("Frequency"),
5220 elements=[
5221 Integer(title=_("warning if below"), unit=u"Hz", default_value=45),
5222 Integer(title=_("critical if below"), unit=u"Hz", default_value=40),
5223 Integer(title=_("warning if above"), unit=u"Hz", default_value=55),
5224 Integer(title=_("critical if above"), unit=u"Hz", default_value=60),
5227 ("differential_current_ac",
5228 Tuple(
5229 title=_("Differential current AC"),
5230 elements=[
5231 Float(title=_("warning at"), unit=u"mA", default_value=3.5),
5232 Float(title=_("critical at"), unit=u"mA", default_value=30),
5235 ("differential_current_dc",
5236 Tuple(
5237 title=_("Differential current DC"),
5238 elements=[
5239 Float(title=_("warning at"), unit=u"mA", default_value=70),
5240 Float(title=_("critical at"), unit=u"mA", default_value=100),
5245 register_check_parameters(
5246 RulespecGroupCheckParametersEnvironment, "ups_outphase",
5247 _("Parameters for output phases of UPSs and PDUs"),
5248 Dictionary(
5249 help=_("This rule allows you to specify levels for the voltage, current, load, power "
5250 "and apparent power of your device. The levels will only be applied if the device "
5251 "actually supplies values for these parameters."),
5252 elements=phase_elements + [
5253 ("load",
5254 Tuple(
5255 title=_("Load"),
5256 elements=[
5257 Integer(title=_("warning at"), unit=u"%", default_value=80),
5258 Integer(title=_("critical at"), unit=u"%", default_value=90),
5259 ])),
5260 ("map_device_states",
5261 ListOf(
5262 Tuple(elements=[TextAscii(size=10), MonitoringState()]),
5263 title=_("Map device state"),
5264 help=_("Here you can enter either device state number (eg. from SNMP devices) "
5265 "or exact device state name and the related monitoring state."),
5268 TextAscii(
5269 title=_("Output Name"),
5270 help=_("The name of the output, e.g. <tt>Phase 1</tt>/<tt>PDU 1</tt>")), "dict")
5272 register_check_parameters(
5273 RulespecGroupCheckParametersEnvironment, "el_inphase",
5274 _("Parameters for input phases of UPSs and PDUs"),
5275 Dictionary(
5276 help=_("This rule allows you to specify levels for the voltage, current, power "
5277 "and apparent power of your device. The levels will only be applied if the device "
5278 "actually supplies values for these parameters."),
5279 elements=phase_elements + [
5280 ("map_device_states",
5281 ListOf(
5282 Tuple(elements=[TextAscii(size=10), MonitoringState()]),
5283 title=_("Map device state"),
5284 help=_("Here you can enter either device state number (eg. from SNMP devices) "
5285 "or exact device state name and the related monitoring state."),
5288 ), TextAscii(title=_("Input Name"), help=_("The name of the input, e.g. <tt>Phase 1</tt>")),
5289 "dict")
5291 register_check_parameters(
5292 RulespecGroupCheckParametersEnvironment,
5293 "hw_fans",
5294 _("FAN speed of Hardware devices"),
5295 Dictionary(
5296 elements=[
5298 "lower",
5299 Tuple(
5300 help=_("Lower levels for the fan speed of a hardware device"),
5301 title=_("Lower levels"),
5302 elements=[
5303 Integer(title=_("warning if below"), unit=u"rpm"),
5304 Integer(title=_("critical if below"), unit=u"rpm"),
5308 "upper",
5309 Tuple(
5310 help=_("Upper levels for the fan speed of a hardware device"),
5311 title=_("Upper levels"),
5312 elements=[
5313 Integer(title=_("warning at"), unit=u"rpm", default_value=8000),
5314 Integer(title=_("critical at"), unit=u"rpm", default_value=8400),
5317 ("output_metrics",
5318 Checkbox(title=_("Performance data"), label=_("Enable performance data"))),
5320 optional_keys=["upper"],
5322 TextAscii(title=_("Fan Name"), help=_("The identificator of the fan.")),
5323 match_type="dict",
5326 register_check_parameters(
5327 RulespecGroupCheckParametersEnvironment,
5328 "hw_fans_perc",
5329 _("Fan speed of hardware devices (in percent)"),
5330 Dictionary(elements=[
5331 ("levels",
5332 Tuple(
5333 title=_("Upper fan speed levels"),
5334 elements=[
5335 Percentage(title=_("warning if at")),
5336 Percentage(title=_("critical if at")),
5337 ])),
5338 ("levels_lower",
5339 Tuple(
5340 title=_("Lower fan speed levels"),
5341 elements=[
5342 Percentage(title=_("warning if below")),
5343 Percentage(title=_("critical if below")),
5344 ])),
5346 TextAscii(title=_("Fan Name"), help=_("The identifier of the fan.")),
5347 "dict",
5350 register_check_parameters(
5351 RulespecGroupCheckParametersOperatingSystem,
5352 "pf_used_states",
5353 _("Number of used states of OpenBSD PF engine"),
5354 Dictionary(
5355 elements=[
5357 "used",
5358 Tuple(
5359 title=_("Limits for the number of used states"),
5360 elements=[
5361 Integer(title=_("warning at")),
5362 Integer(title=_("critical at")),
5366 optional_keys=[None],
5368 None,
5369 match_type="dict",
5372 register_check_parameters(
5373 RulespecGroupCheckParametersEnvironment,
5374 "pdu_gude",
5375 _("Levels for Gude PDU Devices"),
5376 Dictionary(elements=[
5377 ("kWh",
5378 Tuple(
5379 title=_("Total accumulated Active Energy of Power Channel"),
5380 elements=[
5381 Integer(title=_("warning at"), unit=_("kW")),
5382 Integer(title=_("critical at"), unit=_("kW")),
5383 ])),
5384 ("W",
5385 Tuple(
5386 title=_("Active Power"),
5387 elements=[
5388 Integer(title=_("warning at"), unit=_("W")),
5389 Integer(title=_("critical at"), unit=_("W")),
5390 ])),
5391 ("A",
5392 Tuple(
5393 title=_("Current on Power Channel"),
5394 elements=[
5395 Integer(title=_("warning at"), unit=_("A")),
5396 Integer(title=_("critical at"), unit=_("A")),
5397 ])),
5398 ("V",
5399 Tuple(
5400 title=_("Voltage on Power Channel"),
5401 elements=[
5402 Integer(title=_("warning if below"), unit=_("V")),
5403 Integer(title=_("critical if below"), unit=_("V")),
5404 ])),
5405 ("VA",
5406 Tuple(
5407 title=_("Line Mean Apparent Power"),
5408 elements=[
5409 Integer(title=_("warning at"), unit=_("VA")),
5410 Integer(title=_("critical at"), unit=_("VA")),
5411 ])),
5413 TextAscii(title=_("Phase Number"), help=_("The Number of the power Phase.")),
5414 match_type="dict",
5417 register_check_parameters(
5418 RulespecGroupCheckParametersEnvironment, "hostsystem_sensors", _("Hostsystem sensor alerts"),
5419 ListOf(
5420 Dictionary(
5421 help=_("This rule allows to override alert levels for the given sensor names."),
5422 elements=[
5423 ("name", TextAscii(title=_("Sensor name"))),
5424 ("states",
5425 Dictionary(
5426 title=_("Custom states"),
5427 elements=[(element,
5428 MonitoringState(
5429 title="Sensor %s" % description,
5430 label=_("Set state to"),
5431 default_value=int(element)))
5432 for (element, description) in [("0", _("OK")), (
5433 "1", _("WARNING")), ("2", _("CRITICAL")), ("3", _("UNKNOWN"))]],
5436 optional_keys=False),
5437 add_label=_("Add sensor name")), None, "first")
5439 register_check_parameters(
5440 RulespecGroupCheckParametersEnvironment, "netapp_instance", _("Netapp Instance State"),
5441 ListOf(
5442 Dictionary(
5443 help=_("This rule allows you to override netapp warnings"),
5444 elements=[("name", TextAscii(title=_("Warning starts with"))),
5445 ("state", MonitoringState(title="Set state to", default_value=1))],
5446 optional_keys=False),
5447 add_label=_("Add warning")), None, "first")
5449 register_check_parameters(
5450 RulespecGroupCheckParametersEnvironment,
5451 "temperature_auto",
5452 _("Temperature sensors with builtin levels"),
5453 None,
5454 TextAscii(title=_("Sensor ID"), help=_("The identificator of the thermal sensor.")),
5455 "first",
5456 deprecated=True,
5459 register_check_parameters(
5460 RulespecGroupCheckParametersEnvironment,
5461 "temperature_trends",
5462 _("Temperature trends for devices with builtin levels"),
5463 Dictionary(
5464 title=_("Temperature Trend Analysis"),
5465 help=_(
5466 "This rule enables and configures a trend analysis and corresponding limits for devices, "
5467 "which have their own limits configured on the device. It will only work for supported "
5468 "checks, right now the <tt>adva_fsp_temp</tt> check."),
5469 elements=[
5470 ("trend_range",
5471 Optional(
5472 Integer(
5473 title=_("Time range for temperature trend computation"),
5474 default_value=30,
5475 minvalue=5,
5476 unit=_("minutes")),
5477 title=_("Trend computation"),
5478 label=_("Enable trend computation"))),
5479 ("trend_c",
5480 Tuple(
5481 title=_("Levels on trends in degrees Celsius per time range"),
5482 elements=[
5483 Integer(title=_("Warning at"), unit=u"°C / " + _("range"), default_value=5),
5484 Integer(title=_("Critical at"), unit=u"°C / " + _("range"), default_value=10)
5485 ])),
5486 ("trend_timeleft",
5487 Tuple(
5488 title=_("Levels on the time left until limit is reached"),
5489 elements=[
5490 Integer(
5491 title=_("Warning if below"),
5492 unit=_("minutes"),
5493 default_value=240,
5495 Integer(
5496 title=_("Critical if below"),
5497 unit=_("minutes"),
5498 default_value=120,
5500 ])),
5502 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
5503 "dict",
5504 deprecated=True,
5506 ntp_params = Tuple(
5507 title=_("Thresholds for quality of time"),
5508 elements=[
5509 Integer(
5510 title=_("Critical at stratum"),
5511 default_value=10,
5512 help=_(
5513 "The stratum (\"distance\" to the reference clock) at which the check gets critical."
5516 Float(
5517 title=_("Warning at"),
5518 unit=_("ms"),
5519 default_value=200.0,
5520 help=_("The offset in ms at which a warning state is triggered."),
5522 Float(
5523 title=_("Critical at"),
5524 unit=_("ms"),
5525 default_value=500.0,
5526 help=_("The offset in ms at which a critical state is triggered."),
5530 register_check_parameters(
5531 RulespecGroupCheckParametersOperatingSystem, "ntp_time", _("State of NTP time synchronisation"),
5532 Transform(
5533 Dictionary(elements=[
5535 "ntp_levels",
5536 ntp_params,
5538 ("alert_delay",
5539 Tuple(
5540 title=_("Phases without synchronization"),
5541 elements=[
5542 Age(
5543 title=_("Warning at"),
5544 display=["hours", "minutes"],
5545 default_value=300,
5547 Age(
5548 title=_("Critical at"),
5549 display=["hours", "minutes"],
5550 default_value=3600,
5552 ])),
5554 forth=lambda params: isinstance(params, tuple) and {"ntp_levels": params} or params), None,
5555 "dict")
5557 register_check_parameters(RulespecGroupCheckParametersOperatingSystem, "ntp_peer",
5558 _("State of NTP peer"), ntp_params,
5559 TextAscii(title=_("Name of the peer")), "first")
5561 register_check_parameters(
5562 RulespecGroupCheckParametersEnvironment,
5563 "smoke",
5564 _("Smoke Detection"),
5565 Tuple(
5566 help=_("For devices which measure smoke in percent"),
5567 elements=[
5568 Percentage(title=_("Warning at"), allow_int=True, default_value=1),
5569 Percentage(title=_("Critical at"), allow_int=True, default_value=5),
5571 TextAscii(title=_("Sensor ID"), help=_("The identifier of the sensor.")),
5572 "first",
5575 register_check_parameters(
5576 RulespecGroupCheckParametersEnvironment,
5577 "apc_ats_output",
5578 _("APC Automatic Transfer Switch Output"),
5579 Dictionary(
5580 title=_("Levels for ATS Output parameters"),
5581 optional_keys=True,
5582 elements=[
5583 ("output_voltage_max",
5584 Tuple(
5585 title=_("Maximum Levels for Voltage"),
5586 elements=[
5587 Integer(title=_("Warning at"), unit="Volt"),
5588 Integer(title=_("Critical at"), unit="Volt"),
5589 ])),
5590 ("output_voltage_min",
5591 Tuple(
5592 title=_("Minimum Levels for Voltage"),
5593 elements=[
5594 Integer(title=_("Warning if below"), unit="Volt"),
5595 Integer(title=_("Critical if below"), unit="Volt"),
5596 ])),
5597 ("load_perc_max",
5598 Tuple(
5599 title=_("Maximum Levels for load in percent"),
5600 elements=[
5601 Percentage(title=_("Warning at")),
5602 Percentage(title=_("Critical at")),
5603 ])),
5604 ("load_perc_min",
5605 Tuple(
5606 title=_("Minimum Levels for load in percent"),
5607 elements=[
5608 Percentage(title=_("Warning if below")),
5609 Percentage(title=_("Critical if below")),
5610 ])),
5613 TextAscii(title=_("ID of phase")),
5614 "dict",
5617 register_check_parameters(
5618 RulespecGroupCheckParametersEnvironment,
5619 "airflow",
5620 _("Airflow levels"),
5621 Dictionary(
5622 title=_("Levels for airflow"),
5623 elements=[
5624 ("level_low",
5625 Tuple(
5626 title=_("Lower levels"),
5627 elements=[
5628 Float(
5629 title=_("Warning if below"),
5630 unit=_("l/s"),
5631 default_value=5.0,
5632 allow_int=True),
5633 Float(
5634 title=_("Critical if below"),
5635 unit=_("l/s"),
5636 default_value=2.0,
5637 allow_int=True)
5638 ])),
5639 ("level_high",
5640 Tuple(
5641 title=_("Upper levels"),
5642 elements=[
5643 Float(
5644 title=_("Warning at"), unit=_("l/s"), default_value=10.0, allow_int=True),
5645 Float(
5646 title=_("Critical at"), unit=_("l/s"), default_value=11.0, allow_int=True)
5647 ])),
5649 None,
5650 match_type="dict",
5653 register_check_parameters(
5654 RulespecGroupCheckParametersEnvironment,
5655 "ups_capacity",
5656 _("UPS Capacity"),
5657 Dictionary(
5658 title=_("Levels for battery parameters"),
5659 optional_keys=False,
5660 elements=[(
5661 "capacity",
5662 Tuple(
5663 title=_("Battery capacity"),
5664 elements=[
5665 Integer(
5666 title=_("Warning at"),
5667 help=
5668 _("The battery capacity in percent at and below which a warning state is triggered"
5670 unit="%",
5671 default_value=95,
5673 Integer(
5674 title=_("Critical at"),
5675 help=
5676 _("The battery capacity in percent at and below which a critical state is triggered"
5678 unit="%",
5679 default_value=90,
5685 "battime",
5686 Tuple(
5687 title=_("Time left on battery"),
5688 elements=[
5689 Integer(
5690 title=_("Warning at"),
5691 help=
5692 _("Time left on Battery at and below which a warning state is triggered"
5694 unit=_("min"),
5695 default_value=0,
5697 Integer(
5698 title=_("Critical at"),
5699 help=
5700 _("Time Left on Battery at and below which a critical state is triggered"
5702 unit=_("min"),
5703 default_value=0,
5709 None,
5710 match_type="dict",
5713 register_check_parameters(
5714 RulespecGroupCheckParametersApplications,
5715 "mbg_lantime_state",
5716 _("Meinberg Lantime State"),
5717 Dictionary(
5718 title=_("Meinberg Lantime State"),
5719 elements=[
5720 ("stratum",
5721 Tuple(
5722 title=_("Warning levels for Stratum"),
5723 elements=[
5724 Integer(
5725 title=_("Warning at"),
5726 default_value=2,
5728 Integer(
5729 title=_("Critical at"),
5730 default_value=3,
5732 ])),
5733 ("offset",
5734 Tuple(
5735 title=_("Warning levels for Time Offset"),
5736 elements=[
5737 Integer(
5738 title=_("Warning at"),
5739 unit=_("microseconds"),
5740 default_value=10,
5742 Integer(
5743 title=_("Critical at"),
5744 unit=_("microseconds"),
5745 default_value=20,
5747 ])),
5749 None,
5750 match_type="dict",
5753 register_check_parameters(
5754 RulespecGroupCheckParametersApplications, "sansymphony_pool", _("Sansymphony: pool allocation"),
5755 Tuple(
5756 help=_("This rule sets the warn and crit levels for the percentage of allocated pools"),
5757 elements=[
5758 Integer(
5759 title=_("Warning at"),
5760 unit=_("percent"),
5761 default_value=80,
5763 Integer(
5764 title=_("Critical at"),
5765 unit=_("percent"),
5766 default_value=90,
5768 ]), TextAscii(title=_("Name of the pool"),), "first")
5770 register_check_parameters(
5771 RulespecGroupCheckParametersApplications, "sansymphony_alerts",
5772 _("Sansymphony: Number of unacknowlegded alerts"),
5773 Tuple(
5774 help=_("This rule sets the warn and crit levels for the number of unacknowlegded alerts"),
5775 elements=[
5776 Integer(
5777 title=_("Warning at"),
5778 unit=_("alerts"),
5779 default_value=1,
5781 Integer(
5782 title=_("Critical at"),
5783 unit=_("alerts"),
5784 default_value=2,
5786 ]), None, "first")
5788 register_check_parameters(
5789 RulespecGroupCheckParametersApplications, "jvm_threads", _("JVM threads"),
5790 Tuple(
5791 help=_("This rule sets the warn and crit levels for the number of threads "
5792 "running in a JVM."),
5793 elements=[
5794 Integer(
5795 title=_("Warning at"),
5796 unit=_("threads"),
5797 default_value=80,
5799 Integer(
5800 title=_("Critical at"),
5801 unit=_("threads"),
5802 default_value=100,
5805 TextAscii(
5806 title=_("Name of the virtual machine"),
5807 help=_("The name of the application server"),
5808 allow_empty=False,
5809 ), "first")
5811 register_check_parameters(
5812 RulespecGroupCheckParametersApplications,
5813 "sym_brightmail_queues",
5814 "Symantec Brightmail Queues",
5815 Dictionary(
5816 help=_("This check is used to monitor successful email delivery through "
5817 "Symantec Brightmail Scanner appliances."),
5818 elements=[
5819 ("connections",
5820 Tuple(
5821 title=_("Number of connections"),
5822 elements=[
5823 Integer(title=_("Warning at")),
5824 Integer(title=_("Critical at")),
5825 ])),
5826 ("messageRate",
5827 Tuple(
5828 title=_("Number of messages delivered"),
5829 elements=[
5830 Integer(title=_("Warning at")),
5831 Integer(title=_("Critical at")),
5832 ])),
5833 ("dataRate",
5834 Tuple(
5835 title=_("Amount of data processed"),
5836 elements=[
5837 Integer(title=_("Warning at")),
5838 Integer(title=_("Cricital at")),
5839 ])),
5840 ("queuedMessages",
5841 Tuple(
5842 title=_("Number of messages currently queued"),
5843 elements=[
5844 Integer(title=_("Warning at")),
5845 Integer(title=_("Critical at")),
5846 ])),
5847 ("queueSize",
5848 Tuple(
5849 title=_("Size of the queue"),
5850 elements=[
5851 Integer(title=_("Warning at")),
5852 Integer(title=_("Critical at")),
5853 ])),
5854 ("deferredMessages",
5855 Tuple(
5856 title=_("Number of messages in deferred state"),
5857 elements=[
5858 Integer(title=_("Warning at")),
5859 Integer(title=_("Critical at")),
5860 ])),
5863 TextAscii(title=_("Instance name"), allow_empty=True),
5864 "dict",
5867 register_check_parameters(
5868 RulespecGroupCheckParametersApplications, "db2_logsize", _("DB2 logfile usage"),
5869 Dictionary(elements=[(
5870 "levels",
5871 Transform(
5872 get_free_used_dynamic_valuespec("free", "logfile", default_value=(20.0, 10.0)),
5873 title=_("Logfile levels"),
5874 allow_empty=False,
5875 forth=transform_filesystem_free,
5876 back=transform_filesystem_free))]),
5877 TextAscii(
5878 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
5879 "dict")
5881 register_check_parameters(
5882 RulespecGroupCheckParametersApplications,
5883 "db2_sortoverflow",
5884 _("DB2 Sort Overflow"),
5885 Dictionary(
5886 help=_("This rule allows you to set percentual limits for sort overflows."),
5887 elements=[
5889 "levels_perc",
5890 Tuple(
5891 title=_("Overflows"),
5892 elements=[
5893 Percentage(title=_("Warning at"), unit=_("%"), default_value=2.0),
5894 Percentage(title=_("Critical at"), unit=_("%"), default_value=4.0),
5899 TextAscii(
5900 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
5901 "dict",
5904 register_check_parameters(
5905 RulespecGroupCheckParametersApplications, "db2_tablespaces", _("DB2 Tablespaces"),
5906 Dictionary(
5907 help=_("A tablespace is a container for segments (tables, indexes, etc). A "
5908 "database consists of one or more tablespaces, each made up of one or "
5909 "more data files. Tables and indexes are created within a particular "
5910 "tablespace. "
5911 "This rule allows you to define checks on the size of tablespaces."),
5912 elements=db_levels_common,
5914 TextAscii(
5915 title=_("Instance"),
5916 help=_("The instance name, the database name and the tablespace name combined "
5917 "like this db2wps8:WPSCOMT8.USERSPACE1")), "dict")
5919 register_check_parameters(
5920 RulespecGroupCheckParametersApplications, "db2_connections", _("DB2 Connections"),
5921 Dictionary(
5922 help=_("This rule allows you to set limits for the maximum number of DB2 connections"),
5923 elements=[
5925 "levels_total",
5926 Tuple(
5927 title=_("Number of current connections"),
5928 elements=[
5929 Integer(title=_("Warning at"), unit=_("connections"), default_value=150),
5930 Integer(title=_("Critical at"), unit=_("connections"), default_value=200),
5935 TextAscii(
5936 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
5937 "dict")
5939 register_check_parameters(
5940 RulespecGroupCheckParametersApplications,
5941 "db2_counters",
5942 _("DB2 Counters"),
5943 Dictionary(
5944 help=_("This rule allows you to configure limits for the deadlocks and lockwaits "
5945 "counters of a DB2."),
5946 elements=[
5948 "deadlocks",
5949 Tuple(
5950 title=_("Deadlocks"),
5951 elements=[
5952 Float(title=_("Warning at"), unit=_("deadlocks/sec")),
5953 Float(title=_("Critical at"), unit=_("deadlocks/sec")),
5958 "lockwaits",
5959 Tuple(
5960 title=_("Lockwaits"),
5961 elements=[
5962 Float(title=_("Warning at"), unit=_("lockwaits/sec")),
5963 Float(title=_("Critical at"), unit=_("lockwaits/sec")),
5968 TextAscii(
5969 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
5970 "dict",
5973 register_check_parameters(
5974 RulespecGroupCheckParametersApplications, "db2_backup",
5975 _("DB2 Time since last database Backup"),
5976 Optional(
5977 Tuple(elements=[
5978 Age(title=_("Warning at"),
5979 display=["days", "hours", "minutes"],
5980 default_value=86400 * 14),
5981 Age(title=_("Critical at"),
5982 display=["days", "hours", "minutes"],
5983 default_value=86400 * 28)
5985 title=_("Specify time since last successful backup"),
5987 TextAscii(
5988 title=_("Instance"),
5989 help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")), "first")
5991 register_check_parameters(
5992 RulespecGroupCheckParametersApplications, "db2_mem", _("Memory levels for DB2 memory usage"),
5993 Tuple(
5994 elements=[
5995 Percentage(title=_("Warning if less than"), unit=_("% memory left")),
5996 Percentage(title=_("Critical if less than"), unit=_("% memory left")),
5997 ],), TextAscii(title=_("Instance name"), allow_empty=True), "first")
5999 register_check_parameters(
6000 RulespecGroupCheckParametersApplications, "windows_updates", _("WSUS (Windows Updates)"),
6001 Tuple(
6002 title=_("Parameters for the Windows Update Check with WSUS"),
6003 help=_("Set the according numbers to 0 if you want to disable alerting."),
6004 elements=[
6005 Integer(title=_("Warning if at least this number of important updates are pending")),
6006 Integer(title=_("Critical if at least this number of important updates are pending")),
6007 Integer(title=_("Warning if at least this number of optional updates are pending")),
6008 Integer(title=_("Critical if at least this number of optional updates are pending")),
6009 Age(title=_("Warning if time until forced reboot is less then"), default_value=604800),
6010 Age(title=_("Critical if time time until forced reboot is less then"),
6011 default_value=172800),
6012 Checkbox(title=_("display all important updates verbosely"), default_value=True),
6014 ), None, "first")
6016 synology_update_states = [
6017 (1, "Available"),
6018 (2, "Unavailable"),
6019 (4, "Disconnected"),
6020 (5, "Others"),
6023 register_check_parameters(
6024 RulespecGroupCheckParametersApplications,
6025 "synology_update",
6026 _("Synology Updates"),
6027 Dictionary(
6028 title=_("Update State"),
6029 elements=[
6030 ("ok_states",
6031 ListChoice(
6032 title=_("States which result in OK"),
6033 choices=synology_update_states,
6034 default_value=[2])),
6035 ("warn_states",
6036 ListChoice(
6037 title=_("States which result in Warning"),
6038 choices=synology_update_states,
6039 default_value=[5])),
6040 ("crit_states",
6041 ListChoice(
6042 title=_("States which result in Critical"),
6043 choices=synology_update_states,
6044 default_value=[1, 4])),
6046 optional_keys=None,
6048 None,
6049 match_type="dict",
6052 register_check_parameters(
6053 RulespecGroupCheckParametersApplications, "antivir_update_age",
6054 _("Age of last AntiVirus update"),
6055 Tuple(
6056 title=_("Age of last AntiVirus update"),
6057 elements=[
6058 Age(title=_("Warning level for time since last update")),
6059 Age(title=_("Critical level for time since last update")),
6060 ]), None, "first")
6062 register_check_parameters(RulespecGroupCheckParametersApplications,
6063 "logwatch_ec",
6064 _('Logwatch Event Console Forwarding'),
6065 Alternative(
6066 title = _("Forwarding"),
6067 help = _("Instead of using the regular logwatch check all lines received by logwatch can "
6068 "be forwarded to a Check_MK event console daemon to be processed. The target event "
6069 "console can be configured for each host in a separate rule."),
6070 style = "dropdown",
6071 elements = [
6072 FixedValue(
6074 totext = _("Messages are handled by logwatch."),
6075 title = _("No forwarding"),
6077 Dictionary(
6078 title = _('Forward Messages to Event Console'),
6079 elements = [
6080 ('method', Transform(
6081 # TODO: Clean this up to some CascadingDropdown()
6082 Alternative(
6083 style = "dropdown",
6084 title = _("Forwarding Method"),
6085 elements = [
6086 FixedValue(
6088 title = _("Local: Send events to local Event Console in same OMD site"),
6089 totext = _("Directly forward to Event Console"),
6091 TextAscii(
6092 title = _("Local: Send events to local Event Console into unix socket"),
6093 allow_empty = False,
6096 FixedValue(
6097 "spool:",
6098 title = _("Local: Spooling - Send events to local event console in same OMD site"),
6099 totext = _("Spool to Event Console"),
6101 Transform(
6102 TextAscii(),
6103 title = _("Local: Spooling - Send events to local Event Console into given spool directory"),
6104 allow_empty = False,
6105 forth = lambda x: x[6:], # remove prefix
6106 back = lambda x: "spool:" + x, # add prefix
6108 CascadingDropdown(
6109 title = _("Remote: Send events to remote syslog host"),
6110 choices = [
6111 ("tcp", _("Send via TCP"), Dictionary(
6112 elements = [
6113 ("address", TextAscii(
6114 title = _("Address"),
6115 allow_empty = False,
6117 ("port", Integer(
6118 title = _("Port"),
6119 allow_empty = False,
6120 default_value = 514,
6121 minvalue = 1,
6122 maxvalue = 65535,
6123 size = 6,
6125 ("spool", Dictionary(
6126 title = _("Spool messages that could not be sent"),
6127 help = _("Messages that can not be forwarded, e.g. when the target Event Console is "
6128 "not running, can temporarily be stored locally. Forwarding is tried again "
6129 "on next execution. When messages are spooled, the check will go into WARNING "
6130 "state. In case messages are dropped by the rules below, the check will shortly "
6131 "go into CRITICAL state for this execution."),
6132 elements = [
6133 ("max_age", Age(
6134 title = _("Maximum spool duration"),
6135 help = _("Messages that are spooled longer than this time will be thrown away."),
6136 default_value = 60*60*24*7, # 1 week should be fine (if size is not exceeded)
6138 ("max_size", Filesize(
6139 title = _("Maximum spool size"),
6140 help = _("When the total size of spooled messages exceeds this number, the oldest "
6141 "messages of the currently spooled messages is thrown away until the left "
6142 "messages have the half of the maximum size."),
6143 default_value = 500000, # do not save more than 500k of message
6146 optional_keys = [],
6149 optional_keys = [ "spool" ],
6151 ("udp", _("Send via UDP"), Dictionary(
6152 elements = [
6153 ("address", TextAscii(
6154 title = _("Address"),
6155 allow_empty = False,
6157 ("port", Integer(
6158 title = _("Port"),
6159 allow_empty = False,
6160 default_value = 514,
6161 minvalue = 1,
6162 maxvalue = 65535,
6163 size = 6,
6166 optional_keys = [],
6171 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)))
6173 # migrate old (tcp, address, port) tuple to new dict
6174 forth = lambda v: (v[0], {"address": v[1], "port": v[2]}) if (isinstance(v, tuple) and not isinstance(v[1], dict)) else v,
6176 ('facility', DropdownChoice(
6177 title = _("Syslog facility for forwarded messages"),
6178 help = _("When forwarding messages and no facility can be extracted from the "
6179 "message this facility is used."),
6180 choices = mkeventd.syslog_facilities,
6181 default_value = 17, # local1
6183 ('restrict_logfiles',
6184 ListOfStrings(
6185 title = _('Restrict Logfiles (Prefix matching regular expressions)'),
6186 help = _("Put the item names of the logfiles here. For example \"System$\" "
6187 "to select the service \"LOG System\". You can use regular expressions "
6188 "which must match the beginning of the logfile name."),
6191 ('monitor_logfilelist',
6192 Checkbox(
6193 title = _("Monitoring of forwarded logfiles"),
6194 label = _("Warn if list of forwarded logfiles changes"),
6195 help = _("If this option is enabled, the check monitors the list of forwarded "
6196 "logfiles and will warn you if at any time a logfile is missing or exceeding "
6197 "when compared to the initial list that was snapshotted during service detection. "
6198 "Reinventorize this check in order to make it OK again."),
6201 ('expected_logfiles',
6202 ListOfStrings(
6203 title = _("List of expected logfiles"),
6204 help = _("When the monitoring of forwarded logfiles is enabled, the check verifies that "
6205 "all of the logfiles listed here are reported by the monitored system."),
6208 ('logwatch_reclassify',
6209 Checkbox(
6210 title = _("Reclassify messages before forwarding them to the EC"),
6211 label = _("Apply logwatch patterns"),
6212 help = _("If this option is enabled, the logwatch lines are first reclassified by the logwatch "
6213 "patterns before they are sent to the event console. If you reclassify specific lines to "
6214 "IGNORE they are not forwarded to the event console. This takes the burden from the "
6215 "event console to process the message itself through all of its rulesets. The reclassifcation "
6216 "of each line takes into account from which logfile the message originates. So you can create "
6217 "logwatch reclassification rules specifically designed for a logfile <i>access.log</i>, "
6218 "which do not apply to other logfiles."),
6221 ('separate_checks',
6222 Checkbox(
6223 title = _("Create a separate check for each logfile"),
6224 label = _("Separate check"),
6225 help = _("If this option is enabled, there will be one separate check for each logfile found during "
6226 "the service discovery. This option also changes the behaviour for unknown logfiles. "
6227 "The default logwatch check forwards all logfiles to the event console, even logfiles "
6228 "which were not known during the service discovery. Creating one check per logfile changes "
6229 "this behaviour so that any data from unknown logfiles is discarded."),
6233 optional_keys = ['restrict_logfiles', 'expected_logfiles', 'logwatch_reclassify', 'separate_checks'],
6236 default_value = '',
6238 None,
6239 'first',
6242 register_rule(
6243 RulespecGroupCheckParametersApplications,
6244 varname="logwatch_groups",
6245 title=_('Logfile Grouping Patterns'),
6246 help=_('The check <tt>logwatch</tt> normally creates one service for each logfile. '
6247 'By defining grouping patterns you can switch to the check <tt>logwatch.groups</tt>. '
6248 'If the pattern begins with a tilde then this pattern is interpreted as a regular '
6249 'expression instead of as a filename globbing pattern and <tt>*</tt> and <tt>?</tt> '
6250 'are treated differently. '
6251 'That check monitors a list of logfiles at once. This is useful if you have '
6252 'e.g. a folder with rotated logfiles where the name of the current logfile'
6253 'also changes with each rotation'),
6254 valuespec=ListOf(
6255 Tuple(
6256 help=_("This defines one logfile grouping pattern"),
6257 show_titles=True,
6258 orientation="horizontal",
6259 elements=[
6260 TextAscii(title=_("Name of group"),),
6261 Tuple(
6262 show_titles=True,
6263 orientation="vertical",
6264 elements=[
6265 TextAscii(title=_("Include Pattern")),
6266 TextAscii(title=_("Exclude Pattern"))
6271 add_label=_("Add pattern group"),
6273 match='all',
6276 register_rule(
6277 RulespecGroupCheckParametersNetworking,
6278 "if_disable_if64_hosts",
6279 title=_("Hosts forced to use <tt>if</tt> instead of <tt>if64</tt>"),
6280 help=_("A couple of switches with broken firmware report that they "
6281 "support 64 bit counters but do not output any actual data "
6282 "in those counters. Listing those hosts in this rule forces "
6283 "them to use the interface check with 32 bit counters instead."))
6285 # wmic_process does not support inventory at the moment
6286 register_check_parameters(
6287 RulespecGroupCheckParametersApplications, "wmic_process",
6288 _("Memory and CPU of processes on Windows"),
6289 Tuple(
6290 elements=[
6291 TextAscii(
6292 title=_("Name of the process"),
6293 allow_empty=False,
6295 Integer(title=_("Memory warning at"), unit="MB"),
6296 Integer(title=_("Memory critical at"), unit="MB"),
6297 Integer(title=_("Pagefile warning at"), unit="MB"),
6298 Integer(title=_("Pagefile critical at"), unit="MB"),
6299 Percentage(title=_("CPU usage warning at")),
6300 Percentage(title=_("CPU usage critical at")),
6301 ],),
6302 TextAscii(
6303 title=_("Process name for usage in the Nagios service description"), allow_empty=False),
6304 "first", False)
6306 register_check_parameters(
6307 RulespecGroupCheckParametersOperatingSystem,
6308 "zypper",
6309 _("Zypper Updates"),
6310 None,
6311 None,
6312 match_type="first",
6315 register_check_parameters(
6316 RulespecGroupCheckParametersOperatingSystem,
6317 "apt",
6318 _("APT Updates"),
6319 Dictionary(elements=[
6320 ("normal",
6321 MonitoringState(
6322 title=_("State when normal updates are pending"),
6323 default_value=1,
6325 ("security",
6326 MonitoringState(
6327 title=_("State when security updates are pending"),
6328 default_value=2,
6331 None,
6332 match_type="dict",
6335 register_check_parameters(
6336 RulespecGroupCheckParametersEnvironment, "airflow_deviation", _("Airflow Deviation in Percent"),
6337 Tuple(
6338 help=_("Levels for Airflow Deviation measured at airflow sensors "),
6339 elements=[
6340 Float(title=_("critical if below or equal"), unit=u"%", default_value=-20),
6341 Float(title=_("warning if below or equal"), unit=u"%", default_value=-20),
6342 Float(title=_("warning if above or equal"), unit=u"%", default_value=20),
6343 Float(title=_("critical if above or equal"), unit=u"%", default_value=20),
6344 ]), TextAscii(title=_("Detector ID"), help=_("The identifier of the detector.")), "first")
6346 register_check_parameters(
6347 RulespecGroupCheckParametersApplications,
6348 "citrix_load",
6349 _("Load of Citrix Server"),
6350 Transform(
6351 Tuple(
6352 title=_("Citrix Server load"),
6353 elements=[
6354 Percentage(title=_("Warning at"), default_value=85.0, unit="percent"),
6355 Percentage(title=_("Critical at"), default_value=95.0, unit="percent"),
6357 forth=lambda x: (x[0] / 100.0, x[1] / 100.0),
6358 back=lambda x: (int(x[0] * 100), int(x[1] * 100))),
6359 None,
6360 match_type="first",
6363 register_check_parameters(
6364 RulespecGroupCheckParametersNetworking, "adva_ifs", _("Adva Optical Transport Laser Power"),
6365 Dictionary(elements=[
6366 ("limits_output_power",
6367 Tuple(
6368 title=_("Sending Power"),
6369 elements=[
6370 Float(title=_("lower limit"), unit="dBm"),
6371 Float(title=_("upper limit"), unit="dBm"),
6372 ])),
6373 ("limits_input_power",
6374 Tuple(
6375 title=_("Received Power"),
6376 elements=[
6377 Float(title=_("lower limit"), unit="dBm"),
6378 Float(title=_("upper limit"), unit="dBm"),
6379 ])),
6380 ]), TextAscii(
6381 title=_("Interface"),
6382 allow_empty=False,
6383 ), "dict")
6385 bluecat_operstates = [
6386 (1, "running normally"),
6387 (2, "not running"),
6388 (3, "currently starting"),
6389 (4, "currently stopping"),
6390 (5, "fault"),
6393 register_check_parameters(
6394 RulespecGroupCheckParametersNetworking,
6395 "bluecat_ntp",
6396 _("Bluecat NTP Settings"),
6397 Dictionary(elements=[
6398 ("oper_states",
6399 Dictionary(
6400 title=_("Operations States"),
6401 elements=[
6402 ("warning",
6403 ListChoice(
6404 title=_("States treated as warning"),
6405 choices=bluecat_operstates,
6406 default_value=[2, 3, 4],
6408 ("critical",
6409 ListChoice(
6410 title=_("States treated as critical"),
6411 choices=bluecat_operstates,
6412 default_value=[5],
6415 required_keys=['warning', 'critical'],
6417 ("stratum",
6418 Tuple(
6419 title=_("Levels for Stratum "),
6420 elements=[
6421 Integer(title=_("Warning at")),
6422 Integer(title=_("Critical at")),
6423 ])),
6425 None,
6426 match_type="dict",
6429 register_check_parameters(
6430 RulespecGroupCheckParametersNetworking,
6431 "bluecat_dhcp",
6432 _("Bluecat DHCP Settings"),
6433 Dictionary(
6434 elements=[
6435 ("oper_states",
6436 Dictionary(
6437 title=_("Operations States"),
6438 elements=[
6439 ("warning",
6440 ListChoice(
6441 title=_("States treated as warning"),
6442 choices=bluecat_operstates,
6443 default_value=[2, 3, 4],
6445 ("critical",
6446 ListChoice(
6447 title=_("States treated as critical"),
6448 choices=bluecat_operstates,
6449 default_value=[5],
6452 required_keys=['warning', 'critical'],
6455 required_keys=['oper_states'], # There is only one value, so its required
6457 None,
6458 match_type="dict",
6461 register_check_parameters(
6462 RulespecGroupCheckParametersNetworking,
6463 "bluecat_command_server",
6464 _("Bluecat Command Server Settings"),
6465 Dictionary(
6466 elements=[
6467 ("oper_states",
6468 Dictionary(
6469 title=_("Operations States"),
6470 elements=[
6471 ("warning",
6472 ListChoice(
6473 title=_("States treated as warning"),
6474 choices=bluecat_operstates,
6475 default_value=[2, 3, 4],
6477 ("critical",
6478 ListChoice(
6479 title=_("States treated as critical"),
6480 choices=bluecat_operstates,
6481 default_value=[5],
6484 required_keys=['warning', 'critical'],
6487 required_keys=['oper_states'], # There is only one value, so its required
6489 None,
6490 match_type="dict",
6493 register_check_parameters(
6494 RulespecGroupCheckParametersNetworking,
6495 "bluecat_dns",
6496 _("Bluecat DNS Settings"),
6497 Dictionary(
6498 elements=[
6499 ("oper_states",
6500 Dictionary(
6501 title=_("Operations States"),
6502 elements=[
6503 ("warning",
6504 ListChoice(
6505 title=_("States treated as warning"),
6506 choices=bluecat_operstates,
6507 default_value=[2, 3, 4],
6509 ("critical",
6510 ListChoice(
6511 title=_("States treated as critical"),
6512 choices=bluecat_operstates,
6513 default_value=[5],
6516 required_keys=['warning', 'critical'],
6519 required_keys=['oper_states'], # There is only one value, so its required
6521 None,
6522 match_type="dict",
6525 bluecat_ha_operstates = [
6526 (1, "standalone"),
6527 (2, "active"),
6528 (3, "passiv"),
6529 (4, "stopped"),
6530 (5, "stopping"),
6531 (6, "becoming active"),
6532 (7, "becomming passive"),
6533 (8, "fault"),
6536 register_check_parameters(
6537 RulespecGroupCheckParametersNetworking,
6538 "bluecat_ha",
6539 _("Bluecat HA Settings"),
6540 Dictionary(
6541 elements=[
6542 ("oper_states",
6543 Dictionary(
6544 title=_("Operations States"),
6545 elements=[
6547 "warning",
6548 ListChoice(
6549 title=_("States treated as warning"),
6550 choices=bluecat_ha_operstates,
6551 default_value=[5, 6, 7],
6555 "critical",
6556 ListChoice(
6557 title=_("States treated as critical"),
6558 choices=bluecat_ha_operstates,
6559 default_value=[8, 4],
6563 required_keys=['warning', 'critical'],
6566 required_keys=['oper_states'], # There is only one value, so its required
6568 None,
6569 match_type="dict",
6572 register_check_parameters(
6573 RulespecGroupCheckParametersNetworking,
6574 "steelhead_connections",
6575 _("Steelhead connections"),
6576 Dictionary(
6577 elements=[
6578 ("total",
6579 Tuple(
6580 title=_("Levels for total amount of connections"),
6581 elements=[
6582 Integer(title=_("Warning at")),
6583 Integer(title=_("Critical at")),
6586 ("optimized",
6587 Tuple(
6588 title=_("Levels for optimized connections"),
6589 elements=[
6590 Integer(title=_("Warning at")),
6591 Integer(title=_("Critical at")),
6594 ("passthrough",
6595 Tuple(
6596 title=_("Levels for passthrough connections"),
6597 elements=[
6598 Integer(title=_("Warning at")),
6599 Integer(title=_("Critical at")),
6602 ("halfOpened",
6603 Tuple(
6604 title=_("Levels for half opened connections"),
6605 elements=[
6606 Integer(title=_("Warning at")),
6607 Integer(title=_("Critical at")),
6610 ("halfClosed",
6611 Tuple(
6612 title=_("Levels for half closed connections"),
6613 elements=[
6614 Integer(title=_("Warning at")),
6615 Integer(title=_("Critical at")),
6618 ("established",
6619 Tuple(
6620 title=_("Levels for established connections"),
6621 elements=[
6622 Integer(title=_("Warning at")),
6623 Integer(title=_("Critical at")),
6626 ("active",
6627 Tuple(
6628 title=_("Levels for active connections"),
6629 elements=[
6630 Integer(title=_("Warning at")),
6631 Integer(title=_("Critical at")),
6634 ],),
6635 None,
6636 "dict",
6639 register_check_parameters(
6640 RulespecGroupCheckParametersStorage,
6641 "fc_port",
6642 _("FibreChannel Ports (FCMGMT MIB)"),
6643 Dictionary(elements=[
6644 ("bw",
6645 Alternative(
6646 title=_("Throughput levels"),
6647 help=_("Please note: in a few cases the automatic detection of the link speed "
6648 "does not work. In these cases you have to set the link speed manually "
6649 "below if you want to monitor percentage values"),
6650 elements=[
6651 Tuple(
6652 title=_("Used bandwidth of port relative to the link speed"),
6653 elements=[
6654 Percentage(title=_("Warning at"), unit=_("percent")),
6655 Percentage(title=_("Critical at"), unit=_("percent")),
6657 Tuple(
6658 title=_("Used Bandwidth of port in megabyte/s"),
6659 elements=[
6660 Integer(title=_("Warning at"), unit=_("MByte/s")),
6661 Integer(title=_("Critical at"), unit=_("MByte/s")),
6663 ])),
6664 ("assumed_speed",
6665 Float(
6666 title=_("Assumed link speed"),
6667 help=_("If the automatic detection of the link speed does "
6668 "not work you can set the link speed here."),
6669 unit=_("Gbit/s"))),
6670 ("rxcrcs",
6671 Tuple(
6672 title=_("CRC errors rate"),
6673 elements=[
6674 Percentage(title=_("Warning at"), unit=_("percent")),
6675 Percentage(title=_("Critical at"), unit=_("percent")),
6676 ])),
6677 ("rxencoutframes",
6678 Tuple(
6679 title=_("Enc-Out frames rate"),
6680 elements=[
6681 Percentage(title=_("Warning at"), unit=_("percent")),
6682 Percentage(title=_("Critical at"), unit=_("percent")),
6683 ])),
6684 ("notxcredits",
6685 Tuple(
6686 title=_("No-TxCredits errors"),
6687 elements=[
6688 Percentage(title=_("Warning at"), unit=_("percent")),
6689 Percentage(title=_("Critical at"), unit=_("percent")),
6690 ])),
6691 ("c3discards",
6692 Tuple(
6693 title=_("C3 discards"),
6694 elements=[
6695 Percentage(title=_("Warning at"), unit=_("percent")),
6696 Percentage(title=_("Critical at"), unit=_("percent")),
6697 ])),
6698 ("average",
6699 Integer(
6700 title=_("Averaging"),
6701 help=_("If this parameter is set, all throughputs will be averaged "
6702 "over the specified time interval before levels are being applied. Per "
6703 "default, averaging is turned off. "),
6704 unit=_("minutes"),
6705 minvalue=1,
6706 default_value=5,
6708 # ("phystate",
6709 # Optional(
6710 # ListChoice(
6711 # title = _("Allowed states (otherwise check will be critical)"),
6712 # choices = [ (1, _("unknown") ),
6713 # (2, _("failed") ),
6714 # (3, _("bypassed") ),
6715 # (4, _("active") ),
6716 # (5, _("loopback") ),
6717 # (6, _("txfault") ),
6718 # (7, _("nomedia") ),
6719 # (8, _("linkdown") ),
6721 # ),
6722 # title = _("Physical state of port") ,
6723 # negate = True,
6724 # label = _("ignore physical state"),
6726 # ),
6727 # ("opstate",
6728 # Optional(
6729 # ListChoice(
6730 # title = _("Allowed states (otherwise check will be critical)"),
6731 # choices = [ (1, _("unknown") ),
6732 # (2, _("unused") ),
6733 # (3, _("ready") ),
6734 # (4, _("warning") ),
6735 # (5, _("failure") ),
6736 # (6, _("not participating") ),
6737 # (7, _("initializing") ),
6738 # (8, _("bypass") ),
6739 # (9, _("ols") ),
6741 # ),
6742 # title = _("Operational state") ,
6743 # negate = True,
6744 # label = _("ignore operational state"),
6746 # ),
6747 # ("admstate",
6748 # Optional(
6749 # ListChoice(
6750 # title = _("Allowed states (otherwise check will be critical)"),
6751 # choices = [ (1, _("unknown") ),
6752 # (2, _("online") ),
6753 # (3, _("offline") ),
6754 # (4, _("bypassed") ),
6755 # (5, _("diagnostics") ),
6757 # ),
6758 # title = _("Administrative state") ,
6759 # negate = True,
6760 # label = _("ignore administrative state"),
6764 TextAscii(
6765 title=_("port name"),
6766 help=_("The name of the FC port"),
6768 match_type="dict",
6771 register_check_parameters(
6772 RulespecGroupCheckParametersEnvironment, "plug_count", _("Number of active Plugs"),
6773 Tuple(
6774 help=_("Levels for the number of active plugs in a device."),
6775 elements=[
6776 Integer(title=_("critical if below or equal"), default_value=30),
6777 Integer(title=_("warning if below or equal"), default_value=32),
6778 Integer(title=_("warning if above or equal"), default_value=38),
6779 Integer(title=_("critical if above or equal"), default_value=40),
6780 ]), None, "first")
6782 # Rules for configuring parameters of checks (services)
6783 register_check_parameters(
6784 RulespecGroupCheckParametersEnvironment, "ucs_bladecenter_chassis_voltage",
6785 _("UCS Bladecenter Chassis Voltage Levels"),
6786 Dictionary(
6787 help=_("Here you can configure the 3.3V and 12V voltage levels for each chassis."),
6788 elements=[
6789 ("levels_3v_lower",
6790 Tuple(
6791 title=_("3.3 Volt Output Lower Levels"),
6792 elements=[
6793 Float(title=_("warning if below or equal"), unit="V", default_value=3.25),
6794 Float(title=_("critical if below or equal"), unit="V", default_value=3.20),
6795 ])),
6796 ("levels_3v_upper",
6797 Tuple(
6798 title=_("3.3 Volt Output Upper Levels"),
6799 elements=[
6800 Float(title=_("warning if above or equal"), unit="V", default_value=3.4),
6801 Float(title=_("critical if above or equal"), unit="V", default_value=3.45),
6802 ])),
6803 ("levels_12v_lower",
6804 Tuple(
6805 title=_("12 Volt Output Lower Levels"),
6806 elements=[
6807 Float(title=_("warning if below or equal"), unit="V", default_value=11.9),
6808 Float(title=_("critical if below or equal"), unit="V", default_value=11.8),
6809 ])),
6810 ("levels_12v_upper",
6811 Tuple(
6812 title=_("12 Volt Output Upper Levels"),
6813 elements=[
6814 Float(title=_("warning if above or equal"), unit="V", default_value=12.1),
6815 Float(title=_("critical if above or equal"), unit="V", default_value=12.2),
6817 ]), TextAscii(title=_("Chassis"), help=_("The identifier of the chassis.")), "dict")
6819 register_check_parameters(
6820 RulespecGroupCheckParametersEnvironment, "hp_msa_psu_voltage",
6821 _("HP MSA Power Supply Voltage Levels"),
6822 Dictionary(
6823 help=_("Here you can configure the 3.3V and 12V voltage levels for each power supply."),
6824 elements=[
6825 ("levels_33v_lower",
6826 Tuple(
6827 title=_("3.3 Volt Output Lower Levels"),
6828 elements=[
6829 Float(title=_("warning if below or equal"), unit="V", default_value=3.25),
6830 Float(title=_("critical if below or equal"), unit="V", default_value=3.20),
6831 ])),
6832 ("levels_33v_upper",
6833 Tuple(
6834 title=_("3.3 Volt Output Upper Levels"),
6835 elements=[
6836 Float(title=_("warning if above or equal"), unit="V", default_value=3.4),
6837 Float(title=_("critical if above or equal"), unit="V", default_value=3.45),
6838 ])),
6839 ("levels_5v_lower",
6840 Tuple(
6841 title=_("5 Volt Output Lower Levels"),
6842 elements=[
6843 Float(title=_("warning if below or equal"), unit="V", default_value=3.25),
6844 Float(title=_("critical if below or equal"), unit="V", default_value=3.20),
6845 ])),
6846 ("levels_5v_upper",
6847 Tuple(
6848 title=_("5 Volt Output Upper Levels"),
6849 elements=[
6850 Float(title=_("warning if above or equal"), unit="V", default_value=3.4),
6851 Float(title=_("critical if above or equal"), unit="V", default_value=3.45),
6852 ])),
6853 ("levels_12v_lower",
6854 Tuple(
6855 title=_("12 Volt Output Lower Levels"),
6856 elements=[
6857 Float(title=_("warning if below or equal"), unit="V", default_value=11.9),
6858 Float(title=_("critical if below or equal"), unit="V", default_value=11.8),
6859 ])),
6860 ("levels_12v_upper",
6861 Tuple(
6862 title=_("12 Volt Output Upper Levels"),
6863 elements=[
6864 Float(title=_("warning if above or equal"), unit="V", default_value=12.1),
6865 Float(title=_("critical if above or equal"), unit="V", default_value=12.2),
6867 ]), TextAscii(title=_("Power Supply name"), help=_("The identifier of the power supply.")),
6868 "dict")
6870 register_check_parameters(
6871 RulespecGroupCheckParametersApplications, "jvm_gc", _("JVM garbage collection levels"),
6872 Dictionary(
6873 help=_("This ruleset also covers Tomcat, Jolokia and JMX. "),
6874 elements=[
6875 ("CollectionTime",
6876 Alternative(
6877 title=_("Collection time levels"),
6878 elements=[
6879 Tuple(
6880 title=_("Time of garbage collection in ms per minute"),
6881 elements=[
6882 Integer(title=_("Warning at"), unit=_("ms"), allow_empty=False),
6883 Integer(title=_("Critical at"), unit=_("ms"), allow_empty=False),
6885 ])),
6886 ("CollectionCount",
6887 Alternative(
6888 title=_("Collection count levels"),
6889 elements=[
6890 Tuple(
6891 title=_("Count of garbage collection per minute"),
6892 elements=[
6893 Integer(title=_("Warning at"), allow_empty=False),
6894 Integer(title=_("Critical at"), allow_empty=False),
6896 ])),
6898 TextAscii(
6899 title=_("Name of the virtual machine and/or<br>garbage collection type"),
6900 help=_("The name of the application server"),
6901 allow_empty=False,
6902 ), "dict")
6904 register_check_parameters(
6905 RulespecGroupCheckParametersApplications, "jvm_tp", _("JVM tomcat threadpool levels"),
6906 Dictionary(
6907 help=_("This ruleset also covers Tomcat, Jolokia and JMX. "),
6908 elements=[
6909 ("currentThreadCount",
6910 Alternative(
6911 title=_("Current thread count levels"),
6912 elements=[
6913 Tuple(
6914 title=_("Percentage levels of current thread count in threadpool"),
6915 elements=[
6916 Integer(title=_("Warning at"), unit=_(u"%"), allow_empty=False),
6917 Integer(title=_("Critical at"), unit=_(u"%"), allow_empty=False),
6919 ])),
6920 ("currentThreadsBusy",
6921 Alternative(
6922 title=_("Current threads busy levels"),
6923 elements=[
6924 Tuple(
6925 title=_("Percentage of current threads busy in threadpool"),
6926 elements=[
6927 Integer(title=_("Warning at"), unit=_(u"%"), allow_empty=False),
6928 Integer(title=_("Critical at"), unit=_(u"%"), allow_empty=False),
6930 ])),
6932 TextAscii(
6933 title=_("Name of the virtual machine and/or<br>threadpool"),
6934 help=_("The name of the application server"),
6935 allow_empty=False,
6936 ), "dict")
6938 register_check_parameters(
6939 RulespecGroupCheckParametersApplications, "docker_node_containers",
6940 _("Docker node container levels"),
6941 Dictionary(
6942 help=_(
6943 "Allows to define absolute levels for all, running, paused, and stopped containers."),
6944 elements=[
6945 ("upper_levels",
6946 Tuple(
6947 title=_("Containers upper levels"),
6948 elements=[
6949 Integer(title=_("Warning at"), allow_empty=False),
6950 Integer(title=_("Critical at"), allow_empty=False),
6951 ])),
6952 ("lower_levels",
6953 Tuple(
6954 title=_("Containers lower levels"),
6955 elements=[
6956 Integer(title=_("Warning at"), allow_empty=False),
6957 Integer(title=_("Critical at"), allow_empty=False),
6958 ])),
6959 ("running_upper_levels",
6960 Tuple(
6961 title=_("Running containers upper levels"),
6962 elements=[
6963 Integer(title=_("Warning at"), allow_empty=False),
6964 Integer(title=_("Critical at"), allow_empty=False),
6965 ])),
6966 ("running_lower_levels",
6967 Tuple(
6968 title=_("Running containers lower levels"),
6969 elements=[
6970 Integer(title=_("Warning at"), allow_empty=False),
6971 Integer(title=_("Critical at"), allow_empty=False),
6972 ])),
6973 ("paused_upper_levels",
6974 Tuple(
6975 title=_("Paused containers upper levels"),
6976 elements=[
6977 Integer(title=_("Warning at"), allow_empty=False),
6978 Integer(title=_("Critical at"), allow_empty=False),
6979 ])),
6980 ("paused_lower_levels",
6981 Tuple(
6982 title=_("Paused containers lower levels"),
6983 elements=[
6984 Integer(title=_("Warning at"), allow_empty=False),
6985 Integer(title=_("Critical at"), allow_empty=False),
6986 ])),
6987 ("stopped_upper_levels",
6988 Tuple(
6989 title=_("Stopped containers upper levels"),
6990 elements=[
6991 Integer(title=_("Warning at"), allow_empty=False),
6992 Integer(title=_("Critical at"), allow_empty=False),
6993 ])),
6994 ("stopped_lower_levels",
6995 Tuple(
6996 title=_("Stopped containers lower levels"),
6997 elements=[
6998 Integer(title=_("Warning at"), allow_empty=False),
6999 Integer(title=_("Critical at"), allow_empty=False),
7000 ])),
7001 ]), None, "dict")
7003 register_check_parameters(
7004 RulespecGroupCheckParametersApplications, "docker_node_disk_usage", _("Docker node disk usage"),
7005 Dictionary(
7006 help=
7007 _("Allows to define levels for the counts and size of Docker Containers, Images, Local Volumes, and the Build Cache."
7009 elements=[
7010 ("size",
7011 Tuple(
7012 title=_("Size"),
7013 elements=[
7014 Filesize(title=_("Warning at"), allow_empty=False),
7015 Filesize(title=_("Critical at"), allow_empty=False),
7016 ])),
7017 ("reclaimable",
7018 Tuple(
7019 title=_("Reclaimable"),
7020 elements=[
7021 Filesize(title=_("Warning at"), allow_empty=False),
7022 Filesize(title=_("Critical at"), allow_empty=False),
7023 ])),
7024 ("count",
7025 Tuple(
7026 title=_("Total count"),
7027 elements=[
7028 Integer(title=_("Warning at"), allow_empty=False),
7029 Integer(title=_("Critical at"), allow_empty=False),
7030 ])),
7031 ("active",
7032 Tuple(
7033 title=_("Active"),
7034 elements=[
7035 Integer(title=_("Warning at"), allow_empty=False),
7036 Integer(title=_("Critical at"), allow_empty=False),
7037 ])),
7039 TextAscii(
7040 title=_("Type"),
7041 help=_("Either Containers, Images, Local Volumes or Build Cache"),
7042 allow_empty=True,
7043 ), "dict")
7045 register_check_parameters(
7046 RulespecGroupCheckParametersStorage,
7047 "heartbeat_crm",
7048 _("Heartbeat CRM general status"),
7049 Tuple(elements=[
7050 Integer(
7051 title=_("Maximum age"),
7052 help=_("Maximum accepted age of the reported data in seconds"),
7053 unit=_("seconds"),
7054 default_value=60,
7056 Optional(
7057 TextAscii(allow_empty=False),
7058 title=_("Expected DC"),
7059 help=_("The hostname of the expected distinguished controller of the cluster"),
7061 Optional(
7062 Integer(min_value=2, default_value=2),
7063 title=_("Number of Nodes"),
7064 help=_("The expected number of nodes in the cluster"),
7066 Optional(
7067 Integer(min_value=0,),
7068 title=_("Number of Resources"),
7069 help=_("The expected number of resources in the cluster"),
7072 None,
7073 match_type="first",
7076 register_check_parameters(
7077 RulespecGroupCheckParametersStorage, "heartbeat_crm_resources",
7078 _("Heartbeat CRM resource status"),
7079 Optional(
7080 TextAscii(allow_empty=False),
7081 title=_("Expected node"),
7082 help=_("The hostname of the expected node to hold this resource."),
7083 none_label=_("Do not enforce the resource to be hold by a specific node."),
7085 TextAscii(
7086 title=_("Resource Name"),
7087 help=_("The name of the cluster resource as shown in the service description."),
7088 allow_empty=False,
7089 ), "first")
7091 register_check_parameters(
7092 RulespecGroupCheckParametersApplications,
7093 "domino_tasks",
7094 _("Lotus Domino Tasks"),
7095 Dictionary(
7096 elements=[
7098 "process",
7099 Alternative(
7100 title=_("Name of the task"),
7101 style="dropdown",
7102 elements=[
7103 TextAscii(
7104 title=_("Exact name of the task"),
7105 size=50,
7107 Transform(
7108 RegExp(
7109 size=50,
7110 mode=RegExp.prefix,
7112 title=_("Regular expression matching tasks"),
7113 help=_("This regex must match the <i>beginning</i> of the complete "
7114 "command line of the task including arguments"),
7115 forth=lambda x: x[1:], # remove ~
7116 back=lambda x: "~" + x, # prefix ~
7118 FixedValue(
7119 None,
7120 totext="",
7121 title=_("Match all tasks"),
7124 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0))),
7125 ("warnmin",
7126 Integer(
7127 title=_("Minimum number of matched tasks for WARNING state"),
7128 default_value=1,
7130 ("okmin",
7131 Integer(
7132 title=_("Minimum number of matched tasks for OK state"),
7133 default_value=1,
7135 ("okmax",
7136 Integer(
7137 title=_("Maximum number of matched tasks for OK state"),
7138 default_value=99999,
7140 ("warnmax",
7141 Integer(
7142 title=_("Maximum number of matched tasks for WARNING state"),
7143 default_value=99999,
7146 required_keys=['warnmin', 'okmin', 'okmax', 'warnmax', 'process'],
7148 TextAscii(
7149 title=_("Name of service"),
7150 help=_("This name will be used in the description of the service"),
7151 allow_empty=False,
7152 regex="^[a-zA-Z_0-9 _.-]*$",
7153 regex_error=_("Please use only a-z, A-Z, 0-9, space, underscore, "
7154 "dot and hyphen for your service description"),
7156 match_type="dict",
7157 has_inventory=False)
7159 register_check_parameters(
7160 RulespecGroupCheckParametersApplications,
7161 "domino_mailqueues",
7162 _("Lotus Domino Mail Queues"),
7163 Dictionary(
7164 elements=[
7165 ("queue_length",
7166 Tuple(
7167 title=_("Number of Mails in Queue"),
7168 elements=[
7169 Integer(title=_("warning at"), default_value=300),
7170 Integer(title=_("critical at"), default_value=350),
7171 ])),
7173 required_keys=['queue_length'],
7175 DropdownChoice(
7176 choices=[
7177 ('lnDeadMail', _('Mails in Dead Queue')),
7178 ('lnWaitingMail', _('Mails in Waiting Queue')),
7179 ('lnMailHold', _('Mails in Hold Queue')),
7180 ('lnMailTotalPending', _('Total Pending Mails')),
7181 ('InMailWaitingforDNS', _('Mails Waiting for DNS Queue')),
7183 title=_("Domino Mail Queue Names"),
7185 match_type="dict",
7188 register_check_parameters(
7189 RulespecGroupCheckParametersApplications,
7190 "domino_users",
7191 _("Lotus Domino Users"),
7192 Tuple(
7193 title=_("Number of Lotus Domino Users"),
7194 elements=[
7195 Integer(title=_("warning at"), default_value=1000),
7196 Integer(title=_("critical at"), default_value=1500),
7198 None,
7199 match_type="first",
7202 register_check_parameters(
7203 RulespecGroupCheckParametersApplications,
7204 "domino_transactions",
7205 _("Lotus Domino Transactions"),
7206 Tuple(
7207 title=_("Number of Transactions per Minute on a Lotus Domino Server"),
7208 elements=[
7209 Integer(title=_("warning at"), default_value=30000),
7210 Integer(title=_("critical at"), default_value=35000),
7212 None,
7213 match_type="first",
7216 register_check_parameters(
7217 RulespecGroupCheckParametersApplications, "netscaler_dnsrates",
7218 _("Citrix Netscaler DNS counter rates"),
7219 Dictionary(
7220 help=_("Counter rates of DNS parameters for Citrix Netscaler Loadbalancer "
7221 "Appliances"),
7222 elements=[
7224 "query",
7225 Tuple(
7226 title=_("Upper Levels for Total Number of DNS queries"),
7227 elements=[
7228 Float(title=_("Warning at"), default_value=1500.0, unit="/sec"),
7229 Float(title=_("Critical at"), default_value=2000.0, unit="/sec")
7234 "answer",
7235 Tuple(
7236 title=_("Upper Levels for Total Number of DNS replies"),
7237 elements=[
7238 Float(title=_("Warning at"), default_value=1500.0, unit="/sec"),
7239 Float(title=_("Critical at"), default_value=2000.0, unit="/sec")
7243 ]), None, "dict")
7245 register_check_parameters(
7246 RulespecGroupCheckParametersApplications, "netscaler_tcp_conns",
7247 _("Citrix Netscaler Loadbalancer TCP Connections"),
7248 Dictionary(elements=[
7250 "client_conns",
7251 Tuple(
7252 title=_("Max. number of client connections"),
7253 elements=[
7254 Integer(
7255 title=_("Warning at"),
7256 default_value=25000,
7258 Integer(
7259 title=_("Critical at"),
7260 default_value=30000,
7265 "server_conns",
7266 Tuple(
7267 title=_("Max. number of server connections"),
7268 elements=[
7269 Integer(
7270 title=_("Warning at"),
7271 default_value=25000,
7273 Integer(
7274 title=_("Critical at"),
7275 default_value=30000,
7279 ]), None, "dict")
7281 register_check_parameters(
7282 RulespecGroupCheckParametersApplications,
7283 "netscaler_sslcerts",
7284 _("Citrix Netscaler SSL certificates"),
7285 Dictionary(
7286 elements=[
7288 'age_levels',
7289 Tuple(
7290 title=_("Remaining days of validity"),
7291 elements=[
7292 Integer(title=_("Warning below"), default_value=30, min_value=0),
7293 Integer(title=_("Critical below"), default_value=10, min_value=0),
7297 ],),
7298 TextAscii(title=_("Name of Certificate"),),
7299 match_type="dict")
7301 register_check_parameters(
7302 RulespecGroupCheckParametersEnvironment,
7303 "siemens_plc_flag",
7304 _("State of Siemens PLC Flags"),
7305 DropdownChoice(
7306 help=_("This rule sets the expected state, the one which should result in an OK state, "
7307 "of the monitored flags of Siemens PLC devices."),
7308 title=_("Expected flag state"),
7309 choices=[
7310 (True, _("Expect the flag to be: On")),
7311 (False, _("Expect the flag to be: Off")),
7313 default_value=True),
7314 TextAscii(
7315 title=_("Device Name and Value Ident"),
7316 help=_("You need to concatenate the device name which is configured in the special agent "
7317 "for the PLC device separated by a space with the ident of the value which is also "
7318 "configured in the special agent."),
7319 allow_empty=True),
7320 match_type="first",
7323 register_check_parameters(
7324 RulespecGroupCheckParametersEnvironment,
7325 "siemens_plc_duration",
7326 _("Siemens PLC Duration"),
7327 Dictionary(
7328 elements=[
7329 ('duration',
7330 Tuple(
7331 title=_("Duration"),
7332 elements=[
7333 Age(title=_("Warning at"),),
7334 Age(title=_("Critical at"),),
7335 ])),
7337 help=_("This rule is used to configure thresholds for duration values read from "
7338 "Siemens PLC devices."),
7339 title=_("Duration levels"),
7341 TextAscii(
7342 title=_("Device Name and Value Ident"),
7343 help=_("You need to concatenate the device name which is configured in the special agent "
7344 "for the PLC device separated by a space with the ident of the value which is also "
7345 "configured in the special agent."),
7347 match_type="dict",
7350 register_check_parameters(
7351 RulespecGroupCheckParametersEnvironment,
7352 "siemens_plc_counter",
7353 _("Siemens PLC Counter"),
7354 Dictionary(
7355 elements=[
7356 ('levels',
7357 Tuple(
7358 title=_("Counter level"),
7359 elements=[
7360 Integer(title=_("Warning at"),),
7361 Integer(title=_("Critical at"),),
7362 ])),
7364 help=_("This rule is used to configure thresholds for counter values read from "
7365 "Siemens PLC devices."),
7366 title=_("Counter levels"),
7368 TextAscii(
7369 title=_("Device Name and Value Ident"),
7370 help=_("You need to concatenate the device name which is configured in the special agent "
7371 "for the PLC device separated by a space with the ident of the value which is also "
7372 "configured in the special agent."),
7374 match_type="dict",
7377 register_check_parameters(
7378 RulespecGroupCheckParametersStorage, "bossock_fibers", _("Number of Running Bossock Fibers"),
7379 Tuple(
7380 title=_("Number of fibers"),
7381 elements=[
7382 Integer(title=_("Warning at"), unit=_("fibers")),
7383 Integer(title=_("Critical at"), unit=_("fibers")),
7384 ]), TextAscii(title=_("Node ID")), "first")
7386 register_check_parameters(
7387 RulespecGroupCheckParametersEnvironment, "carbon_monoxide", ("Carbon monoxide"),
7388 Dictionary(elements=[
7389 ("levels_ppm",
7390 Tuple(
7391 title="Levels in parts per million",
7392 elements=[
7393 Integer(title=_("Warning at"), unit=_("ppm"), default=10),
7394 Integer(title=_("Critical at"), unit=_("ppm"), default=25),
7395 ])),
7396 ]), None, "dict")