Refactoring: Moved more application check parameters from unsorted.py to dedicated...
[check_mk.git] / cmk / gui / plugins / wato / check_parameters / unsorted.py
blob17e1c4844856fcf1ec03926780b208dfed1c7f3c
1 #!/usr/bin/python
2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
9 # | |
10 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
27 import re
28 import cmk.utils.defines as defines
30 from cmk.gui.plugins.wato.active_checks import check_icmp_params
32 import cmk.gui.mkeventd as mkeventd
33 from cmk.gui.exceptions import MKUserError
34 from cmk.gui.i18n import _
35 from cmk.gui.valuespec import (
36 Dictionary,
37 Tuple,
38 Integer,
39 Float,
40 TextAscii,
41 Age,
42 DropdownChoice,
43 Checkbox,
44 RegExp,
45 Filesize,
46 Alternative,
47 Percentage,
48 ListChoice,
49 Transform,
50 ListOf,
51 ListOfStrings,
52 ListOfTimeRanges,
53 CascadingDropdown,
54 FixedValue,
55 Optional,
56 MonitoringState,
57 DualListChoice,
58 RadioChoice,
59 IPv4Address,
60 TextUnicode,
61 OptionalDropdownChoice,
62 RegExpUnicode,
64 from cmk.gui.plugins.wato import (
65 RulespecGroupCheckParametersApplications,
66 RulespecGroupCheckParametersDiscovery,
67 RulespecGroupCheckParametersEnvironment,
68 RulespecGroupCheckParametersHardware,
69 RulespecGroupCheckParametersNetworking,
70 RulespecGroupCheckParametersOperatingSystem,
71 RulespecGroupCheckParametersPrinters,
72 RulespecGroupCheckParametersStorage,
73 RulespecGroupCheckParametersVirtualization,
74 register_rule,
75 register_check_parameters,
76 UserIconOrAction,
77 Levels,
78 PredictiveLevels,
81 # TODO: Sort all rules and check parameters into the figlet header sections.
82 # Beware: there are dependencies, so sometimes the order matters. All rules
83 # that are not yet handles are in the last section: in "Unsorted". Move rules
84 # from there into their appropriate sections until "Unsorted" is empty.
85 # Create new rules directly in the correct secions.
87 # .--Networking----------------------------------------------------------.
88 # | _ _ _ _ _ |
89 # | | \ | | ___| |___ _____ _ __| | _(_)_ __ __ _ |
90 # | | \| |/ _ \ __\ \ /\ / / _ \| '__| |/ / | '_ \ / _` | |
91 # | | |\ | __/ |_ \ V V / (_) | | | <| | | | | (_| | |
92 # | |_| \_|\___|\__| \_/\_/ \___/|_| |_|\_\_|_| |_|\__, | |
93 # | |___/ |
94 # '----------------------------------------------------------------------'
96 register_rule(
97 RulespecGroupCheckParametersNetworking,
98 "ping_levels",
99 Dictionary(
100 title=_("PING and host check parameters"),
101 help=_("This rule sets the parameters for the host checks (via <tt>check_icmp</tt>) "
102 "and also for PING checks on ping-only-hosts. For the host checks only the "
103 "critical state is relevant, the warning levels are ignored."),
104 elements=check_icmp_params,
106 match="dict")
109 # .--Inventory-----------------------------------------------------------.
110 # | ___ _ |
111 # | |_ _|_ ____ _____ _ __ | |_ ___ _ __ _ _ |
112 # | | || '_ \ \ / / _ \ '_ \| __/ _ \| '__| | | | |
113 # | | || | | \ V / __/ | | | || (_) | | | |_| | |
114 # | |___|_| |_|\_/ \___|_| |_|\__\___/|_| \__, | |
115 # | |___/ |
116 # '----------------------------------------------------------------------'
119 def transform_ipmi_inventory_rules(p):
120 if not isinstance(p, dict):
121 return p
122 if p.get("summarize", True):
123 return 'summarize'
124 if p.get('ignored_sensors', []):
125 return ('single', {'ignored_sensors': p["ignored_sensors"]})
126 return ('single', {})
129 register_rule(
130 RulespecGroupCheckParametersDiscovery,
131 varname="inventory_ipmi_rules",
132 title=_("Discovery of IPMI sensors"),
133 valuespec=Transform(
134 CascadingDropdown(
135 orientation="vertical",
136 choices=
137 [("summarize", _("Summary")),
138 ("single", _("Single"),
139 Dictionary(
140 show_titles=True,
141 elements=[
142 ("ignored_sensors",
143 ListOfStrings(
144 title=_("Ignore the following IPMI sensors"),
145 help=_("Names of IPMI sensors that should be ignored during inventory "
146 "and when summarizing."
147 "The pattern specified here must match exactly the beginning of "
148 "the actual sensor name (case sensitive)."),
149 orientation="horizontal")),
150 ("ignored_sensorstates",
151 ListOfStrings(
152 title=_("Ignore the following IPMI sensor states"),
153 help=_(
154 "IPMI sensors with these states that should be ignored during inventory "
155 "and when summarizing."
156 "The pattern specified here must match exactly the beginning of "
157 "the actual sensor name (case sensitive)."),
158 orientation="horizontal",
160 ]))]),
161 forth=transform_ipmi_inventory_rules),
162 match='first')
164 register_rule(
165 RulespecGroupCheckParametersDiscovery,
166 varname="ewon_discovery_rules",
167 title=_("eWON Discovery"),
168 help=_("The ewon vpn routers can rely data from a secondary device via snmp. "
169 "It doesn't however allow discovery of the device type relayed this way. "
170 "To allow interpretation of the data you need to pick the device manually."),
171 valuespec=DropdownChoice(
172 title=_("Device Type"),
173 label=_("Select device type"),
174 choices=[
175 (None, _("None selected")),
176 ("oxyreduct", _("Wagner OxyReduct")),
178 default_value=None,
180 match='first')
182 register_rule(
183 RulespecGroupCheckParametersDiscovery,
184 varname="mssql_transactionlogs_discovery",
185 title=_("MSSQL Datafile and Transactionlog Discovery"),
186 valuespec=Dictionary(
187 elements=[
188 ("summarize_datafiles",
189 Checkbox(
190 title=_("Display only a summary of all Datafiles"),
191 label=_("Summarize Datafiles"),
193 ("summarize_transactionlogs",
194 Checkbox(
195 title=_("Display only a summary of all Transactionlogs"),
196 label=_("Summarize Transactionlogs"),
199 optional_keys=[]),
200 match="first")
202 register_rule(
203 RulespecGroupCheckParametersDiscovery,
204 varname="inventory_services_rules",
205 title=_("Windows Service Discovery"),
206 valuespec=Dictionary(
207 elements=[
208 ('services',
209 ListOfStrings(
210 title=_("Services (Regular Expressions)"),
211 help=_('Regular expressions matching the begining of the internal name '
212 'or the description of the service. '
213 'If no name is given then this rule will match all services. The '
214 'match is done on the <i>beginning</i> of the service name. It '
215 'is done <i>case sensitive</i>. You can do a case insensitive match '
216 'by prefixing the regular expression with <tt>(?i)</tt>. Example: '
217 '<tt>(?i).*mssql</tt> matches all services which contain <tt>MSSQL</tt> '
218 'or <tt>MsSQL</tt> or <tt>mssql</tt> or...'),
219 orientation="horizontal",
221 ('state',
222 DropdownChoice(
223 choices=[
224 ('running', _('Running')),
225 ('stopped', _('Stopped')),
227 title=_("Create check if service is in state"),
229 ('start_mode',
230 DropdownChoice(
231 choices=[
232 ('auto', _('Automatic')),
233 ('demand', _('Manual')),
234 ('disabled', _('Disabled')),
236 title=_("Create check if service is in start mode"),
239 help=_(
240 'This rule can be used to configure the inventory of the windows services check. '
241 'You can configure specific windows services to be monitored by the windows check by '
242 'selecting them by name, current state during the inventory, or start mode.'),
244 match='all',
247 register_rule(
248 RulespecGroupCheckParametersDiscovery,
249 varname="inventory_solaris_services_rules",
250 title=_("Solaris Service Discovery"),
251 valuespec=Dictionary(
252 elements=[
253 ('descriptions', ListOfStrings(title=_("Descriptions"))),
254 ('categories', ListOfStrings(title=_("Categories"))),
255 ('names', ListOfStrings(title=_("Names"))),
256 ('instances', ListOfStrings(title=_("Instances"))),
257 ('states',
258 ListOf(
259 DropdownChoice(
260 choices=[
261 ("online", _("online")),
262 ("disabled", _("disabled")),
263 ("maintenance", _("maintenance")),
264 ("legacy_run", _("legacy run")),
265 ],),
266 title=_("States"),
268 ('outcome',
269 Alternative(
270 title=_("Service name"),
271 style="dropdown",
272 elements=[
273 FixedValue("full_descr", title=_("Full Description"), totext=""),
274 FixedValue(
275 "descr_without_prefix",
276 title=_("Description without type prefix"),
277 totext=""),
281 help=_(
282 'This rule can be used to configure the discovery of the Solaris services check. '
283 'You can configure specific Solaris services to be monitored by the Solaris check by '
284 'selecting them by description, category, name, or current state during the discovery.'
287 match='all',
290 register_rule(
291 RulespecGroupCheckParametersDiscovery,
292 varname="discovery_systemd_units_services_rules",
293 title=_("Systemd Service Discovery"),
294 valuespec=Dictionary(
295 elements=[
296 ('descriptions', ListOfStrings(title=_("Descriptions"))),
297 ('names', ListOfStrings(title=_("Service unit names"))),
298 ('states',
299 ListOf(
300 DropdownChoice(
301 choices=[
302 ("active", "active"),
303 ("inactive", "inactive"),
304 ("failed", "failed"),
305 ],),
306 title=_("States"),
309 help=_('This rule can be used to configure the discovery of the Linux services check. '
310 'You can configure specific Linux services to be monitored by the Linux check by '
311 'selecting them by description, unit name, or current state during the discovery.'),
313 match='all',
316 register_rule(
317 RulespecGroupCheckParametersDiscovery,
318 varname="discovery_win_dhcp_pools",
319 title=_("Discovery of Windows DHCP Pools"),
320 valuespec=Dictionary(elements=[
321 ("empty_pools",
322 Checkbox(
323 title=_("Discovery of empty DHCP pools"),
324 label=_("Include empty pools into the monitoring"),
325 help=_("You can activate the creation of services for "
326 "DHCP pools, which contain no IP addresses."),
329 match='dict',
332 register_rule(
333 RulespecGroupCheckParametersDiscovery,
334 varname="inventory_if_rules",
335 title=_("Network Interface and Switch Port Discovery"),
336 valuespec=Dictionary(
337 elements=[
338 ("use_desc",
339 DropdownChoice(
340 choices=[
341 (True, _('Use description')),
342 (False, _('Do not use description')),
344 title=_("Description as service name for network interface checks"),
345 help=_(
346 "This option lets Check_MK use the interface description as item instead "
347 "of the port number. If no description is available then the port number is "
348 "used anyway."))),
349 ("use_alias",
350 DropdownChoice(
351 choices=[
352 (True, _('Use alias')),
353 (False, _('Do not use alias')),
355 title=_("Alias as service name for network interface checks"),
356 help=_(
357 "This option lets Check_MK use the alias of the port (ifAlias) as item instead "
358 "of the port number. If no alias is available then the port number is used "
359 "anyway."))),
360 ("pad_portnumbers",
361 DropdownChoice(
362 choices=[
363 (True, _('Pad port numbers with zeros')),
364 (False, _('Do not pad')),
366 title=_("Port numbers"),
367 help=_("If this option is activated then Check_MK will pad port numbers of "
368 "network interfaces with zeroes so that all port descriptions from "
369 "all ports of a host or switch have the same length and thus sort "
370 "currectly in the GUI. In versions prior to 1.1.13i3 there was no "
371 "padding. You can switch back to the old behaviour by disabling this "
372 "option. This will retain the old service descriptions and the old "
373 "performance data."),
375 ("match_alias",
376 ListOfStrings(
377 title=_("Match interface alias (regex)"),
378 help=_("Only discover interfaces whose alias matches one of the configured "
379 "regular expressions. The match is done on the beginning of the alias. "
380 "This allows you to select interfaces based on the alias without having "
381 "the alias be part of the service description."),
382 orientation="horizontal",
383 valuespec=RegExp(
384 size=32,
385 mode=RegExp.prefix,
388 ("match_desc",
389 ListOfStrings(
390 title=_("Match interface description (regex)"),
391 help=_(
392 "Only discover interfaces whose the description matches one of the configured "
393 "regular expressions. The match is done on the beginning of the description. "
394 "This allows you to select interfaces based on the description without having "
395 "the alias be part of the service description."),
396 orientation="horizontal",
397 valuespec=RegExp(
398 size=32,
399 mode=RegExp.prefix,
402 ("portstates",
403 ListChoice(
404 title=_("Network interface port states to discover"),
405 help=
406 _("When doing discovery on switches or other devices with network interfaces "
407 "then only ports found in one of the configured port states will be added to the monitoring. "
408 "Note: the state <i>admin down</i> is in fact not an <tt>ifOperStatus</tt> but represents the "
409 "<tt>ifAdminStatus</tt> of <tt>down</tt> - a port administratively switched off. If you check this option "
410 "then an alternate version of the check is being used that fetches the <tt>ifAdminState</tt> in addition. "
411 "This will add about 5% of additional SNMP traffic."),
412 choices=defines.interface_oper_states(),
413 toggle_all=True,
414 default_value=['1'],
416 ("porttypes",
417 DualListChoice(
418 title=_("Network interface port types to discover"),
419 help=_("When doing discovery on switches or other devices with network interfaces "
420 "then only ports of the specified types will be created services for."),
421 choices=defines.interface_port_types(),
422 custom_order=True,
423 rows=40,
424 toggle_all=True,
425 default_value=[
426 '6', '32', '62', '117', '127', '128', '129', '180', '181', '182', '205', '229'
429 ("rmon",
430 DropdownChoice(
431 choices=[
432 (True,
433 _("Create extra service with RMON statistics data (if available for the device)"
435 (False, _('Do not create extra services')),
437 title=_("Collect RMON statistics data"),
438 help=
439 _("If you enable this option, for every RMON capable switch port an additional service will "
440 "be created which is always OK and collects RMON data. This will give you detailed information "
441 "about the distribution of packet sizes transferred over the port. Note: currently "
442 "this extra RMON check does not honor the inventory settings for switch ports. In a future "
443 "version of Check_MK RMON data may be added to the normal interface service and not add "
444 "an additional service."),
447 help=_('This rule can be used to control the inventory for network ports. '
448 'You can configure the port types and port states for inventory'
449 'and the use of alias or description as service name.'),
451 match='list',
454 _brocade_fcport_adm_choices = [
455 (1, 'online(1)'),
456 (2, 'offline(2)'),
457 (3, 'testing(3)'),
458 (4, 'faulty(4)'),
461 _brocade_fcport_op_choices = [
462 (0, 'unkown(0)'),
463 (1, 'online(1)'),
464 (2, 'offline(2)'),
465 (3, 'testing(3)'),
466 (4, 'faulty(4)'),
469 _brocade_fcport_phy_choices = [
470 (1, 'noCard(1)'),
471 (2, 'noTransceiver(2)'),
472 (3, 'laserFault(3)'),
473 (4, 'noLight(4)'),
474 (5, 'noSync(5)'),
475 (6, 'inSync(6)'),
476 (7, 'portFault(7)'),
477 (8, 'diagFault(8)'),
478 (9, 'lockRef(9)'),
479 (10, 'validating(10)'),
480 (11, 'invalidModule(11)'),
481 (14, 'noSigDet(14)'),
482 (255, 'unkown(255)'),
485 register_rule(
486 RulespecGroupCheckParametersDiscovery,
487 varname="brocade_fcport_inventory",
488 title=_("Brocade Port Discovery"),
489 valuespec=Dictionary(
490 elements=[
491 ("use_portname",
492 Checkbox(
493 title=_("Use port name as service name"),
494 label=_("use port name"),
495 default_value=True,
496 help=_("This option lets Check_MK use the port name as item instead of the "
497 "port number. If no description is available then the port number is "
498 "used anyway."))),
499 ("show_isl",
500 Checkbox(
501 title=_("add \"ISL\" to service description for interswitch links"),
502 label=_("add ISL"),
503 default_value=True,
504 help=_("This option lets Check_MK add the string \"ISL\" to the service "
505 "description for interswitch links."))),
506 ("admstates",
507 ListChoice(
508 title=_("Administrative port states to discover"),
509 help=_(
510 "When doing service discovery on brocade switches only ports with the given administrative "
511 "states will be added to the monitoring system."),
512 choices=_brocade_fcport_adm_choices,
513 columns=1,
514 toggle_all=True,
515 default_value=['1', '3', '4'],
517 ("phystates",
518 ListChoice(
519 title=_("Physical port states to discover"),
520 help=_(
521 "When doing service discovery on brocade switches only ports with the given physical "
522 "states will be added to the monitoring system."),
523 choices=_brocade_fcport_phy_choices,
524 columns=1,
525 toggle_all=True,
526 default_value=[3, 4, 5, 6, 7, 8, 9, 10])),
527 ("opstates",
528 ListChoice(
529 title=_("Operational port states to discover"),
530 help=_(
531 "When doing service discovery on brocade switches only ports with the given operational "
532 "states will be added to the monitoring system."),
533 choices=_brocade_fcport_op_choices,
534 columns=1,
535 toggle_all=True,
536 default_value=[1, 2, 3, 4])),
538 help=_('This rule can be used to control the service discovery for brocade ports. '
539 'You can configure the port states for inventory '
540 'and the use of the description as service name.'),
542 match='dict',
546 # Next step in conversion: introduce "levels"
547 def ps_convert_from_singlekeys(old_params):
548 params = {}
549 params.update(ps_convert_from_tuple(old_params))
550 if "warnmin" in params:
551 params["levels"] = (
552 params.pop("warnmin", 1),
553 params.pop("okmin", 1),
554 params.pop("warnmax", 99999),
555 params.pop("okmax", 99999),
557 return params
560 def ps_convert_inventorized_from_singlekeys(old_params):
561 params = ps_convert_from_singlekeys(old_params)
562 if 'user' in params:
563 del params['user']
564 if 'process' in params:
565 del params['process']
566 return params
569 process_level_elements = [
570 ('levels',
571 Tuple(
572 title=_('Levels for process count'),
573 help=
574 _("Please note that if you specify and also if you modify levels here, the change is activated "
575 "only during an inventory. Saving this rule is not enough. This is due to the nature of inventory rules."
577 elements=[
578 Integer(
579 title=_("Critical below"),
580 unit=_("processes"),
581 default_value=1,
583 Integer(
584 title=_("Warning below"),
585 unit=_("processes"),
586 default_value=1,
588 Integer(
589 title=_("Warning above"),
590 unit=_("processes"),
591 default_value=99999,
593 Integer(
594 title=_("Critical above"),
595 unit=_("processes"),
596 default_value=99999,
600 ("cpulevels",
601 Tuple(
602 title=_("Levels on total CPU utilization"),
603 help=_("By activating this options you can set levels on the total "
604 "CPU utilization of all included processes."),
605 elements=[
606 Percentage(title=_("Warning at"), default_value=90, maxvalue=10000),
607 Percentage(title=_("Critical at"), default_value=98, maxvalue=10000),
610 ("cpu_average",
611 Integer(
612 title=_("CPU Averaging"),
613 help=_("By activating averaging, Check_MK will compute the average of "
614 "the total CPU utilization over a given interval. If you have defined "
615 "alerting levels then these will automatically be applied on the "
616 "averaged value. This helps to mask out short peaks. "),
617 unit=_("minutes"),
618 minvalue=1,
619 default_value=15,
621 ("single_cpulevels",
622 Tuple(
623 title=_("Levels on CPU utilization of a single process"),
624 help=_("Here you can define levels on the CPU utilization of single "
625 "processes. For performance reasons CPU Averaging will not be "
626 "applied to to the levels of single processes."),
627 elements=[
628 Percentage(title=_("Warning at"), default_value=90, maxvalue=10000),
629 Percentage(title=_("Critical at"), default_value=98, maxvalue=10000),
632 ("max_age",
633 Tuple(
634 title=_("Maximum allowed age"),
635 help=_("Alarms you if the age of the process (not the consumed CPU "
636 "time, but the real time) exceed the configured levels."),
637 elements=[
638 Age(title=_("Warning at"), default_value=3600),
639 Age(title=_("Critical at"), default_value=7200),
640 ])),
641 ("virtual_levels",
642 Tuple(
643 title=_("Virtual memory usage"),
644 elements=[
645 Filesize(title=_("Warning at"), default_value=1000 * 1024 * 1024 * 1024),
646 Filesize(title=_("Critical at"), default_value=2000 * 1024 * 1024 * 1024),
649 ("resident_levels",
650 Tuple(
651 title=_("Physical memory usage"),
652 elements=[
653 Filesize(title=_("Warning at"), default_value=100 * 1024 * 1024),
654 Filesize(title=_("Critical at"), default_value=200 * 1024 * 1024),
657 ("resident_levels_perc",
658 Tuple(
659 title=_("Physical memory usage, in percentage of total RAM"),
660 elements=[
661 Percentage(title=_("Warning at"), default_value=25.0),
662 Percentage(title=_("Critical at"), default_value=50.0),
663 ])),
664 ("handle_count",
665 Tuple(
666 title=_('Handle Count (Windows only)'),
667 help=_(
668 "The number of object handles in the processes object table. This includes open handles to "
669 "threads, files and other resources like registry keys."),
670 elements=[
671 Integer(
672 title=_("Warning above"),
673 unit=_("handles"),
675 Integer(
676 title=_("Critical above"),
677 unit=_("handles"),
681 ('process_info',
682 DropdownChoice(
683 title=_("Enable per-process details in long-output"),
684 label=_("Enable per-process details"),
685 help=
686 _("If active, the long output of this service will contain a list of "
687 "all the matching processes and their details (i.e. PID, CPU usage, memory usage). "
688 "Please note that HTML output will only work if \"Escape HTML codes in plugin output\" is "
689 "disabled in global settings. This might expose you to Cross-Site-Scripting (everyone "
690 "with write-access to checks could get scripts executed on the monitoring site in the context "
691 "of the user of the monitoring site) so please do this if you understand the consequences."
693 choices=[
694 (None, _("Disable")),
695 ("text", _("Text output")),
696 ("html", _("HTML output")),
698 default_value="disable",
703 # In version 1.2.4 the check parameters for the resulting ps check
704 # where defined in the dicovery rule. We moved that to an own rule
705 # in the classical check parameter style. In order to support old
706 # configuration we allow reading old discovery rules and ship these
707 # settings in an optional sub-dictionary.
708 def convert_inventory_processes(old_dict):
709 new_dict = {"default_params": {}}
710 for key, value in old_dict.items():
711 if key in [
712 'levels',
713 'handle_count',
714 'cpulevels',
715 'cpu_average',
716 'virtual_levels',
717 'resident_levels',
719 new_dict["default_params"][key] = value
720 elif key != "perfdata":
721 new_dict[key] = value
723 # New cpu rescaling load rule
724 if old_dict.get('cpu_rescale_max') is None:
725 new_dict['cpu_rescale_max'] = True
727 return new_dict
730 def forbid_re_delimiters_inside_groups(pattern, varprefix):
731 # Used as input validation in PS check wato config
732 group_re = r'\(.*?\)'
733 for match in re.findall(group_re, pattern):
734 for char in ['\\b', '$', '^']:
735 if char in match:
736 raise MKUserError(
737 varprefix,
738 _('"%s" is not allowed inside the regular expression group %s. '
739 'Bounding characters inside groups will vanish after discovery, '
740 'because processes are instanced for every matching group. '
741 'Thus enforce delimiters outside the group.') % (char, match))
744 register_rule(
745 RulespecGroupCheckParametersDiscovery,
746 varname="inventory_processes_rules",
747 title=_('Process Discovery'),
748 help=_(
749 "This ruleset defines criteria for automatically creating checks for running processes "
750 "based upon what is running when the service discovery is done. These services will be "
751 "created with default parameters. They will get critical when no process is running and "
752 "OK otherwise. You can parameterize the check with the ruleset <i>State and count of processes</i>."
754 valuespec=Transform(
755 Dictionary(
756 elements=[
757 ('descr',
758 TextAscii(
759 title=_('Process Name'),
760 style="dropdown",
761 allow_empty=False,
762 help=
763 _('<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 '
764 'expression and be prefixed with ~. For each <tt>%s</tt> in the description, the expression has to contain one "group". A group '
765 '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 '
766 'matching the pattern, it will substitute all such groups with the actual values when creating the check. That way one '
767 'rule can create several checks on a host.</p>'
768 '<p>If the pattern contains more groups then occurrances of <tt>%s</tt> in the service description then only the first matching '
769 'subexpressions are used for the service descriptions. The matched substrings corresponding to the remaining groups '
770 'are copied into the regular expression, nevertheless.</p>'
771 '<p>As an alternative to <tt>%s</tt> you may also use <tt>%1</tt>, <tt>%2</tt>, etc. '
772 'These will be replaced by the first, second, ... matching group. This allows you to reorder things.</p>'
776 'match',
777 Alternative(
778 title=_("Process Matching"),
779 style="dropdown",
780 elements=[
781 TextAscii(
782 title=_("Exact name of the process without argments"),
783 label=_("Executable:"),
784 size=50,
786 Transform(
787 RegExp(
788 size=50,
789 mode=RegExp.prefix,
790 validate=forbid_re_delimiters_inside_groups,
792 title=_("Regular expression matching command line"),
793 label=_("Command line:"),
794 help=
795 _("This regex must match the <i>beginning</i> of the complete "
796 "command line of the process including arguments.<br>"
797 "When using groups, matches will be instantiated "
798 "during process discovery. e.g. (py.*) will match python, python_dev "
799 "and python_test and discover 3 services. At check time, because "
800 "python is a substring of python_test and python_dev it will aggregate"
801 "all process that start with python. If that is not the intended behavior "
802 "please use a delimiter like '$' or '\\b' around the group, e.g. (py.*)$"
804 forth=lambda x: x[1:], # remove ~
805 back=lambda x: "~" + x, # prefix ~
807 FixedValue(
808 None,
809 totext="",
810 title=_("Match all processes"),
813 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0),
814 default_value='/usr/sbin/foo')),
815 ('user',
816 Alternative(
817 title=_('Name of the User'),
818 style="dropdown",
819 elements=[
820 FixedValue(
821 None,
822 totext="",
823 title=_("Match all users"),
825 TextAscii(
826 title=_('Exact name of the user'),
827 label=_("User:"),
829 FixedValue(
830 False,
831 title=_('Grab user from found processess'),
832 totext='',
835 help=
836 _('<p>The user specification can either be a user name (string). The inventory will then trigger only if that user matches '
837 'the user the process is running as and the resulting check will require that user. Alternatively you can specify '
838 '"grab user". If user is not selected the created check will not check for a specific user.</p>'
839 '<p>Specifying "grab user" makes the created check expect the process to run as the same user as during inventory: the user '
840 'name will be hardcoded into the check. In that case if you put %u into the service description, that will be replaced '
841 'by the actual user name during inventory. You need that if your rule might match for more than one user - your would '
842 'create duplicate services with the same description otherwise.</p><p>Windows users are specified by the namespace followed by '
843 'the actual user name. For example "\\\\NT AUTHORITY\\NETWORK SERVICE" or "\\\\CHKMKTEST\\Administrator".</p>'
846 ('icon',
847 UserIconOrAction(
848 title=_("Add custom icon or action"),
849 help=_(
850 "You can assign icons or actions to the found services in the status GUI."
853 ("cpu_rescale_max",
854 RadioChoice(
855 title=_("CPU rescale maximum load"),
856 help=_("CPU utilization is delivered by the Operating "
857 "System as a per CPU core basis. Thus each core contributes "
858 "with a 100% at full utilization, producing a maximum load "
859 "of N*100% (N=number of cores). For simplicity this maximum "
860 "can be rescaled down, making 100% the maximum and thinking "
861 "in terms of total CPU utilization."),
862 default_value=True,
863 orientation="vertical",
864 choices=[
865 (True, _("100% is all cores at full load")),
866 (False,
867 _("<b>N</b> * 100% as each core contributes with 100% at full load")),
868 ])),
869 ('default_params',
870 Dictionary(
871 title=_("Default parameters for detected services"),
872 help=
873 _("Here you can select default parameters that are being set "
874 "for detected services. Note: the preferred way for setting parameters is to use "
875 "the rule set <a href='wato.py?varname=checkgroup_parameters%3Apsmode=edit_ruleset'> "
876 "State and Count of Processes</a> instead. "
877 "A change there will immediately be active, while a change in this rule "
878 "requires a re-discovery of the services."),
879 elements=process_level_elements,
882 required_keys=["descr", "cpu_rescale_max"],
884 forth=convert_inventory_processes,
886 match='all',
889 register_rule(
890 RulespecGroupCheckParametersDiscovery,
891 varname="inv_domino_tasks_rules",
892 title=_('Lotus Domino Task Discovery'),
893 help=_("This rule controls the discovery of tasks on Lotus Domino systems. "
894 "Any changes later on require a host re-discovery"),
895 valuespec=Dictionary(
896 elements=[
897 ('descr',
898 TextAscii(
899 title=_('Service Description'),
900 allow_empty=False,
901 help=
902 _('<p>The service description may contain one or more occurances of <tt>%s</tt>. In this '
903 'case, the pattern must be a regular expression prefixed with ~. For each '
904 '<tt>%s</tt> in the description, the expression has to contain one "group". A group '
905 'is a subexpression enclosed in brackets, for example <tt>(.*)</tt> or '
906 '<tt>([a-zA-Z]+)</tt> or <tt>(...)</tt>. When the inventory finds a task '
907 'matching the pattern, it will substitute all such groups with the actual values when '
908 'creating the check. In this way one rule can create several checks on a host.</p>'
909 '<p>If the pattern contains more groups than occurrences of <tt>%s</tt> in the service '
910 'description, only the first matching subexpressions are used for the service '
911 'descriptions. The matched substrings corresponding to the remaining groups '
912 'are nevertheless copied into the regular expression.</p>'
913 '<p>As an alternative to <tt>%s</tt> you may also use <tt>%1</tt>, <tt>%2</tt>, etc. '
914 'These expressions will be replaced by the first, second, ... matching group, allowing '
915 'you to reorder things.</p>'),
918 'match',
919 Alternative(
920 title=_("Task Matching"),
921 elements=[
922 TextAscii(
923 title=_("Exact name of the task"),
924 size=50,
926 Transform(
927 RegExp(
928 size=50,
929 mode=RegExp.prefix,
931 title=_("Regular expression matching command line"),
932 help=_("This regex must match the <i>beginning</i> of the task"),
933 forth=lambda x: x[1:], # remove ~
934 back=lambda x: "~" + x, # prefix ~
936 FixedValue(
937 None,
938 totext="",
939 title=_("Match all tasks"),
942 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0),
943 default_value='foo')),
944 ('levels',
945 Tuple(
946 title=_('Levels'),
947 help=
948 _("Please note that if you specify and also if you modify levels here, the change is "
949 "activated only during an inventory. Saving this rule is not enough. This is due to "
950 "the nature of inventory rules."),
951 elements=[
952 Integer(
953 title=_("Critical below"),
954 unit=_("processes"),
955 default_value=1,
957 Integer(
958 title=_("Warning below"),
959 unit=_("processes"),
960 default_value=1,
962 Integer(
963 title=_("Warning above"),
964 unit=_("processes"),
965 default_value=1,
967 Integer(
968 title=_("Critical above"),
969 unit=_("processes"),
970 default_value=1,
975 required_keys=['match', 'levels', 'descr'],
977 match='all',
980 register_rule(
981 RulespecGroupCheckParametersDiscovery,
982 varname="inventory_sap_values",
983 title=_('SAP R/3 Single Value Inventory'),
984 valuespec=Dictionary(
985 elements=[
987 'match',
988 Alternative(
989 title=_("Node Path Matching"),
990 elements=[
991 TextAscii(
992 title=_("Exact path of the node"),
993 size=100,
995 Transform(
996 RegExp(
997 size=100,
998 mode=RegExp.prefix,
1000 title=_("Regular expression matching the path"),
1001 help=_("This regex must match the <i>beginning</i> of the complete "
1002 "path of the node as reported by the agent"),
1003 forth=lambda x: x[1:], # remove ~
1004 back=lambda x: "~" + x, # prefix ~
1006 FixedValue(
1007 None,
1008 totext="",
1009 title=_("Match all nodes"),
1012 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0),
1013 default_value=
1014 'SAP CCMS Monitor Templates/Dialog Overview/Dialog Response Time/ResponseTime')
1016 ('limit_item_levels',
1017 Integer(
1018 title=_("Limit Path Levels for Service Names"),
1019 unit=_('path levels'),
1020 minvalue=1,
1021 help=
1022 _("The service descriptions of the inventorized services are named like the paths "
1023 "in SAP. You can use this option to let the inventory function only use the last "
1024 "x path levels for naming."),
1027 optional_keys=['limit_item_levels'],
1029 match='all',
1032 register_rule(
1033 RulespecGroupCheckParametersDiscovery,
1034 varname="sap_value_groups",
1035 title=_('SAP Value Grouping Patterns'),
1036 help=_('The check <tt>sap.value</tt> normally creates one service for each SAP value. '
1037 'By defining grouping patterns, you can switch to the check <tt>sap.value-groups</tt>. '
1038 'That check monitors a list of SAP values at once.'),
1039 valuespec=ListOf(
1040 Tuple(
1041 help=_("This defines one value grouping pattern"),
1042 show_titles=True,
1043 orientation="horizontal",
1044 elements=[
1045 TextAscii(title=_("Name of group"),),
1046 Tuple(
1047 show_titles=True,
1048 orientation="vertical",
1049 elements=[
1050 RegExpUnicode(
1051 title=_("Include Pattern"),
1052 mode=RegExp.prefix,
1054 RegExpUnicode(
1055 title=_("Exclude Pattern"),
1056 mode=RegExp.prefix,
1062 add_label=_("Add pattern group"),
1064 match='all',
1067 register_rule(
1068 RulespecGroupCheckParametersDiscovery,
1069 varname="inventory_heartbeat_crm_rules",
1070 title=_("Heartbeat CRM Discovery"),
1071 valuespec=Dictionary(
1072 elements=[
1073 ("naildown_dc",
1074 Checkbox(
1075 title=_("Naildown the DC"),
1076 label=_("Mark the currently distinguished controller as preferred one"),
1077 help=_(
1078 "Nails down the DC to the node which is the DC during discovery. The check "
1079 "will report CRITICAL when another node becomes the DC during later checks."))
1081 ("naildown_resources",
1082 Checkbox(
1083 title=_("Naildown the resources"),
1084 label=_("Mark the nodes of the resources as preferred one"),
1085 help=_(
1086 "Nails down the resources to the node which is holding them during discovery. "
1087 "The check will report CRITICAL when another holds the resource during later checks."
1088 ))),
1090 help=_('This rule can be used to control the discovery for Heartbeat CRM checks.'),
1091 optional_keys=[],
1093 match='dict',
1096 register_rule(
1097 RulespecGroupCheckParametersDiscovery,
1098 varname="inventory_df_rules",
1099 title=_("Discovery parameters for filesystem checks"),
1100 valuespec=Dictionary(
1101 elements=[
1102 ("include_volume_name", Checkbox(title=_("Include Volume name in item"))),
1103 ("ignore_fs_types",
1104 ListChoice(
1105 title=_("Filesystem types to ignore"),
1106 choices=[
1107 ("tmpfs", "tmpfs"),
1108 ("nfs", "nfs"),
1109 ("smbfs", "smbfs"),
1110 ("cifs", "cifs"),
1111 ("iso9660", "iso9660"),
1113 default_value=["tmpfs", "nfs", "smbfs", "cifs", "iso9660"])),
1114 ("never_ignore_mountpoints",
1115 ListOf(
1116 TextUnicode(),
1117 title=_(u"Mountpoints to never ignore"),
1118 help=_(
1119 u"Regardless of filesystem type, these mountpoints will always be discovered."
1120 u"Globbing or regular expressions are currently not supported."),
1122 ],),
1123 match="dict",
1126 register_rule(
1127 RulespecGroupCheckParametersDiscovery,
1128 varname="inventory_mssql_counters_rules",
1129 title=_("Include MSSQL Counters services"),
1130 valuespec=Dictionary(
1131 elements=[
1132 ("add_zero_based_services", Checkbox(title=_("Include service with zero base."))),
1134 optional_keys=[]),
1135 match="dict",
1138 register_rule(
1139 RulespecGroupCheckParametersDiscovery,
1140 varname="inventory_fujitsu_ca_ports",
1141 title=_("Discovery of Fujtsu storage CA ports"),
1142 valuespec=Dictionary(
1143 elements=[
1144 ("indices", ListOfStrings(title=_("CA port indices"))),
1145 ("modes",
1146 DualListChoice(
1147 title=_("CA port modes"),
1148 choices=[
1149 ("CA", _("CA")),
1150 ("RA", _("RA")),
1151 ("CARA", _("CARA")),
1152 ("Initiator", _("Initiator")),
1154 row=4,
1155 size=30,
1157 ],),
1158 match="dict",
1161 register_rule(
1162 RulespecGroupCheckParametersDiscovery,
1163 varname="discovery_mssql_backup",
1164 title=_("Discovery of MSSQL backup"),
1165 valuespec=Dictionary(
1166 elements=[
1167 ("mode",
1168 DropdownChoice(
1169 title=_("Backup modes"),
1170 choices=[
1171 ("summary", _("Create a service for each instance")),
1172 ("per_type", _("Create a service for each instance and backup type")),
1173 ])),
1174 ],),
1175 match="dict",
1179 # .--Applications--------------------------------------------------------.
1180 # | _ _ _ _ _ |
1181 # | / \ _ __ _ __ | (_) ___ __ _| |_(_) ___ _ __ ___ |
1182 # | / _ \ | '_ \| '_ \| | |/ __/ _` | __| |/ _ \| '_ \/ __| |
1183 # | / ___ \| |_) | |_) | | | (_| (_| | |_| | (_) | | | \__ \ |
1184 # | /_/ \_\ .__/| .__/|_|_|\___\__,_|\__|_|\___/|_| |_|___/ |
1185 # | |_| |_| |
1186 # '----------------------------------------------------------------------'
1188 register_rule(
1189 RulespecGroupCheckParametersApplications,
1190 varname="logwatch_rules",
1191 title=_('Logwatch Patterns'),
1192 valuespec=Transform(
1193 Dictionary(
1194 elements=[
1195 ("reclassify_patterns",
1196 ListOf(
1197 Tuple(
1198 help=_("This defines one logfile pattern rule"),
1199 show_titles=True,
1200 orientation="horizontal",
1201 elements=[
1202 DropdownChoice(
1203 title=_("State"),
1204 choices=[
1205 ('C', _('CRITICAL')),
1206 ('W', _('WARNING')),
1207 ('O', _('OK')),
1208 ('I', _('IGNORE')),
1211 RegExpUnicode(
1212 title=_("Pattern (Regex)"),
1213 size=40,
1214 mode=RegExp.infix,
1216 TextUnicode(
1217 title=_("Comment"),
1218 size=40,
1221 title=_("Reclassify state matching regex pattern"),
1222 help=
1223 _('<p>You can define one or several patterns (regular expressions) in each logfile pattern rule. '
1224 'These patterns are applied to the selected logfiles to reclassify the '
1225 'matching log messages. The first pattern which matches a line will '
1226 'be used for reclassifying a message. You can use the '
1227 '<a href="wato.py?mode=pattern_editor">Logfile Pattern Analyzer</a> '
1228 'to test the rules you defined here.</p>'
1229 '<p>Select "Ignore" as state to get the matching logs deleted. Other states will keep the '
1230 'log entries but reclassify the state of them.</p>'),
1231 add_label=_("Add pattern"),
1233 ("reclassify_states",
1234 Dictionary(
1235 title=_("Reclassify complete state"),
1236 help=_(
1237 "This setting allows you to convert all incoming states to another state. "
1238 "The option is applied before the state conversion via regexes. So the regex values can "
1239 "modify the state even further."),
1240 elements=[
1241 ("c_to",
1242 DropdownChoice(
1243 title=_("Change CRITICAL State to"),
1244 choices=[
1245 ('C', _('CRITICAL')),
1246 ('W', _('WARNING')),
1247 ('O', _('OK')),
1248 ('I', _('IGNORE')),
1249 ('.', _('Context Info')),
1251 default_value="C",
1253 ("w_to",
1254 DropdownChoice(
1255 title=_("Change WARNING State to"),
1256 choices=[
1257 ('C', _('CRITICAL')),
1258 ('W', _('WARNING')),
1259 ('O', _('OK')),
1260 ('I', _('IGNORE')),
1261 ('.', _('Context Info')),
1263 default_value="W",
1265 ("o_to",
1266 DropdownChoice(
1267 title=_("Change OK State to"),
1268 choices=[
1269 ('C', _('CRITICAL')),
1270 ('W', _('WARNING')),
1271 ('O', _('OK')),
1272 ('I', _('IGNORE')),
1273 ('.', _('Context Info')),
1275 default_value="O",
1277 ("._to",
1278 DropdownChoice(
1279 title=_("Change Context Info to"),
1280 choices=[
1281 ('C', _('CRITICAL')),
1282 ('W', _('WARNING')),
1283 ('O', _('OK')),
1284 ('I', _('IGNORE')),
1285 ('.', _('Context Info')),
1287 default_value=".",
1290 optional_keys=False,
1293 optional_keys=["reclassify_states"],
1295 forth=lambda x: isinstance(x, dict) and x or {"reclassify_patterns": x}),
1296 itemtype='item',
1297 itemname='Logfile',
1298 itemhelp=_("Put the item names of the logfiles here. For example \"System$\" "
1299 "to select the service \"LOG System\". You can use regular "
1300 "expressions which must match the beginning of the logfile name."),
1301 match='all',
1304 register_check_parameters(
1305 RulespecGroupCheckParametersApplications,
1306 "lnx_quota",
1307 _("Linux quota check"),
1308 Dictionary(
1309 optional_keys=None,
1310 elements=[
1311 ("user", Checkbox(
1312 title=_("Monitor user quotas"),
1313 label=_("Enable"),
1314 default_value=True,
1316 ("group", Checkbox(
1317 title=_("Monitor group quotas"),
1318 label=_("Enable"),
1321 TextAscii(
1322 title=_("filesystem"),
1323 help=_("Name of filesystem with quotas enabled"),
1325 match_type='dict',
1328 register_check_parameters(
1329 RulespecGroupCheckParametersApplications, "ruckus_mac", _("Ruckus Spot Unique MAC addresses"),
1330 Dictionary(
1331 elements=[
1332 ("inside",
1333 Dictionary(
1334 title=_("Inside unique MACs"),
1335 elements=[
1336 ("levels_upper",
1337 Tuple(
1338 title=_("Upper levels"),
1339 elements=[
1340 Integer(title=_("Warning at")),
1341 Integer(title=_("Critical at")),
1344 ("levels_lower",
1345 Tuple(
1346 title=_("Lower levels"),
1347 elements=[
1348 Integer(title=_("Warning if below")),
1349 Integer(title=_("Critical if below")),
1352 ])),
1353 ("outside",
1354 Dictionary(
1355 title=_("Outside unique MACs"),
1356 elements=[
1357 ("levels_upper",
1358 Tuple(
1359 title=_("Upper levels"),
1360 elements=[
1361 Integer(title=_("Warning at")),
1362 Integer(title=_("Critical at")),
1365 ("levels_lower",
1366 Tuple(
1367 title=_("Lower levels"),
1368 elements=[
1369 Integer(title=_("Warning if below")),
1370 Integer(title=_("Critical if below")),
1373 ])),
1374 ],), None, "dict")
1376 register_check_parameters(
1377 RulespecGroupCheckParametersApplications, "ruckus_ap", _("Ruckus Spot Access Points"),
1378 Tuple(
1379 elements=[
1380 Optional(
1381 Tuple(
1382 elements=[
1383 Integer(title=_("Warning at"), default_value=1, unit=_("devices")),
1384 Integer(title=_("Critical at"), default_value=1, unit=_("devices")),
1385 ],),
1386 sameline=True,
1387 label=_("Levels for <i>device time drifted</i>"),
1388 none_label=_("No levels set"),
1389 none_value=(None, None)),
1390 Optional(
1391 Tuple(
1392 elements=[
1393 Integer(title=_("Warning at"), default_value=1, unit=_("devices")),
1394 Integer(title=_("Critical at"), default_value=1, unit=_("devices")),
1395 ],),
1396 sameline=True,
1397 label=_("Levels for <i>device not responding</i>"),
1398 none_label=_("No levels set"),
1399 none_value=(None, None)),
1400 ],), TextAscii(
1401 title=_("Band"),
1402 help=_("Name of the band, e.g. 5 GHz"),
1403 ), "first")
1405 vs_license = Alternative(
1406 title=_("Levels for Number of Licenses"),
1407 style="dropdown",
1408 default_value=None,
1409 elements=[
1410 Tuple(
1411 title=_("Absolute levels for unused licenses"),
1412 elements=[
1413 Integer(title=_("Warning below"), default_value=5, unit=_("unused licenses")),
1414 Integer(title=_("Critical below"), default_value=0, unit=_("unused licenses")),
1416 Tuple(
1417 title=_("Percentual levels for unused licenses"),
1418 elements=[
1419 Percentage(title=_("Warning below"), default_value=10.0),
1420 Percentage(title=_("Critical below"), default_value=0),
1422 FixedValue(
1423 None,
1424 totext=_("Critical when all licenses are used"),
1425 title=_("Go critical if all licenses are used"),
1427 FixedValue(
1428 False,
1429 title=_("Always report OK"),
1430 totext=_("Alerting depending on the number of used licenses is disabled"),
1434 register_check_parameters(
1435 RulespecGroupCheckParametersApplications, "esx_licenses", _("Number of used VMware licenses"),
1436 vs_license,
1437 TextAscii(
1438 title=_("Name of the license"),
1439 help=_("For example <tt>VMware vSphere 5 Standard</tt>"),
1440 allow_empty=False,
1441 ), "first")
1443 register_check_parameters(
1444 RulespecGroupCheckParametersApplications, "ibmsvc_licenses",
1445 _("Number of used IBM SVC licenses"), vs_license,
1446 TextAscii(
1447 title=_("ID of the license, e.g. <tt>virtualization</tt>"),
1448 allow_empty=False,
1449 ), "first")
1451 register_check_parameters(
1452 RulespecGroupCheckParametersApplications, "citrix_licenses",
1453 _("Number of used Citrix licenses"), vs_license,
1454 TextAscii(
1455 title=_("ID of the license, e.g. <tt>PVSD_STD_CCS</tt>"),
1456 allow_empty=False,
1457 ), "first")
1459 register_check_parameters(
1460 RulespecGroupCheckParametersApplications, "rds_licenses",
1461 _("Number of used Remote Desktop Licenses"), vs_license,
1462 TextAscii(
1463 title=_("ID of the license, e.g. <tt>Windows Server 2008 R2</tt>"),
1464 allow_empty=False,
1465 ), "first")
1467 register_check_parameters(
1468 RulespecGroupCheckParametersApplications,
1469 "win_license",
1470 _("Windows License"),
1471 Dictionary(elements=[
1472 ("status",
1473 ListOfStrings(
1474 title=_("Allowed license states"),
1475 help=_("Here you can specify the allowed license states for windows."),
1476 default_value=['Licensed', 'Initial grace period'],
1478 ("expiration_time",
1479 Tuple(
1480 title=_("Time until license expiration"),
1481 help=_("Remaining days until the Windows license expires"),
1482 elements=[
1483 Age(title=_("Warning at"), default_value=14 * 24 * 60 * 60),
1484 Age(title=_("Critical at"), default_value=7 * 24 * 60 * 60)
1485 ])),
1487 None,
1488 match_type="dict",
1491 register_check_parameters(
1492 RulespecGroupCheckParametersApplications, "citrix_sessions",
1493 _("Citrix Terminal Server Sessions"),
1494 Dictionary(elements=[
1495 ("total",
1496 Tuple(
1497 title=_("Total number of Sessions"),
1498 elements=[
1499 Integer(title=_("warning at"), unit="Sessions"),
1500 Integer(title=_("critical at"), unit="Session"),
1501 ])),
1502 ("active",
1503 Tuple(
1504 title=_("Number of Active Sessions"),
1505 elements=[
1506 Integer(title=_("warning at"), unit="Sessions"),
1507 Integer(title=_("critical at"), unit="Session"),
1508 ])),
1509 ("inactive",
1510 Tuple(
1511 title=_("Number of Inactive Sessions"),
1512 elements=[
1513 Integer(title=_("warning at"), unit="Sessions"),
1514 Integer(title=_("critical at"), unit="Session"),
1515 ])),
1516 ]), None, "dict")
1518 register_check_parameters(
1519 RulespecGroupCheckParametersApplications,
1520 "citrix_state",
1521 _("State of Citrix VMs"),
1522 Dictionary(elements=[(
1523 "registrationstate",
1524 Dictionary(
1525 title=_("Interpretation of Registration States"),
1526 elements=[
1527 ("Unregistered", MonitoringState(title=_("Unregistered"), default_value=2)),
1528 ("Initializing", MonitoringState(title=_("Initializing"), default_value=1)),
1529 ("Registered", MonitoringState(title=_("Registered"), default_value=0)),
1530 ("AgentError", MonitoringState(title=_("Agent Error"), default_value=2)),
1532 optional_keys=False,
1534 )]),
1535 None,
1536 match_type="dict",
1539 register_check_parameters(
1540 RulespecGroupCheckParametersApplications,
1541 "mssql_stats",
1542 _("MSSQL Statistics"),
1543 Dictionary(
1544 elements=[
1545 ("batch_requests/sec",
1546 Tuple(
1547 title=_("Batch Requests/sec"),
1548 elements=[
1549 Float(title=_("warning at"), unit=_("/sec"), default_value=100000.0),
1550 Float(title=_("critical at"), unit=_("/sec"), default_value=200000.0),
1551 ])),
1552 ("sql_compilations/sec",
1553 Tuple(
1554 title=_("SQL Compilations/sec"),
1555 elements=[
1556 Float(title=_("warning at"), unit=_("/sec"), default_value=10000.0),
1557 Float(title=_("critical at"), unit=_("/sec"), default_value=20000.0),
1558 ])),
1559 ("sql_re-compilations/sec",
1560 Tuple(
1561 title=_("SQL Re-Compilations/sec"),
1562 elements=[
1563 Float(title=_("warning at"), unit=_("/sec"), default_value=10000.0),
1564 Float(title=_("critical at"), unit=_("/sec"), default_value=200.0),
1565 ])),
1566 ("locks_per_batch",
1567 Tuple(
1568 title=_("Locks/Batch"),
1569 elements=[
1570 Float(title=_("warning at"), default_value=1000.0),
1571 Float(title=_("critical at"), default_value=3000.0),
1572 ])),
1573 ],),
1574 TextAscii(title=_("Counter ID"),),
1575 "dict",
1578 register_check_parameters(
1579 RulespecGroupCheckParametersApplications,
1580 "mssql_instance",
1581 _("MSSQL Instance"),
1582 Dictionary(
1583 elements=[("map_connection_state",
1584 MonitoringState(title=_("Connection status"), default_value=2))],),
1585 TextAscii(title=_("Instance identifier"),),
1586 "dict",
1589 register_check_parameters(
1590 RulespecGroupCheckParametersApplications,
1591 "mssql_databases",
1592 _("MSSQL Databases properties"),
1593 Dictionary(elements=[
1594 ("map_db_states",
1595 Dictionary(
1596 elements=[
1597 ("ONLINE", MonitoringState(title=_("Database Online"))),
1598 ("OFFLINE", MonitoringState(title=_("Database Offline"))),
1599 ("RESTORING", MonitoringState(title=_("Database Files are restored"))),
1600 ("RECOVERING", MonitoringState(title=_("Database is being recovered"))),
1601 ("RECOVERY_PENDING", MonitoringState(title=_("Database must be recovered"))),
1602 ("SUSPECT", MonitoringState(title=_("Database Suspect"))),
1603 ("EMERGENCY", MonitoringState(title=_("Database changed to emergency"))),
1605 title=_('Map Database States'),
1606 optional_keys=[],
1608 ("map_auto_close_state",
1609 Dictionary(
1610 elements=[
1611 ("on", MonitoringState(title=_("Auto close on"), default_value=1)),
1612 ("off", MonitoringState(title=_("Auto close off"))),
1614 title=_('Map auto close status'),
1615 optional_keys=[],
1617 ("map_auto_shrink_state",
1618 Dictionary(
1619 elements=[
1620 ("on", MonitoringState(title=_("Auto shrink on"), default_value=1)),
1621 ("off", MonitoringState(title=_("Auto shrink off"))),
1623 title=_('Map auto shrink status'),
1624 optional_keys=[],
1627 TextAscii(title=_("Database identifier"),),
1628 "dict",
1631 register_check_parameters(
1632 RulespecGroupCheckParametersApplications,
1633 "mssql_connections",
1634 _("MSSQL Connections"),
1635 Dictionary(elements=[(
1636 "levels",
1637 Tuple(
1638 title=_("Upper levels for the number of active database connections"),
1639 elements=[
1640 Integer(title=_("Warning if over"), default_value=20),
1641 Integer(title=_("Critical if over"), default_value=50),
1643 )]),
1644 TextAscii(title=_("Database identifier"), allow_empty=True),
1645 'dict',
1648 register_check_parameters(
1649 RulespecGroupCheckParametersApplications, "varnish_cache", _("Varnish Cache"),
1650 Dictionary(
1651 elements=[
1652 ("miss",
1653 Tuple(
1654 title=_("Upper levels for \"cache misses\" per second"),
1655 elements=[
1656 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1657 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1658 ])),
1659 ],), None, "dict")
1661 register_check_parameters(
1662 RulespecGroupCheckParametersApplications, "varnish_client", _("Varnish Client"),
1663 Dictionary(
1664 elements=[
1665 ("drop",
1666 Tuple(
1667 title=_("Upper levels for \"clients dropped\" per second"),
1668 elements=[
1669 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1670 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1671 ])),
1672 ("req",
1673 Tuple(
1674 title=_("Upper levels for \"client requests\" per second"),
1675 elements=[
1676 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1677 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1678 ])),
1679 ],), None, "dict")
1681 register_check_parameters(
1682 RulespecGroupCheckParametersApplications, "varnish_backend", _("Varnish Backend"),
1683 Dictionary(
1684 elements=[
1685 ("busy",
1686 Tuple(
1687 title=_("Upper levels for \"backend connections busy/too many\" per second"),
1688 elements=[
1689 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1690 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1691 ])),
1692 ("fail",
1693 Tuple(
1694 title=_("Upper levels for \"backend connections failures\" per second"),
1695 elements=[
1696 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1697 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1698 ])),
1699 ("unhealthy",
1700 Tuple(
1701 title=_(
1702 "Upper levels for \"backend connections unhealthy/not attempted\" per second"),
1703 elements=[
1704 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1705 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1706 ])),
1707 ],), None, "dict")
1709 register_check_parameters(
1710 RulespecGroupCheckParametersApplications, "varnish_fetch", _("Varnish Fetch"),
1711 Dictionary(
1712 elements=[
1713 ("1xx",
1714 Tuple(
1715 title=_("Upper levels for \"fetch no body (1xx)\" per second"),
1716 elements=[
1717 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1718 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1719 ])),
1720 ("204",
1721 Tuple(
1722 title=_("Upper levels for \"fetch no body (204)\" per second"),
1723 elements=[
1724 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1725 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1726 ])),
1727 ("304",
1728 Tuple(
1729 title=_("Upper levels for \"fetch no body (304)\" per second"),
1730 elements=[
1731 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1732 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1733 ])),
1734 ("bad",
1735 Tuple(
1736 title=_("Upper levels for \"fetch had bad headers\" per second"),
1737 elements=[
1738 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1739 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1740 ])),
1741 ("eof",
1742 Tuple(
1743 title=_("Upper levels for \"fetch EOF\" per second"),
1744 elements=[
1745 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1746 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1747 ])),
1748 ("failed",
1749 Tuple(
1750 title=_("Upper levels for \"fetch failed\" per second"),
1751 elements=[
1752 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1753 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1754 ])),
1755 ("zero",
1756 Tuple(
1757 title=_("Upper levels for \"fetch zero length\" per second"),
1758 elements=[
1759 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1760 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1761 ])),
1762 ],), None, "dict")
1764 register_check_parameters(
1765 RulespecGroupCheckParametersApplications, "varnish_esi", _("Varnish ESI"),
1766 Dictionary(
1767 elements=[
1768 ("errors",
1769 Tuple(
1770 title=_("Upper levels for \"ESI errors\" per second"),
1771 elements=[
1772 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1773 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1774 ])),
1775 ("warnings",
1776 Tuple(
1777 title=_("Upper levels for \"ESI warnings\" per second"),
1778 elements=[
1779 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1780 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1781 ])),
1782 ],), None, "dict")
1784 register_check_parameters(
1785 RulespecGroupCheckParametersApplications, "varnish_objects", _("Varnish Objects"),
1786 Dictionary(
1787 elements=[
1788 ("expired",
1789 Tuple(
1790 title=_("Upper levels for \"expired objects\" per second"),
1791 elements=[
1792 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1793 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1794 ])),
1795 ("lru_nuked",
1796 Tuple(
1797 title=_("Upper levels for \"LRU nuked objects\" per second"),
1798 elements=[
1799 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1800 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1801 ])),
1802 ],), None, "dict")
1804 register_check_parameters(
1805 RulespecGroupCheckParametersApplications, "varnish_worker", _("Varnish Worker"),
1806 Dictionary(
1807 elements=[
1808 ("wrk_drop",
1809 Tuple(
1810 title=_("Upper levels for \"dropped work requests\" per second"),
1811 elements=[
1812 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1813 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1814 ])),
1815 ("wrk_failed",
1816 Tuple(
1817 title=_("Upper levels for \"worker threads not created\" per second"),
1818 elements=[
1819 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1820 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1821 ])),
1822 ("wrk_queued",
1823 Tuple(
1824 title=_("Upper levels for \"queued work requests\" per second"),
1825 elements=[
1826 Float(title=_("Warning at"), default_value=1.0, allow_empty=False),
1827 Float(title=_("Critical at"), default_value=2.0, allow_empty=False)
1828 ])),
1829 ],), None, "dict")
1831 register_check_parameters(
1832 RulespecGroupCheckParametersApplications, "varnish_cache_hit_ratio",
1833 _("Varnish Cache Hit Ratio"),
1834 Dictionary(
1835 elements=[
1836 ("levels_lower",
1837 Tuple(
1838 title=_("Lower levels"),
1839 elements=[
1840 Percentage(title=_("Warning if below"), default_value=70.0, allow_empty=False),
1841 Percentage(
1842 title=_("Critical if below"), default_value=60.0, allow_empty=False)
1843 ])),
1844 ],), None, "dict")
1846 register_check_parameters(
1847 RulespecGroupCheckParametersApplications, "varnish_backend_success_ratio",
1848 _("Varnish Backend Success Ratio"),
1849 Dictionary(
1850 elements=[
1851 ("levels_lower",
1852 Tuple(
1853 title=_("Lower levels"),
1854 elements=[
1855 Percentage(title=_("Warning if below"), default_value=70.0, allow_empty=False),
1856 Percentage(
1857 title=_("Critical if below"), default_value=60.0, allow_empty=False)
1858 ])),
1859 ],), None, "dict")
1861 register_check_parameters(
1862 RulespecGroupCheckParametersApplications, "varnish_worker_thread_ratio",
1863 _("Varnish Worker Thread Ratio"),
1864 Dictionary(
1865 elements=[
1866 ("levels_lower",
1867 Tuple(
1868 title=_("Lower levels"),
1869 elements=[
1870 Percentage(title=_("Warning if below"), default_value=70.0, allow_empty=False),
1871 Percentage(
1872 title=_("Critical if below"), default_value=60.0, allow_empty=False)
1873 ])),
1874 ],), None, "dict")
1876 register_check_parameters(
1877 RulespecGroupCheckParametersApplications, "clr_memory",
1878 _("DotNet (.Net) runtime memory levels"),
1879 Dictionary(
1880 help=_("This rule allows to set the warn and crit levels of the memory "
1881 "metrics of the DotNet (.Net) Runtime"),
1882 elements=[
1883 ("upper",
1884 Tuple(
1885 title=_("Percent time spent in garbage collection"),
1886 elements=[
1887 Percentage(title=_("Warning at"), label=_("% time"), default_value=10.0),
1888 Percentage(title=_("Critical at"), label=_("% time"), default_value=15.0),
1889 ])),
1892 TextAscii(
1893 title=_("Name of the Application"),
1894 help=_("The name of the DotNet (.Net) application or _Global_"),
1895 allow_empty=False,
1896 ), "dict")
1898 register_check_parameters(
1899 RulespecGroupCheckParametersApplications, "skype_mobile", _("Skype for Business Mobile"),
1900 Dictionary(
1901 elements=[(
1902 'requests_processing',
1903 Dictionary(
1904 title=_("Requests in Processing"),
1905 elements=[
1906 ("upper",
1907 Tuple(elements=[
1908 Integer(title=_("Warning at"), unit=_("per second"), default_value=10000),
1909 Integer(title=_("Critical at"), unit=_("per second"), default_value=20000),
1910 ])),
1912 optional_keys=[]))],
1913 optional_keys=[]), None, "dict")
1915 register_check_parameters(
1916 RulespecGroupCheckParametersApplications, "skype_conferencing",
1917 _("Skype for Business Conferencing"),
1918 Dictionary(
1919 elements=[
1920 ('incomplete_calls',
1921 Dictionary(
1922 title=_("Incomplete Calls"),
1923 elements=[
1924 ("upper",
1925 Tuple(elements=[
1926 Float(title=_("Warning at"), unit=_("per second"), default_value=20.0),
1927 Float(title=_("Critical at"), unit=_("per second"), default_value=40.0),
1928 ])),
1930 optional_keys=[])),
1931 ('create_conference_latency',
1932 Dictionary(
1933 title=_("Create Conference Latency"),
1934 elements=[
1935 ("upper",
1936 Tuple(elements=[
1937 Float(title=_("Warning at"), unit=_("seconds"), default_value=5.0),
1938 Float(title=_("Critical at"), unit=_("seconds"), default_value=10.0),
1939 ])),
1941 optional_keys=[])),
1942 ('allocation_latency',
1943 Dictionary(
1944 title=_("Conference Allocation Latency"),
1945 elements=[
1946 ("upper",
1947 Tuple(elements=[
1948 Float(title=_("Warning at"), unit=_("seconds"), default_value=5.0),
1949 Float(title=_("Critical at"), unit=_("seconds"), default_value=10.0),
1950 ])),
1952 optional_keys=[])),
1953 ],), None, "dict")
1955 register_check_parameters(
1956 RulespecGroupCheckParametersApplications, "skype_sip", _("Skype for Business SIP Stack"),
1957 Dictionary(
1958 elements=[
1959 ('message_processing_time',
1960 Dictionary(
1961 title=_("Average Incoming Message Processing Time"),
1962 elements=[
1963 ("upper",
1964 Tuple(elements=[
1965 Float(title=_("Warning at"), unit=_("seconds"), default_value=1.0),
1966 Float(title=_("Critical at"), unit=_("seconds"), default_value=2.0),
1967 ])),
1969 optional_keys=[])),
1970 ('incoming_responses_dropped',
1971 Dictionary(
1972 title=_("Incoming Responses Dropped"),
1973 elements=[
1974 ("upper",
1975 Tuple(elements=[
1976 Float(title=_("Warning at"), unit=_("per second"), default_value=1.0),
1977 Float(title=_("Critical at"), unit=_("per second"), default_value=2.0),
1978 ])),
1980 optional_keys=[])),
1981 ('incoming_requests_dropped',
1982 Dictionary(
1983 title=_("Incoming Requests Dropped"),
1984 elements=[
1985 ("upper",
1986 Tuple(elements=[
1987 Float(title=_("Warning at"), unit=_("per second"), default_value=1.0),
1988 Float(title=_("Critical at"), unit=_("per second"), default_value=2.0),
1989 ])),
1991 optional_keys=[])),
1992 ('queue_latency',
1993 Dictionary(
1994 title=_("Queue Latency"),
1995 elements=[
1996 ("upper",
1997 Tuple(elements=[
1998 Float(title=_("Warning at"), unit=_("seconds"), default_value=0.1),
1999 Float(title=_("Critical at"), unit=_("seconds"), default_value=0.2),
2000 ])),
2002 optional_keys=[])),
2003 ('sproc_latency',
2004 Dictionary(
2005 title=_("Sproc Latency"),
2006 elements=[
2007 ("upper",
2008 Tuple(elements=[
2009 Float(title=_("Warning at"), unit=_("seconds"), default_value=0.1),
2010 Float(title=_("Critical at"), unit=_("seconds"), default_value=0.2),
2011 ])),
2013 optional_keys=[])),
2014 ('throttled_requests',
2015 Dictionary(
2016 title=_("Throttled requests"),
2017 elements=[
2018 ("upper",
2019 Tuple(elements=[
2020 Float(title=_("Warning at"), unit=_("per second"), default_value=0.2),
2021 Float(title=_("Critical at"), unit=_("per second"), default_value=0.4),
2022 ])),
2024 optional_keys=[])),
2025 ('local_503_responses',
2026 Dictionary(
2027 title=_("Local HTTP 503 Responses"),
2028 elements=[
2029 ("upper",
2030 Tuple(elements=[
2031 Float(title=_("Warning at"), unit=_("per second"), default_value=1.0),
2032 Float(title=_("Critical at"), unit=_("per second"), default_value=2.0),
2033 ])),
2035 optional_keys=[])),
2036 ('timedout_incoming_messages',
2037 Dictionary(
2038 title=_("Incoming Messages Timed out"),
2039 elements=[
2040 ("upper",
2041 Tuple(elements=[
2042 Integer(title=_("Warning at"), default_value=2),
2043 Integer(title=_("Critical at"), default_value=4),
2044 ])),
2046 optional_keys=[])),
2047 ('holding_time_incoming',
2048 Dictionary(
2049 title=_("Average Holding Time For Incoming Messages"),
2050 elements=[
2051 ("upper",
2052 Tuple(elements=[
2053 Float(title=_("Warning at"), unit=_("seconds"), default_value=1.0),
2054 Float(title=_("Critical at"), unit=_("seconds"), default_value=2.0),
2055 ])),
2057 optional_keys=[])),
2058 ('flow_controlled_connections',
2059 Dictionary(
2060 title=_("Flow-controlled Connections"),
2061 elements=[
2062 ("upper",
2063 Tuple(elements=[
2064 Integer(title=_("Warning at"), default_value=1),
2065 Integer(title=_("Critical at"), default_value=2),
2066 ])),
2068 optional_keys=[])),
2069 ('outgoing_queue_delay',
2070 Dictionary(
2071 title=_("Average Outgoing Queue Delay"),
2072 elements=[
2073 ("upper",
2074 Tuple(elements=[
2075 Float(title=_("Warning at"), unit=_("seconds"), default_value=2.0),
2076 Float(title=_("Critical at"), unit=_("seconds"), default_value=4.0),
2077 ])),
2079 optional_keys=[])),
2080 ('timedout_sends',
2081 Dictionary(
2082 title=_("Sends Timed-Out"),
2083 elements=[
2084 ("upper",
2085 Tuple(elements=[
2086 Float(title=_("Warning at"), unit=_("per second"), default_value=0.01),
2087 Float(title=_("Critical at"), unit=_("per second"), default_value=0.02),
2088 ])),
2090 optional_keys=[])),
2091 ('authentication_errors',
2092 Dictionary(
2093 title=_("Authentication System Errors"),
2094 elements=[
2095 ("upper",
2096 Tuple(elements=[
2097 Float(title=_("Warning at"), unit=_("per second"), default_value=1.0),
2098 Float(title=_("Critical at"), unit=_("per second"), default_value=2.0),
2099 ])),
2101 optional_keys=[])),
2102 ],), None, "dict")
2104 register_check_parameters(
2105 RulespecGroupCheckParametersApplications, "skype_mediation_server",
2106 _("Skype for Business Mediation Server"),
2107 Dictionary(
2108 elements=[
2109 ('load_call_failure_index',
2110 Dictionary(
2111 title=_("Load Call Failure Index"),
2112 elements=[
2113 ("upper",
2114 Tuple(elements=[
2115 Integer(title=_("Warning at"), default_value=10),
2116 Integer(title=_("Critical at"), default_value=20),
2117 ])),
2119 optional_keys=[])),
2120 ('failed_calls_because_of_proxy',
2121 Dictionary(
2122 title=_("Failed calls caused by unexpected interaction from proxy"),
2123 elements=[
2124 ("upper",
2125 Tuple(elements=[
2126 Integer(title=_("Warning at"), default_value=10),
2127 Integer(title=_("Critical at"), default_value=20),
2128 ])),
2130 optional_keys=[])),
2131 ('failed_calls_because_of_gateway',
2132 Dictionary(
2133 title=_("Failed calls caused by unexpected interaction from gateway"),
2134 elements=[
2135 ("upper",
2136 Tuple(elements=[
2137 Integer(title=_("Warning at"), default_value=10),
2138 Integer(title=_("Critical at"), default_value=20),
2139 ])),
2141 optional_keys=[])),
2142 ('media_connectivity_failure',
2143 Dictionary(
2144 title=_("Media Connectivity Check Failure"),
2145 elements=[
2146 ("upper",
2147 Tuple(elements=[
2148 Integer(title=_("Warning at"), default_value=1),
2149 Integer(title=_("Critical at"), default_value=2),
2150 ])),
2152 optional_keys=[])),
2153 ],), None, "dict")
2155 register_check_parameters(
2156 RulespecGroupCheckParametersApplications, "skype_xmpp", _("Skype for Business XMPP"),
2157 Dictionary(
2158 elements=[
2159 ('failed_outbound_streams',
2160 Dictionary(
2161 title=_("XMPP Failed outbound stream establishes"),
2162 elements=[
2163 ("upper",
2164 Tuple(elements=[
2165 Float(title=_("Warning at"), unit=_("per second"), default_value=0.01),
2166 Float(title=_("Critical at"), unit=_("per second"), default_value=0.02),
2167 ])),
2169 optional_keys=[])),
2170 ('failed_inbound_streams',
2171 Dictionary(
2172 title=_("XMPP Failed inbound stream establishes"),
2173 elements=[
2174 ("upper",
2175 Tuple(elements=[
2176 Float(title=_("Warning at"), unit=_("per second"), default_value=0.01),
2177 Float(title=_("Critical at"), unit=_("per second"), default_value=0.02),
2178 ])),
2180 optional_keys=[])),
2181 ],), None, "dict")
2183 register_check_parameters(
2184 RulespecGroupCheckParametersApplications, "skype_edgeauth", _("Skype for Business Edge Auth"),
2185 Dictionary(
2186 elements=[
2187 ('bad_requests',
2188 Dictionary(
2189 title=_("Bad Requests Received"),
2190 elements=[
2191 ("upper",
2192 Tuple(elements=[
2193 Integer(title=_("Warning at"), unit=_("per second"), default_value=20),
2194 Integer(title=_("Critical at"), unit=_("per second"), default_value=40),
2195 ])),
2197 optional_keys=[])),
2199 optional_keys=[]), None, "dict")
2201 register_check_parameters(
2202 RulespecGroupCheckParametersApplications, "acme_certificates", _("ACME certificates"),
2203 Dictionary(
2204 elements=[("expire_lower",
2205 Tuple(
2206 title=_("Lower age levels for expire date"),
2207 elements=[
2208 Age(title=_("Warning if below"), default_value=604800),
2209 Age(title=_("Critical if below"), default_value=2592000),
2210 ]))],), TextAscii(
2211 title=_("Name of certificate"),
2212 allow_empty=False,
2213 ), "dict")
2215 register_check_parameters(
2216 RulespecGroupCheckParametersApplications, "skype", _("Skype for Business"),
2217 Dictionary(
2218 elements=[
2219 ('failed_search_requests',
2220 Dictionary(
2221 title=_("Failed search requests"),
2222 elements=[
2223 ("upper",
2224 Tuple(elements=[
2225 Float(title=_("Warning at"), unit=_("per second"), default_value=1.0),
2226 Float(title=_("Critical at"), unit=_("per second"), default_value=2.0),
2227 ])),
2229 optional_keys=[])),
2230 ('failed_locations_requests',
2231 Dictionary(
2232 title=_("Failed Get Locations Requests"),
2233 elements=[
2234 ("upper",
2235 Tuple(elements=[
2236 Float(title=_("Warning at"), unit=_("per second"), default_value=1.0),
2237 Float(title=_("Critical at"), unit=_("per second"), default_value=2.0),
2238 ])),
2240 optional_keys=[])),
2241 ('failed_file_requests',
2242 Dictionary(
2243 title=_("Failed requests to Adressbook files"),
2244 elements=[
2245 ("upper",
2246 Tuple(elements=[
2247 Float(title=_("Warning at"), unit=_("per second"), default_value=1.0),
2248 Float(title=_("Critical at"), unit=_("per second"), default_value=2.0),
2251 optional_keys=[])),
2252 ('join_failures',
2253 Dictionary(
2254 title=_("Failures of the join launcher service"),
2255 elements=[("upper",
2256 Tuple(elements=[
2257 Integer(title=_("Warning at"), default_value=1),
2258 Integer(title=_("Critical at"), default_value=2),
2259 ]))],
2260 optional_keys=[])),
2261 ('failed_validate_cert',
2262 Dictionary(
2263 title=_("Failed certificate validations"),
2264 elements=[("upper",
2265 Tuple(elements=[
2266 Integer(title=_("Warning at"), default_value=1),
2267 Integer(title=_("Critical at"), default_value=2),
2268 ]))],
2269 optional_keys=[])),
2270 ('timedout_ad_requests',
2271 Dictionary(
2272 title=_("Timed out Active Directory Requests"),
2273 elements=[
2274 ("upper",
2275 Tuple(elements=[
2276 Float(title=_("Warning at"), unit=_("per second"), default_value=0.01),
2277 Float(title=_("Critical at"), unit=_("per second"), default_value=0.02),
2278 ])),
2280 optional_keys=[])),
2281 ('5xx_responses',
2282 Dictionary(
2283 title=_("HTTP 5xx Responses"),
2284 elements=[
2285 ("upper",
2286 Tuple(elements=[
2287 Float(title=_("Warning at"), unit=_("per second"), default_value=1.0),
2288 Float(title=_("Critical at"), unit=_("per second"), default_value=2.0),
2289 ])),
2291 optional_keys=[])),
2292 ('asp_requests_rejected',
2293 Dictionary(
2294 title=_("ASP Requests Rejected"),
2295 elements=[
2296 ("upper",
2297 Tuple(elements=[
2298 Integer(title=_("Warning at"), default_value=1),
2299 Integer(title=_("Critical at"), default_value=2),
2300 ])),
2302 optional_keys=[])),
2303 ],), None, "dict")
2305 register_check_parameters(
2306 RulespecGroupCheckParametersApplications, "skype_proxy", _("Skype for Business Data Proxy"),
2307 Dictionary(
2308 help=_("Warn/Crit levels for various Skype for Business "
2309 "(formerly known as Lync) metrics"),
2310 elements=[
2311 ('throttled_connections',
2312 Dictionary(
2313 title=_("Throttled Server Connections"),
2314 elements=[
2315 ("upper",
2316 Tuple(elements=[
2317 Integer(title=_("Warning at"), default_value=3),
2318 Integer(title=_("Critical at"), default_value=6),
2319 ])),
2321 optional_keys=[])),
2323 optional_keys=[]),
2324 TextAscii(
2325 title=_("Name of the Proxy"),
2326 help=_("The name of the Data Proxy"),
2327 allow_empty=False,
2328 ), "dict")
2330 register_check_parameters(
2331 RulespecGroupCheckParametersApplications, "skype_edge", _("Skype for Business Edge"),
2332 Dictionary(elements=[
2333 ('authentication_failures',
2334 Dictionary(
2335 title=_("Authentication Failures"),
2336 elements=[
2337 ("upper",
2338 Tuple(elements=[
2339 Integer(title=_("Warning at"), unit=_("per second"), default_value=20),
2340 Integer(title=_("Critical at"), unit=_("per second"), default_value=40),
2341 ])),
2343 optional_keys=[])),
2344 ('allocate_requests_exceeding',
2345 Dictionary(
2346 title=_("Allocate Requests Exceeding Port Limit"),
2347 elements=[
2348 ("upper",
2349 Tuple(elements=[
2350 Integer(title=_("Warning at"), unit=_("per second"), default_value=20),
2351 Integer(title=_("Critical at"), unit=_("per second"), default_value=40),
2352 ])),
2354 optional_keys=[])),
2355 ('packets_dropped',
2356 Dictionary(
2357 title=_("Packets Dropped"),
2358 elements=[
2359 ("upper",
2360 Tuple(elements=[
2361 Integer(title=_("Warning at"), unit=_("per second"), default_value=200),
2362 Integer(title=_("Critical at"), unit=_("per second"), default_value=400),
2363 ])),
2365 optional_keys=[])),
2367 TextAscii(
2368 title=_("Interface"),
2369 help=_("The name of the interface (Public/Private IPv4/IPv6 Network Interface)"),
2370 ), "dict")
2372 # Rule for disovered process checks
2373 register_check_parameters(
2374 RulespecGroupCheckParametersApplications,
2375 "ps",
2376 _("State and count of processes"),
2377 Transform(
2378 Dictionary(elements=process_level_elements + [(
2379 'icon',
2380 UserIconOrAction(
2381 title=_("Add custom icon or action"),
2382 help=_("You can assign icons or actions to the found services in the status GUI."),
2383 ))]),
2384 forth=ps_convert_inventorized_from_singlekeys,
2386 TextAscii(title=_("Process name as defined at discovery"),),
2387 "dict",
2388 has_inventory=True,
2389 register_static_check=False,
2392 # Rule for static process checks
2393 register_check_parameters(
2394 RulespecGroupCheckParametersApplications,
2395 "ps",
2396 _("State and count of processes"),
2397 Transform(
2398 Dictionary(
2399 elements=[
2401 "process",
2402 Alternative(
2403 title=_("Process Matching"),
2404 style="dropdown",
2405 elements=[
2406 TextAscii(
2407 title=_("Exact name of the process without argments"),
2408 size=50,
2410 Transform(
2411 RegExp(
2412 size=50,
2413 mode=RegExp.prefix,
2415 title=_("Regular expression matching command line"),
2416 help=_("This regex must match the <i>beginning</i> of the complete "
2417 "command line of the process including arguments"),
2418 forth=lambda x: x[1:], # remove ~
2419 back=lambda x: "~" + x, # prefix ~
2421 FixedValue(
2422 None,
2423 totext="",
2424 title=_("Match all processes"),
2427 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0))),
2429 "user",
2430 Alternative(
2431 title=_("Name of operating system user"),
2432 style="dropdown",
2433 elements=[
2434 TextAscii(title=_("Exact name of the operating system user")),
2435 Transform(
2436 RegExp(
2437 size=50,
2438 mode=RegExp.prefix,
2440 title=_("Regular expression matching username"),
2441 help=_("This regex must match the <i>beginning</i> of the complete "
2442 "username"),
2443 forth=lambda x: x[1:], # remove ~
2444 back=lambda x: "~" + x, # prefix ~
2446 FixedValue(
2447 None,
2448 totext="",
2449 title=_("Match all users"),
2452 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0))),
2453 ('icon',
2454 UserIconOrAction(
2455 title=_("Add custom icon or action"),
2456 help=_(
2457 "You can assign icons or actions to the found services in the status GUI."
2460 ] + process_level_elements,
2461 # required_keys = [ "process" ],
2463 forth=ps_convert_from_singlekeys,
2465 TextAscii(
2466 title=_("Process Name"),
2467 help=_("This name will be used in the description of the service"),
2468 allow_empty=False,
2469 regex="^[a-zA-Z_0-9 _./-]*$",
2470 regex_error=_("Please use only a-z, A-Z, 0-9, space, underscore, "
2471 "dot, hyphen and slash for your service description"),
2473 "dict",
2474 has_inventory=False,
2477 register_check_parameters(
2478 RulespecGroupCheckParametersApplications, "generic_number", _("Generic numeric value"),
2479 Dictionary(elements=[
2480 ("levels",
2481 Tuple(
2482 title=_("Upper levels"),
2483 elements=[
2484 Float(title="Warning at"),
2485 Float(title="Critical at"),
2486 ])),
2487 ("levels_lower",
2488 Tuple(
2489 title=_("Lower levels"),
2490 elements=[
2491 Float(title="Warning below"),
2492 Float(title="Critical below"),
2493 ])),
2494 ]), TextAscii(title=_("Item"),), "dict")
2496 register_check_parameters(
2497 RulespecGroupCheckParametersApplications, "generic_rate", _("Generic rate"),
2498 Dictionary(elements=[
2499 ("levels",
2500 Tuple(
2501 title=_("Upper levels"),
2502 elements=[
2503 Float(title="Warning at", unit="/s"),
2504 Float(title="Critical at", unit="/s"),
2505 ])),
2506 ("levels_lower",
2507 Tuple(
2508 title=_("Lower levels"),
2509 elements=[
2510 Float(title="Warning below", unit="/s"),
2511 Float(title="Critical below", unit="/s"),
2512 ])),
2513 ]), TextAscii(title=_("Item"),), "dict")
2515 register_check_parameters(
2516 RulespecGroupCheckParametersApplications, "generic_string", _("Generic string"),
2517 Dictionary(elements=[
2518 ("default_status", MonitoringState(title=_("Default Status"))),
2519 ("match_strings",
2520 ListOf(Tuple(elements=[
2521 TextAscii(title=_("Search string")),
2522 MonitoringState(),
2523 ]))),
2524 ]), TextAscii(title=_("Item"),), "dict")
2526 register_check_parameters(
2527 RulespecGroupCheckParametersApplications,
2528 "jvm_uptime",
2529 _("JVM uptime (since last reboot)"),
2530 Dictionary(
2531 help=_("This rule sets the warn and crit levels for the uptime of a JVM. "
2532 "Other keywords for this rule: Tomcat, Jolokia, JMX. "),
2533 elements=[
2534 ("min",
2535 Tuple(
2536 title=_("Minimum required uptime"),
2537 elements=[
2538 Age(title=_("Warning if below")),
2539 Age(title=_("Critical if below")),
2540 ])),
2541 ("max",
2542 Tuple(
2543 title=_("Maximum allowed uptime"),
2544 elements=[
2545 Age(title=_("Warning at")),
2546 Age(title=_("Critical at")),
2547 ])),
2549 TextAscii(
2550 title=_("Name of the virtual machine"),
2551 help=_("The name of the application server"),
2552 allow_empty=False,
2554 match_type="dict",
2557 register_check_parameters(
2558 RulespecGroupCheckParametersApplications,
2559 "netapp_systemtime",
2560 _("Netapp systemtime"),
2561 Dictionary(elements=[
2562 ("levels",
2563 Tuple(
2564 title=_("Set upper levels for the time difference"),
2565 help=_("Here you can Set upper levels for the time difference "
2566 "between agent and system time."),
2567 elements=[
2568 Age(title=_("Warning if at")),
2569 Age(title=_("Critical if at")),
2570 ])),
2572 TextAscii(
2573 title=_("Name of the node"),
2574 allow_empty=False,
2576 match_type="dict",
2579 register_check_parameters(
2580 RulespecGroupCheckParametersApplications, "jvm_sessions", _("JVM session count"),
2581 Tuple(
2582 help=_("This rule sets the warn and crit levels for the number of current "
2583 "connections to a JVM application on the servlet level."),
2584 elements=[
2585 Integer(
2586 title=_("Warning if below"),
2587 unit=_("sessions"),
2588 default_value=-1,
2590 Integer(
2591 title=_("Critical if below"),
2592 unit=_("sessions"),
2593 default_value=-1,
2595 Integer(
2596 title=_("Warning at"),
2597 unit=_("sessions"),
2598 default_value=800,
2600 Integer(
2601 title=_("Critical at"),
2602 unit=_("sessions"),
2603 default_value=1000,
2606 TextAscii(
2607 title=_("Name of the virtual machine"),
2608 help=_("The name of the application server"),
2609 allow_empty=False,
2610 ), "first")
2612 register_check_parameters(
2613 RulespecGroupCheckParametersApplications, "jvm_requests", _("JVM request count"),
2614 Tuple(
2615 help=_("This rule sets the warn and crit levels for the number "
2616 "of incoming requests to a JVM application server."),
2617 elements=[
2618 Integer(
2619 title=_("Warning if below"),
2620 unit=_("requests/sec"),
2621 default_value=-1,
2623 Integer(
2624 title=_("Critical if below"),
2625 unit=_("requests/sec"),
2626 default_value=-1,
2628 Integer(
2629 title=_("Warning at"),
2630 unit=_("requests/sec"),
2631 default_value=800,
2633 Integer(
2634 title=_("Critical at"),
2635 unit=_("requests/sec"),
2636 default_value=1000,
2639 TextAscii(
2640 title=_("Name of the virtual machine"),
2641 help=_("The name of the application server"),
2642 allow_empty=False,
2643 ), "first")
2645 register_check_parameters(
2646 RulespecGroupCheckParametersApplications, "jvm_queue", _("JVM Execute Queue Count"),
2647 Tuple(
2648 help=_("The BEA application servers have 'Execute Queues' "
2649 "in which requests are processed. This rule allows to set "
2650 "warn and crit levels for the number of requests that are "
2651 "being queued for processing."),
2652 elements=[
2653 Integer(
2654 title=_("Warning at"),
2655 unit=_("requests"),
2656 default_value=20,
2658 Integer(
2659 title=_("Critical at"),
2660 unit=_("requests"),
2661 default_value=50,
2664 TextAscii(
2665 title=_("Name of the virtual machine"),
2666 help=_("The name of the application server"),
2667 allow_empty=False,
2668 ), "first")
2670 register_check_parameters(
2671 RulespecGroupCheckParametersApplications, "jvm_memory", _("JVM memory levels"),
2672 Dictionary(
2673 help=_("This rule allows to set the warn and crit levels of the heap / "
2674 "non-heap and total memory area usage on web application servers. "
2675 "Other keywords for this rule: Tomcat, Jolokia, JMX. "),
2676 elements=[
2677 ("totalheap",
2678 Alternative(
2679 title=_("Total Memory Levels"),
2680 elements=[
2681 Tuple(
2682 title=_("Percentage levels of used space"),
2683 elements=[
2684 Percentage(title=_("Warning at"), label=_("% usage")),
2685 Percentage(title=_("Critical at"), label=_("% usage")),
2687 Tuple(
2688 title=_("Absolute free space in MB"),
2689 elements=[
2690 Integer(title=_("Warning if below"), unit=_("MB")),
2691 Integer(title=_("Critical if below"), unit=_("MB")),
2693 ])),
2694 ("heap",
2695 Alternative(
2696 title=_("Heap Memory Levels"),
2697 elements=[
2698 Tuple(
2699 title=_("Percentage levels of used space"),
2700 elements=[
2701 Percentage(title=_("Warning at"), label=_("% usage")),
2702 Percentage(title=_("Critical at"), label=_("% usage")),
2704 Tuple(
2705 title=_("Absolute free space in MB"),
2706 elements=[
2707 Integer(title=_("Warning if below"), unit=_("MB")),
2708 Integer(title=_("Critical if below"), unit=_("MB")),
2710 ])),
2711 ("nonheap",
2712 Alternative(
2713 title=_("Nonheap Memory Levels"),
2714 elements=[
2715 Tuple(
2716 title=_("Percentage levels of used space"),
2717 elements=[
2718 Percentage(title=_("Warning at"), label=_("% usage")),
2719 Percentage(title=_("Critical at"), label=_("% usage")),
2721 Tuple(
2722 title=_("Absolute free space in MB"),
2723 elements=[
2724 Integer(title=_("Warning if below"), unit=_("MB")),
2725 Integer(title=_("Critical if below"), unit=_("MB")),
2727 ])),
2728 ("perm",
2729 Tuple(
2730 title=_("Perm Memory usage"),
2731 elements=[
2732 Percentage(title=_("Warning at"), label=_("% usage")),
2733 Percentage(title=_("Critical at"), label=_("% usage")),
2734 ])),
2736 TextAscii(
2737 title=_("Name of the virtual machine"),
2738 help=_("The name of the application server"),
2739 allow_empty=False,
2740 ), "dict")
2742 register_check_parameters(
2743 RulespecGroupCheckParametersApplications, "safenet_hsm_operstats",
2744 _("Safenet HSM Operation Stats"),
2745 Dictionary(elements=[
2746 ("error_rate",
2747 Tuple(
2748 title=_(u"Error rate"),
2749 elements=[
2750 Float(title=_("Warning at"), default_value=0.01, unit=_("1/s")),
2751 Float(title=_("Critical at"), default_value=0.05, unit=_("1/s")),
2752 ])),
2753 ("request_rate", Levels(
2754 title=_(u"Request rate"),
2755 unit=_("1/s"),
2756 default_value=None,
2758 ("operation_errors",
2759 Tuple(
2760 title=_("Operation errors"),
2761 help=_("Sets levels on total operation errors since last counter reset."),
2762 elements=[
2763 Integer(title=_("Warning at"), default_value=0),
2764 Integer(title=_("Critical at"), default_value=1),
2765 ])),
2766 ]), None, "dict")
2768 register_check_parameters(
2769 RulespecGroupCheckParametersApplications, "safenet_hsm_eventstats",
2770 _("Safenet HSM Event Stats"),
2771 Dictionary(elements=[
2772 ("critical_events",
2773 Tuple(
2774 title=_(u"Critical events"),
2775 help=_(u"Sets levels on total critical events since last counter reset."),
2776 elements=[
2777 Integer(title=_("Warning at"), default_value=0),
2778 Integer(title=_("Critical at"), default_value=1),
2779 ])),
2780 ("noncritical_events",
2781 Tuple(
2782 title=_(u"Noncritical events"),
2783 help=_(u"Sets levels on total noncritical events since last counter reset."),
2784 elements=[
2785 Integer(title=_("Warning at"), default_value=0),
2786 Integer(title=_("Critical at"), default_value=1),
2787 ])),
2788 ("critical_event_rate",
2789 Tuple(
2790 title=_(u"Critical event rate"),
2791 elements=[
2792 Float(title=_("Warning at"), default_value=0.0001, unit=_("1/s")),
2793 Float(title=_("Critical at"), default_value=0.0005, unit=_("1/s")),
2794 ])),
2795 ("noncritical_event_rate",
2796 Tuple(
2797 title=_(u"Noncritical event rate"),
2798 elements=[
2799 Float(title=_("Warning at"), default_value=0.0001, unit=_("1/s")),
2800 Float(title=_("Critical at"), default_value=0.0005, unit=_("1/s")),
2801 ])),
2802 ]), None, "dict")
2804 register_check_parameters(RulespecGroupCheckParametersApplications, "safenet_ntls_links",
2805 _(u"Safenet NTLS Links"),
2806 Levels(
2807 title=_(u"NTLS Links"),
2808 default_value=None,
2809 ), None, "dict")
2811 register_check_parameters(
2812 RulespecGroupCheckParametersApplications, "safenet_ntls_clients", _(u"Safenet NTLS Clients"),
2813 Levels(
2814 title=_(u"NTLS Clients"),
2815 help=_(u"Number of connected clients"),
2816 default_value=None,
2817 ), None, "dict")
2819 register_check_parameters(
2820 RulespecGroupCheckParametersApplications,
2821 "fireeye_active_vms",
2822 _("Fireeye Active VMs"),
2823 Dictionary(elements=[(
2824 "vms",
2825 Tuple(
2826 title=_("Levels for active VMs"),
2827 elements=[
2828 Integer(title="Warning at", default_value=60, unit="VMs"),
2829 Integer(title="Critical at", default_value=70, unit="VMs"),
2831 )]),
2832 None,
2833 match_type="dict",
2836 register_check_parameters(
2837 RulespecGroupCheckParametersApplications,
2838 "fireeye_lic",
2839 _("Fireeye Licenses"),
2840 Dictionary(elements=[(
2841 "days",
2842 Tuple(
2843 title=_("Levels for Fireeye License Expiration"),
2844 elements=[
2845 Integer(title="Warning at", default_value=90, unit="days"),
2846 Integer(title="Critical at", default_value=120, unit="days"),
2848 )]),
2849 TextAscii(title=_("License Feature")),
2850 match_type="dict",
2853 register_check_parameters(
2854 RulespecGroupCheckParametersApplications,
2855 "fireeye_quarantine",
2856 _("Fireeye Quarantine Usage"),
2857 Dictionary(elements=[(
2858 "usage",
2859 Tuple(
2860 title=_("Levels for Quarantine Usage"),
2861 elements=[
2862 Integer(title="Warning at", default_value=70, unit="%"),
2863 Integer(title="Critical at", default_value=80, unit="%"),
2865 )]),
2866 None,
2867 match_type="dict",
2870 register_check_parameters(
2871 RulespecGroupCheckParametersApplications,
2872 "fireeye_mailq",
2873 _("Fireeye Mail Queues"),
2874 Dictionary(elements=[
2875 ("deferred",
2876 Tuple(
2877 title=_("Levels for Deferred Queue length"),
2878 elements=[
2879 Integer(title="Warning at", default_value=10, unit="Mails"),
2880 Integer(title="Critical at", default_value=15, unit="Mails"),
2881 ])),
2882 ("hold",
2883 Tuple(
2884 title=_("Levels for Hold Queue length"),
2885 elements=[
2886 Integer(title="Warning at", default_value=500, unit="Mails"),
2887 Integer(title="Critical at", default_value=700, unit="Mails"),
2888 ])),
2889 ("drop",
2890 Tuple(
2891 title=_("Levels for Drop Queue length"),
2892 elements=[
2893 Integer(title="Warning at", default_value=10, unit="Mails"),
2894 Integer(title="Critical at", default_value=15, unit="Mails"),
2895 ])),
2897 None,
2898 match_type="dict",
2901 register_check_parameters(
2902 RulespecGroupCheckParametersApplications,
2903 "fireeye_mail",
2904 _("Fireeye Mail Rate Average"),
2905 Dictionary(elements=[
2907 "interval",
2908 Integer(title="Timespan for mail rate computation", default_value=60, unit="minutes"),
2911 None,
2912 match_type="dict",
2916 def transform_oracle_logswitches(params):
2917 if isinstance(params, tuple):
2918 return {
2919 'levels': (params[2], params[3]),
2920 'levels_lower': (params[1], params[0]),
2922 return params
2925 register_check_parameters(
2926 RulespecGroupCheckParametersApplications,
2927 "oracle_logswitches",
2928 _("Oracle Logswitches"),
2929 Transform(
2930 Dictionary(
2931 help=_("This check monitors the number of log switches of an ORACLE "
2932 "database instance in the last 60 minutes. You can set levels "
2933 "for upper and lower bounds."),
2934 elements=[
2936 'levels',
2937 Tuple(
2938 title=_("Set upper Levels"),
2939 elements=[
2940 Integer(
2941 title=_("Warning at or above"),
2942 unit=_("log switches / hour"),
2943 default_value=50),
2944 Integer(
2945 title=_("Critical at or above"),
2946 unit=_("log switches / hour"),
2947 default_value=100),
2951 'levels_lower',
2952 Tuple(
2953 title=_("Set lower Levels"),
2954 elements=[
2955 Integer(
2956 title=_("Warning at or below"),
2957 unit=_("log switches / hour"),
2958 default_value=-1),
2959 Integer(
2960 title=_("Critical at or below"),
2961 unit=_("log switches / hour"),
2962 default_value=-1),
2967 forth=transform_oracle_logswitches,
2969 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
2970 "first",
2973 register_check_parameters(
2974 RulespecGroupCheckParametersApplications,
2975 "systemd_services",
2976 _("Systemd Services"),
2977 Dictionary(
2978 elements=[
2979 ("states",
2980 Dictionary(
2981 elements=[
2982 ("active",
2983 MonitoringState(
2984 title=_("Monitoring state if service is active"),
2985 default_value=0,
2987 ],)),
2988 ("states_default",
2989 MonitoringState(
2990 title=_("Monitoring state for any other service state"),
2991 default_value=2,
2993 ("else",
2994 MonitoringState(
2995 title=_("Monitoring state if a monitored service is not found at all."),
2996 default_value=2,
2998 ],),
2999 TextAscii(title=_("Name of the service")),
3000 match_type="dict",
3003 register_check_parameters(
3004 RulespecGroupCheckParametersApplications,
3005 "hacmp_resources",
3006 _("AIX HACMP Resource Groups"),
3007 Transform(
3008 Dictionary(
3009 elements=[
3010 ("expect_online_on",
3011 DropdownChoice(
3012 title=_(u"Expect resource to be online on"),
3013 choices=[
3014 ("first", _(u"the first node")),
3015 ("any", _(u"any node")),
3019 optional_keys=[],
3021 forth=lambda x: {"expect_online_on": "first"},
3023 TextAscii(title=_(u"Resource Group")),
3024 match_type="first",
3027 register_check_parameters(
3028 RulespecGroupCheckParametersApplications,
3029 "webserver",
3030 _("Azure web servers (IIS)"),
3031 Dictionary(
3032 elements=[
3034 "avg_response_time_levels",
3035 Tuple(
3036 title=_("Upper levels for average response time"),
3037 elements=[
3038 Float(title=_("Warning at"), default_value=1.00, unit="s"),
3039 Float(title=_("Critical at"), default_value=10.0, unit="s"),
3043 "error_rate_levels",
3044 Tuple(
3045 title=_("Upper levels for rate of server errors"),
3046 elements=[
3047 Float(title=_("Warning at"), default_value=0.01, unit="1/s"),
3048 Float(title=_("Critical at"), default_value=0.04, unit="1/s"),
3052 "cpu_time_percent_levels",
3053 Tuple(
3054 title=_("Upper levels for CPU time"),
3055 elements=[
3056 Float(title=_("Warning at"), default_value=85., unit="%"),
3057 Float(title=_("Critical at"), default_value=95., unit="%"),
3060 ],),
3061 TextAscii(title=_("Name of the service")),
3062 match_type="dict",
3066 # .--Environment---------------------------------------------------------.
3067 # | _____ _ _ |
3068 # | | ____|_ ____ _(_)_ __ ___ _ __ _ __ ___ ___ _ __ | |_ |
3069 # | | _| | '_ \ \ / / | '__/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| |
3070 # | | |___| | | \ V /| | | | (_) | | | | | | | | | __/ | | | |_ |
3071 # | |_____|_| |_|\_/ |_|_| \___/|_| |_|_| |_| |_|\___|_| |_|\__| |
3072 # | |
3073 # '----------------------------------------------------------------------'
3075 register_check_parameters(
3076 RulespecGroupCheckParametersEnvironment,
3077 "voltage",
3078 _("Voltage Sensor"),
3079 Dictionary(
3080 title=_("Voltage Sensor"),
3081 optional_keys=True,
3082 elements=[
3083 ("levels",
3084 Tuple(
3085 title=_("Upper Levels for Voltage"),
3086 elements=[
3087 Float(title=_("Warning at"), default_value=15.00, unit="V"),
3088 Float(title=_("Critical at"), default_value=16.00, unit="V"),
3089 ])),
3090 ("levels_lower",
3091 Tuple(
3092 title=_("Lower Levels for Voltage"),
3093 elements=[
3094 Float(title=_("Warning below"), default_value=10.00, unit="V"),
3095 Float(title=_("Critical below"), default_value=9.00, unit="V"),
3096 ])),
3098 TextAscii(title=_("Sensor Description and Index"),),
3099 match_type="dict",
3102 register_check_parameters(
3103 RulespecGroupCheckParametersEnvironment,
3104 "fan_failures",
3105 _("Number of fan failures"),
3106 Tuple(
3107 title=_("Number of fan failures"),
3108 elements=[
3109 Integer(title="Warning at", default_value=1),
3110 Integer(title="Critical at", default_value=2),
3112 None,
3113 "first",
3116 register_check_parameters(
3117 RulespecGroupCheckParametersEnvironment,
3118 "pll_lock_voltage",
3119 _("Lock Voltage for PLLs"),
3120 Dictionary(
3121 help=_("PLL lock voltages by freqency"),
3122 elements=[
3123 ("rx",
3124 ListOf(
3125 Tuple(
3126 elements=[
3127 Float(title=_("Frequencies up to"), unit=u"MHz"),
3128 Float(title=_("Warning below"), unit=u"V"),
3129 Float(title=_("Critical below"), unit=u"V"),
3130 Float(title=_("Warning at or above"), unit=u"V"),
3131 Float(title=_("Critical at or above"), unit=u"V"),
3132 ],),
3133 title=_("Lock voltages for RX PLL"),
3134 help=_("Specify frequency ranges by the upper boundary of the range "
3135 "to which the voltage levels are to apply. The list is sorted "
3136 "automatically when saving."),
3137 movable=False)),
3138 ("tx",
3139 ListOf(
3140 Tuple(
3141 elements=[
3142 Float(title=_("Frequencies up to"), unit=u"MHz"),
3143 Float(title=_("Warning below"), unit=u"V"),
3144 Float(title=_("Critical below"), unit=u"V"),
3145 Float(title=_("Warning at or above"), unit=u"V"),
3146 Float(title=_("Critical at or above"), unit=u"V"),
3147 ],),
3148 title=_("Lock voltages for TX PLL"),
3149 help=_("Specify frequency ranges by the upper boundary of the range "
3150 "to which the voltage levels are to apply. The list is sorted "
3151 "automatically when saving."),
3152 movable=False)),
3154 optional_keys=["rx", "tx"],
3156 DropdownChoice(title=_("RX/TX"), choices=[("RX", _("RX")), ("TX", _("TX"))]),
3157 match_type="dict",
3160 register_check_parameters(
3161 RulespecGroupCheckParametersEnvironment,
3162 "ipmi",
3163 _("IPMI sensors"),
3164 Dictionary(
3165 elements=[
3166 ("sensor_states",
3167 ListOf(
3168 Tuple(elements=[TextAscii(), MonitoringState()]),
3169 title=_("Set states of IPMI sensor status texts"),
3170 help=_("The pattern specified here must match exactly the beginning of "
3171 "the sensor state (case sensitive)."),
3172 orientation="horizontal",
3174 ("ignored_sensors",
3175 ListOfStrings(
3176 title=_("Ignore the following IPMI sensors"),
3177 help=_("Names of IPMI sensors that should be ignored during discovery "
3178 "and when summarizing."
3179 "The pattern specified here must match exactly the beginning of "
3180 "the actual sensor name (case sensitive)."),
3181 orientation="horizontal")),
3182 ("ignored_sensorstates",
3183 ListOfStrings(
3184 title=_("Ignore the following IPMI sensor states"),
3185 help=_("IPMI sensors with these states that should be ignored during discovery "
3186 "and when summarizing."
3187 "The pattern specified here must match exactly the beginning of "
3188 "the actual sensor name (case sensitive)."),
3189 orientation="horizontal",
3190 default_value=["nr", "ns"])),
3191 ("numerical_sensor_levels",
3192 ListOf(
3193 Tuple(
3194 elements=[
3195 TextAscii(
3196 title=_("Sensor name (only summary)"),
3197 help=_(
3198 "In summary mode you have to state the sensor name. "
3199 "In single mode the sensor name comes from service description.")),
3200 Dictionary(elements=[
3201 ("lower",
3202 Tuple(title=_("Lower levels"), elements=[Float(), Float()])),
3203 ("upper",
3204 Tuple(title=_("Upper levels"), elements=[Float(), Float()])),
3206 ],),
3207 title=_("Set lower and upper levels for numerical sensors"))),
3209 ignored_keys=["ignored_sensors", "ignored_sensor_states"],
3211 TextAscii(title=_("The sensor name")),
3212 "dict",
3215 register_check_parameters(
3216 RulespecGroupCheckParametersEnvironment,
3217 "ps_voltage",
3218 _("Output Voltage of Power Supplies"),
3219 Tuple(
3220 elements=[
3221 Float(title=_("Warning below"), unit=u"V"),
3222 Float(title=_("Critical below"), unit=u"V"),
3223 Float(title=_("Warning at or above"), unit=u"V"),
3224 Float(title=_("Critical at or above"), unit=u"V"),
3225 ],),
3226 None,
3227 match_type="first",
3230 bvip_link_states = [
3231 (0, "No Link"),
3232 (1, "10 MBit - HalfDuplex"),
3233 (2, "10 MBit - FullDuplex"),
3234 (3, "100 Mbit - HalfDuplex"),
3235 (4, "100 Mbit - FullDuplex"),
3236 (5, "1 Gbit - FullDuplex"),
3237 (7, "Wifi"),
3240 register_check_parameters(
3241 RulespecGroupCheckParametersEnvironment,
3242 "bvip_link",
3243 _("Allowed Network states on Bosch IP Cameras"),
3244 Dictionary(
3245 title=_("Update State"),
3246 elements=[
3247 ("ok_states",
3248 ListChoice(
3249 title=_("States which result in OK"),
3250 choices=bvip_link_states,
3251 default_value=[0, 4, 5])),
3252 ("warn_states",
3253 ListChoice(
3254 title=_("States which result in Warning"),
3255 choices=bvip_link_states,
3256 default_value=[7])),
3257 ("crit_states",
3258 ListChoice(
3259 title=_("States which result in Critical"),
3260 choices=bvip_link_states,
3261 default_value=[1, 2, 3])),
3263 optional_keys=None,
3265 None,
3266 match_type="dict",
3269 register_check_parameters(
3270 RulespecGroupCheckParametersEnvironment,
3271 "ocprot_current",
3272 _("Electrical Current of Overcurrent Protectors"),
3273 Tuple(
3274 elements=[
3275 Float(title=_("Warning at"), unit=u"A", default_value=14.0),
3276 Float(title=_("Critical at"), unit=u"A", default_value=15.0),
3277 ],),
3278 TextAscii(title=_("The Index of the Overcurrent Protector")),
3279 match_type="first",
3282 register_check_parameters(
3283 RulespecGroupCheckParametersEnvironment,
3284 'brightness',
3285 _("Brightness Levels"),
3286 Levels(
3287 title=_("Brightness"),
3288 unit=_("lx"),
3289 default_value=None,
3290 default_difference=(2.0, 4.0),
3291 default_levels=(50.0, 100.0),
3293 TextAscii(
3294 title=_("Sensor name"),
3295 help=_("The identifier of the sensor."),
3297 match_type="dict",
3300 register_check_parameters(
3301 RulespecGroupCheckParametersEnvironment,
3302 'motion',
3303 _("Motion Detectors"),
3304 Dictionary(elements=[
3305 ("time_periods",
3306 Dictionary(
3307 title=_("Time periods"),
3308 help=_("Specifiy time ranges during which no motion is expected. "
3309 "Outside these times, the motion detector will always be in "
3310 "state OK"),
3311 elements=[(day_id, ListOfTimeRanges(title=day_str))
3312 for day_id, day_str in defines.weekdays_by_name()],
3313 optional_keys=[])),
3315 TextAscii(
3316 title=_("Sensor name"),
3317 help=_("The identifier of the sensor."),
3319 match_type="dict")
3321 register_check_parameters(
3322 RulespecGroupCheckParametersEnvironment,
3323 'ewon',
3324 _("eWON SNMP Proxy"),
3325 Dictionary(
3326 title=_("Device Type"),
3327 help=_("The eWON router can act as a proxy to metrics from a secondary non-snmp device."
3328 "Here you can make settings to the monitoring of the proxied device."),
3329 elements=[("oxyreduct",
3330 Dictionary(
3331 title=_("Wagner OxyReduct"),
3332 elements=[("o2_levels",
3333 Tuple(
3334 title=_("O2 levels"),
3335 elements=[
3336 Percentage(title=_("Warning at"), default_value=16.0),
3337 Percentage(title=_("Critical at"), default_value=17.0),
3338 Percentage(title=_("Warning below"), default_value=14.0),
3339 Percentage(title=_("Critical below"), default_value=13.0),
3340 ]))]))]),
3341 TextAscii(
3342 title=_("Item name"),
3343 help=_("The item name. The meaning of this depends on the proxied device: "
3344 "- Wagner OxyReduct: Name of the room/protection zone")),
3345 match_type="dict")
3347 register_check_parameters(
3348 RulespecGroupCheckParametersEnvironment,
3349 "lamp_operation_time",
3350 _("Beamer lamp operation time"),
3351 Tuple(elements=[
3352 Age(title=_("Warning at"), default_value=1000 * 3600, display=["hours"]),
3353 Age(title=_("Critical at"), default_value=1500 * 3600, display=["hours"]),
3355 None,
3356 match_type="first",
3360 def transform_apc_symmetra(params):
3361 if isinstance(params, (list, tuple)):
3362 params = {"levels": params}
3364 if "levels" in params and len(params["levels"]) > 2:
3365 cap = float(params["levels"][0])
3366 params["capacity"] = (cap, cap)
3367 del params["levels"]
3369 if "output_load" in params:
3370 del params["output_load"]
3372 return params
3375 register_check_parameters(
3376 RulespecGroupCheckParametersEnvironment, "apc_symentra", _("APC Symmetra Checks"),
3377 Transform(
3378 Dictionary(
3379 elements=[
3380 ("capacity",
3381 Tuple(
3382 title=_("Levels of battery capacity"),
3383 elements=[
3384 Percentage(
3385 title=_("Warning below"),
3386 default_value=95.0,
3388 Percentage(
3389 title=_("Critical below"),
3390 default_value=90.0,
3392 ])),
3393 ("calibration_state",
3394 MonitoringState(
3395 title=_("State if calibration is invalid"),
3396 default_value=0,
3398 ("post_calibration_levels",
3399 Dictionary(
3400 title=_("Levels of battery parameters after calibration"),
3401 help=_(
3402 "After a battery calibration the battery capacity is reduced until the "
3403 "battery is fully charged again. Here you can specify an alternative "
3404 "lower level in this post-calibration phase. "
3405 "Since apc devices remember the time of the last calibration only "
3406 "as a date, the alternative lower level will be applied on the whole "
3407 "day of the calibration until midnight. You can extend this time period "
3408 "with an additional time span to make sure calibrations occuring just "
3409 "before midnight do not trigger false alarms."),
3410 elements=[
3411 ("altcapacity",
3412 Percentage(
3413 title=_("Alternative critical battery capacity after calibration"),
3414 default_value=50,
3416 ("additional_time_span",
3417 Integer(
3418 title=("Extend post-calibration phase by additional time span"),
3419 unit=_("minutes"),
3420 default_value=0,
3423 optional_keys=False,
3425 ("battime",
3426 Tuple(
3427 title=_("Time left on battery"),
3428 elements=[
3429 Age(title=_("Warning at"),
3430 help=
3431 _("Time left on Battery at and below which a warning state is triggered"
3433 default_value=0,
3434 display=["hours", "minutes"]),
3435 Age(title=_("Critical at"),
3436 help=
3437 _("Time Left on Battery at and below which a critical state is triggered"
3439 default_value=0,
3440 display=["hours", "minutes"]),
3443 ("battery_replace_state",
3444 MonitoringState(
3445 title=_("State if battery needs replacement"),
3446 default_value=1,
3449 optional_keys=['post_calibration_levels', 'output_load', 'battime'],
3451 forth=transform_apc_symmetra,
3452 ), None, "first")
3454 register_check_parameters(
3455 RulespecGroupCheckParametersEnvironment,
3456 'hw_psu',
3457 _("Power Supply Unit"),
3458 Dictionary(
3459 elements=[
3460 ("levels",
3461 Tuple(
3462 title=_("PSU Capacity Levels"),
3463 elements=[
3464 Percentage(title=_("Warning at"), default_value=80.0),
3465 Percentage(title=_("Critical at"), default_value=90.0),
3468 ],),
3469 TextAscii(title=_("PSU (Chassis/Bay)")),
3470 match_type="dict")
3473 # .--Storage-------------------------------------------------------------.
3474 # | ____ _ |
3475 # | / ___|| |_ ___ _ __ __ _ __ _ ___ |
3476 # | \___ \| __/ _ \| '__/ _` |/ _` |/ _ \ |
3477 # | ___) | || (_) | | | (_| | (_| | __/ |
3478 # | |____/ \__\___/|_| \__,_|\__, |\___| |
3479 # | |___/ |
3480 # '----------------------------------------------------------------------'
3482 register_check_parameters(
3483 RulespecGroupCheckParametersStorage,
3484 "disk_failures",
3485 _("Number of disk failures"),
3486 Tuple(
3487 title=_("Number of disk failures"),
3488 elements=[
3489 Integer(title="Warning at", default_value=1),
3490 Integer(title="Critical at", default_value=2),
3492 None,
3493 "first",
3496 register_check_parameters(
3497 RulespecGroupCheckParametersStorage, "ddn_s2a_port_errors", _("Port errors of DDN S2A devices"),
3498 Dictionary(
3499 elements=[
3500 ("link_failure_errs",
3501 Tuple(
3502 title=_(u"Link failure errors"),
3503 elements=[
3504 Integer(title=_(u"Warning at")),
3505 Integer(title=_(u"Critical at")),
3506 ])),
3507 ("lost_sync_errs",
3508 Tuple(
3509 title=_(u"Lost synchronization errors"),
3510 elements=[
3511 Integer(title=_(u"Warning at")),
3512 Integer(title=_(u"Critical at")),
3513 ])),
3514 ("loss_of_signal_errs",
3515 Tuple(
3516 title=_(u"Loss of signal errors"),
3517 elements=[
3518 Integer(title=_(u"Warning at")),
3519 Integer(title=_(u"Critical at")),
3520 ])),
3521 ("prim_seq_errs",
3522 Tuple(
3523 title=_(u"PrimSeq erros"),
3524 elements=[
3525 Integer(title=_(u"Warning at")),
3526 Integer(title=_(u"Critical at")),
3527 ])),
3528 ("crc_errs",
3529 Tuple(
3530 title=_(u"CRC errors"),
3531 elements=[
3532 Integer(title=_(u"Warning at")),
3533 Integer(title=_(u"Critical at")),
3534 ])),
3535 ("receive_errs",
3536 Tuple(
3537 title=_(u"Receive errors"),
3538 elements=[
3539 Integer(title=_(u"Warning at")),
3540 Integer(title=_(u"Critical at")),
3541 ])),
3542 ("ctio_timeouts",
3543 Tuple(
3544 title=_(u"CTIO timeouts"),
3545 elements=[
3546 Integer(title=_(u"Warning at")),
3547 Integer(title=_(u"Critical at")),
3548 ])),
3549 ("ctio_xmit_errs",
3550 Tuple(
3551 title=_(u"CTIO transmission errors"),
3552 elements=[
3553 Integer(title=_(u"Warning at")),
3554 Integer(title=_(u"Critical at")),
3555 ])),
3556 ("ctio_other_errs",
3557 Tuple(
3558 title=_(u"other CTIO errors"),
3559 elements=[
3560 Integer(title=_(u"Warning at")),
3561 Integer(title=_(u"Critical at")),
3562 ])),
3563 ],), TextAscii(title="Port index"), "dict")
3565 register_check_parameters(
3566 RulespecGroupCheckParametersStorage, "read_hits", _(u"Read prefetch hits for DDN S2A devices"),
3567 Tuple(
3568 title=_(u"Prefetch hits"),
3569 elements=[
3570 Float(title=_(u"Warning below"), default_value=95.0),
3571 Float(title=_(u"Critical below"), default_value=90.0),
3572 ]), TextAscii(title=_(u"Port index or 'Total'")), "first")
3574 register_check_parameters(
3575 RulespecGroupCheckParametersStorage, "storage_iops", _(u"I/O operations for DDN S2A devices"),
3576 Dictionary(elements=[
3577 ("read",
3578 Tuple(
3579 title=_(u"Read IO operations per second"),
3580 elements=[
3581 Float(title=_(u"Warning at"), unit="1/s"),
3582 Float(title=_(u"Critical at"), unit="1/s"),
3583 ])),
3584 ("write",
3585 Tuple(
3586 title=_(u"Write IO operations per second"),
3587 elements=[
3588 Float(title=_(u"Warning at"), unit="1/s"),
3589 Float(title=_(u"Critical at"), unit="1/s"),
3590 ])),
3591 ("total",
3592 Tuple(
3593 title=_(u"Total IO operations per second"),
3594 elements=[
3595 Float(title=_(u"Warning at"), unit="1/s"),
3596 Float(title=_(u"Critical at"), unit="1/s"),
3597 ])),
3598 ]), TextAscii(title=_(u"Port index or 'Total'")), "dict")
3600 register_check_parameters(
3601 RulespecGroupCheckParametersStorage, "storage_throughput", _(u"Throughput for DDN S2A devices"),
3602 Dictionary(elements=[
3603 ("read",
3604 Tuple(
3605 title=_(u"Read throughput per second"),
3606 elements=[
3607 Filesize(title=_(u"Warning at")),
3608 Filesize(title=_(u"Critical at")),
3609 ])),
3610 ("write",
3611 Tuple(
3612 title=_(u"Write throughput per second"),
3613 elements=[
3614 Filesize(title=_(u"Warning at")),
3615 Filesize(title=_(u"Critical at")),
3616 ])),
3617 ("total",
3618 Tuple(
3619 title=_(u"Total throughput per second"),
3620 elements=[
3621 Filesize(title=_(u"Warning at")),
3622 Filesize(title=_(u"Critical at")),
3623 ])),
3624 ]), TextAscii(title=_(u"Port index or 'Total'")), "dict")
3626 register_check_parameters(
3627 RulespecGroupCheckParametersStorage, "ddn_s2a_wait", _(u"Read/write wait for DDN S2A devices"),
3628 Dictionary(elements=[
3629 ("read_avg",
3630 Tuple(
3631 title=_(u"Read wait average"),
3632 elements=[
3633 Float(title=_(u"Warning at"), unit="s"),
3634 Float(title=_(u"Critical at"), unit="s"),
3635 ])),
3636 ("read_min",
3637 Tuple(
3638 title=_(u"Read wait minimum"),
3639 elements=[
3640 Float(title=_(u"Warning at"), unit="s"),
3641 Float(title=_(u"Critical at"), unit="s"),
3642 ])),
3643 ("read_max",
3644 Tuple(
3645 title=_(u"Read wait maximum"),
3646 elements=[
3647 Float(title=_(u"Warning at"), unit="s"),
3648 Float(title=_(u"Critical at"), unit="s"),
3649 ])),
3650 ("write_avg",
3651 Tuple(
3652 title=_(u"Write wait average"),
3653 elements=[
3654 Float(title=_(u"Warning at"), unit="s"),
3655 Float(title=_(u"Critical at"), unit="s"),
3656 ])),
3657 ("write_min",
3658 Tuple(
3659 title=_(u"Write wait minimum"),
3660 elements=[
3661 Float(title=_(u"Warning at"), unit="s"),
3662 Float(title=_(u"Critical at"), unit="s"),
3663 ])),
3664 ("write_max",
3665 Tuple(
3666 title=_(u"Write wait maximum"),
3667 elements=[
3668 Float(title=_(u"Warning at"), unit="s"),
3669 Float(title=_(u"Critical at"), unit="s"),
3670 ])),
3672 DropdownChoice(title=_(u"Host or Disk"), choices=[
3673 ("Disk", _(u"Disk")),
3674 ("Host", _(u"Host")),
3675 ]), "dict")
3677 register_check_parameters(
3678 RulespecGroupCheckParametersStorage,
3679 "blank_tapes",
3680 _("Remaining blank tapes in DIVA CSM Devices"),
3681 Tuple(
3682 elements=[
3683 Integer(title=_("Warning below"), default_value=5),
3684 Integer(title=_("Critical below"), default_value=1),
3685 ],),
3686 None,
3687 match_type="first",
3690 register_check_parameters(
3691 RulespecGroupCheckParametersStorage,
3692 "mongodb_flushing",
3693 _("MongoDB Flushes"),
3694 Dictionary(elements=[
3696 "average_time",
3697 Tuple(
3698 title=_("Average flush time"),
3699 elements=[
3700 Integer(title=_("Warning at"), unit="ms", default_value=50),
3701 Integer(title=_("Critical at"), unit="ms", default_value=100),
3702 Integer(title=_("Time interval"), unit="minutes", default_value=10),
3706 "last_time",
3707 Tuple(
3708 title=_("Last flush time"),
3709 elements=[
3710 Integer(title=_("Warning at"), unit="ms", default_value=50),
3711 Integer(title=_("Critical at"), unit="ms", default_value=100),
3715 None,
3716 match_type="dict")
3718 register_check_parameters(
3719 RulespecGroupCheckParametersStorage,
3720 "mongodb_asserts",
3721 _("MongoDB Assert Rates"),
3722 Dictionary(
3723 elements=[("%s_assert_rate" % what,
3724 Tuple(
3725 title=_("%s rate") % what.title(),
3726 elements=[
3727 Float(title=_("Warning at"), unit=_("Asserts / s"), default_value=1.0),
3728 Float(title=_("Critical at"), unit=_("Asserts / s"), default_value=2.0),
3729 ])) for what in ["msg", "rollovers", "regular", "warning", "user"]],),
3730 None,
3731 match_type="dict")
3733 register_check_parameters(
3734 RulespecGroupCheckParametersStorage,
3735 "mongodb_mem",
3736 _("MongoDB Memory"),
3737 Dictionary(
3738 title=_("MongoDB Memory"),
3739 elements=[
3740 ("resident_levels",
3741 Tuple(
3742 title=_("Resident memory usage"),
3743 help=
3744 _("The value of resident is roughly equivalent to the amount of RAM, "
3745 "currently used by the database process. In normal use this value tends to grow. "
3746 "In dedicated database servers this number tends to approach the total amount of system memory."
3748 elements=[
3749 Filesize(title=_("Warning at"), default_value=1 * 1024**3),
3750 Filesize(title=_("Critical at"), default_value=2 * 1024**3),
3753 ("mapped_levels",
3754 Tuple(
3755 title=_("Mapped memory usage"),
3756 help=_(
3757 "The value of mapped shows the amount of mapped memory by the database. "
3758 "Because MongoDB uses memory-mapped files, this value is likely to be to be "
3759 "roughly equivalent to the total size of your database or databases."),
3760 elements=[
3761 Filesize(title=_("Warning at"), default_value=1 * 1024**3),
3762 Filesize(title=_("Critical at"), default_value=2 * 1024**3),
3765 ("virtual_levels",
3766 Tuple(
3767 title=_("Virtual memory usage"),
3768 help=_(
3769 "Virtual displays the quantity of virtual memory used by the mongod process. "
3771 elements=[
3772 Filesize(title=_("Warning at"), default_value=2 * 1024**3),
3773 Filesize(title=_("Critical at"), default_value=4 * 1024**3),
3777 None,
3778 match_type="dict")
3780 register_check_parameters(
3781 RulespecGroupCheckParametersStorage,
3782 "openhardwaremonitor_smart",
3783 _("OpenHardwareMonitor S.M.A.R.T."),
3784 Dictionary(elements=[
3785 ("remaining_life",
3786 Tuple(
3787 title=_("Remaining Life"),
3788 help=_("Estimated remaining health of the disk based on other readings."),
3789 elements=[
3790 Percentage(title=_("Warning below"), default_value=30),
3791 Percentage(title=_("Critical below"), default_value=10),
3795 TextAscii(
3796 title=_("Device Name"),
3797 help=_("Name of the Hard Disk as reported by OHM: hdd0, hdd1, ..."),
3799 match_type="dict")
3801 register_check_parameters(
3802 RulespecGroupCheckParametersStorage,
3803 "mongodb_locks",
3804 _("MongoDB Locks"),
3805 Dictionary(
3806 elements=[("%s_locks" % what,
3807 Tuple(
3808 title=_("%s Locks") % what.title().replace("_", " "),
3809 elements=[
3810 Integer(title=_("Warning at"), minvalue=0),
3811 Integer(title=_("Critical at"), minvalue=0),
3812 ])) for what in [
3813 "clients_readers", "clients_writers", "clients_total", "queue_readers",
3814 "queue_writers", "queue_total"
3815 ]],),
3816 None,
3817 match_type="dict")
3819 register_check_parameters(
3820 RulespecGroupCheckParametersStorage,
3821 "prism_container",
3822 _("Nutanix Prism"),
3823 Dictionary(
3824 elements=[("levels",
3825 Alternative(
3826 title=_("Usage levels"),
3827 default_value=(80.0, 90.0),
3828 elements=[
3829 Tuple(
3830 title=_("Specify levels in percentage of total space"),
3831 elements=[
3832 Percentage(title=_("Warning at"), unit=_("%")),
3833 Percentage(title=_("Critical at"), unit=_("%"))
3835 Tuple(
3836 title=_("Specify levels in absolute usage"),
3837 elements=[
3838 Filesize(
3839 title=_("Warning at"), default_value=1000 * 1024 * 1024),
3840 Filesize(
3841 title=_("Critical at"), default_value=5000 * 1024 * 1024)
3843 ]))],
3844 optional_keys=[]),
3845 TextAscii(
3846 title=_("Container Name"),
3847 help=_("Name of the container"),
3849 match_type="dict")
3851 register_check_parameters(
3852 RulespecGroupCheckParametersStorage,
3853 "inotify",
3854 _("INotify Levels"),
3855 Dictionary(
3856 help=_("This rule allows you to set levels for specific Inotify changes. "
3857 "Keep in mind that you can only monitor operations which are actually "
3858 "enabled in the Inotify plugin. So it might be a good idea to cross check "
3859 "these levels here with the configuration rule in the agent bakery. "),
3860 elements=[
3861 ('age_last_operation',
3862 ListOf(
3863 Tuple(
3864 elements=[
3865 DropdownChoice(
3866 title=_("INotify Operation"),
3867 choices=[
3868 ("create", _("Create")),
3869 ("delete", _("Delete")),
3870 ("open", _("Open")),
3871 ("modify", _("Modify")),
3872 ("access", _("Access")),
3873 ("movedfrom", _("Moved from")),
3874 ("movedto", _("Moved to")),
3875 ("moveself", _("Move self")),
3877 Age(title=_("Warning at")),
3878 Age(title=_("Critical at")),
3879 ],),
3880 title=_("Age of last operation"),
3881 movable=False)),
3883 optional_keys=None,
3885 TextAscii(title=_("The filesystem path, prefixed with <i>File </i> or <i>Folder </i>"),),
3886 match_type="dict")
3888 register_check_parameters(
3889 RulespecGroupCheckParametersStorage,
3890 "emcvnx_disks",
3891 _("EMC VNX Enclosures"),
3892 Dictionary(elements=[
3893 ("state_read_error",
3894 Tuple(
3895 title=_("State on hard read error"),
3896 elements=[
3897 MonitoringState(
3898 title=_("State"),
3899 default_value=2,
3901 Integer(
3902 title=_("Minimum error count"),
3903 default_value=2,
3905 ])),
3906 ("state_write_error",
3907 Tuple(
3908 title=_("State on hard write error"),
3909 elements=[
3910 MonitoringState(
3911 title=_("State"),
3912 default_value=2,
3914 Integer(
3915 title=_("Minimum error count"),
3916 default_value=2,
3918 ])),
3919 ("state_rebuilding",
3920 MonitoringState(default_value=1, title=_("State when rebuildung enclosure"))),
3922 TextAscii(title=_("Enclosure ID"), allow_empty=True),
3923 match_type="dict",
3926 register_check_parameters(
3927 RulespecGroupCheckParametersStorage,
3928 "lvm_lvs_pools",
3929 _("Logical Volume Pools (LVM)"),
3930 Dictionary(elements=[
3932 "levels_meta",
3933 Tuple(
3934 title=_("Levels for Meta"),
3935 default_value=(80.0, 90.0),
3936 elements=[
3937 Percentage(title=_("Warning at"), unit=_("%")),
3938 Percentage(title=_("Critical at"), unit=_("%"))
3942 "levels_data",
3943 Tuple(
3944 title=_("Levels for Data"),
3945 default_value=(80.0, 90.0),
3946 elements=[
3947 Percentage(title=_("Warning at"), unit=_("%")),
3948 Percentage(title=_("Critical at"), unit=_("%"))
3952 TextAscii(
3953 title=_("Logical Volume Pool"),
3954 allow_empty=True,
3956 match_type="dict")
3958 register_check_parameters(
3959 RulespecGroupCheckParametersStorage,
3960 "emcvnx_storage_pools",
3961 _("EMC VNX storage pools"),
3962 Dictionary(elements=[
3963 ("percent_full",
3964 Tuple(
3965 title=_("Upper levels for physical capacity in percent"),
3966 elements=[
3967 Percentage(title=_("Warning at"), default_value=70.0),
3968 Percentage(title=_("Critical at"), default_value=90.0),
3969 ])),
3971 TextAscii(title=_("Pool name")),
3972 match_type="dict",
3975 register_check_parameters(
3976 RulespecGroupCheckParametersStorage,
3977 "emcvnx_storage_pools_tiering",
3978 _("EMC VNX storage pools tiering"),
3979 Dictionary(elements=[
3980 ("time_to_complete",
3981 Tuple(
3982 title=_("Upper levels for estimated time to complete"),
3983 elements=[
3984 Age(title=_("Warning at"), default_value=300 * 60 * 60),
3985 Age(title=_("Critical at"), default_value=350 * 60 * 60),
3986 ])),
3988 TextAscii(title=_("Pool name")),
3989 match_type="dict",
3992 register_check_parameters(
3993 RulespecGroupCheckParametersStorage,
3994 "filehandler",
3995 _("Filehandler"),
3996 Dictionary(elements=[
3998 "levels",
3999 Tuple(
4000 title=_("Levels"),
4001 default_value=(80.0, 90.0),
4002 elements=[
4003 Percentage(title=_("Warning at"), unit=_("%")),
4004 Percentage(title=_("Critical at"), unit=_("%"))
4008 None,
4009 match_type="dict")
4011 register_check_parameters(
4012 RulespecGroupCheckParametersStorage,
4013 "brocade_fcport",
4014 _("Brocade FibreChannel ports"),
4015 Dictionary(
4016 elements=[(
4017 "bw",
4018 Alternative(
4019 title=_("Throughput levels"),
4020 help=_("Please note: in a few cases the automatic detection of the link speed "
4021 "does not work. In these cases you have to set the link speed manually "
4022 "below if you want to monitor percentage values"),
4023 elements=[
4024 Tuple(
4025 title=_("Used bandwidth of port relative to the link speed"),
4026 elements=[
4027 Percentage(title=_("Warning at"), unit=_("percent")),
4028 Percentage(title=_("Critical at"), unit=_("percent")),
4030 Tuple(
4031 title=_("Used Bandwidth of port in megabyte/s"),
4032 elements=[
4033 Integer(title=_("Warning at"), unit=_("MByte/s")),
4034 Integer(title=_("Critical at"), unit=_("MByte/s")),
4036 ])),
4037 ("assumed_speed",
4038 Float(
4039 title=_("Assumed link speed"),
4040 help=_("If the automatic detection of the link speed does "
4041 "not work you can set the link speed here."),
4042 unit=_("GByte/s"))),
4043 ("rxcrcs",
4044 Tuple(
4045 title=_("CRC errors rate"),
4046 elements=[
4047 Percentage(title=_("Warning at"), unit=_("percent")),
4048 Percentage(title=_("Critical at"), unit=_("percent")),
4049 ])),
4050 ("rxencoutframes",
4051 Tuple(
4052 title=_("Enc-Out frames rate"),
4053 elements=[
4054 Percentage(title=_("Warning at"), unit=_("percent")),
4055 Percentage(title=_("Critical at"), unit=_("percent")),
4056 ])),
4057 ("rxencinframes",
4058 Tuple(
4059 title=_("Enc-In frames rate"),
4060 elements=[
4061 Percentage(title=_("Warning at"), unit=_("percent")),
4062 Percentage(title=_("Critical at"), unit=_("percent")),
4063 ])),
4064 ("notxcredits",
4065 Tuple(
4066 title=_("No-TxCredits errors"),
4067 elements=[
4068 Percentage(title=_("Warning at"), unit=_("percent")),
4069 Percentage(title=_("Critical at"), unit=_("percent")),
4070 ])),
4071 ("c3discards",
4072 Tuple(
4073 title=_("C3 discards"),
4074 elements=[
4075 Percentage(title=_("Warning at"), unit=_("percent")),
4076 Percentage(title=_("Critical at"), unit=_("percent")),
4077 ])),
4078 ("average",
4079 Integer(
4080 title=_("Averaging"),
4081 help=_(
4082 "If this parameter is set, all throughputs will be averaged "
4083 "over the specified time interval before levels are being applied. Per "
4084 "default, averaging is turned off. "),
4085 unit=_("minutes"),
4086 minvalue=1,
4087 default_value=60,
4089 ("phystate",
4090 Optional(
4091 ListChoice(
4092 title=_("Allowed states (otherwise check will be critical)"),
4093 choices=[
4094 (1, _("noCard")),
4095 (2, _("noTransceiver")),
4096 (3, _("laserFault")),
4097 (4, _("noLight")),
4098 (5, _("noSync")),
4099 (6, _("inSync")),
4100 (7, _("portFault")),
4101 (8, _("diagFault")),
4102 (9, _("lockRef")),
4104 title=_("Physical state of port"),
4105 negate=True,
4106 label=_("ignore physical state"),
4108 ("opstate",
4109 Optional(
4110 ListChoice(
4111 title=_("Allowed states (otherwise check will be critical)"),
4112 choices=[
4113 (0, _("unknown")),
4114 (1, _("online")),
4115 (2, _("offline")),
4116 (3, _("testing")),
4117 (4, _("faulty")),
4119 title=_("Operational state"),
4120 negate=True,
4121 label=_("ignore operational state"),
4123 ("admstate",
4124 Optional(
4125 ListChoice(
4126 title=_("Allowed states (otherwise check will be critical)"),
4127 choices=[
4128 (1, _("online")),
4129 (2, _("offline")),
4130 (3, _("testing")),
4131 (4, _("faulty")),
4133 title=_("Administrative state"),
4134 negate=True,
4135 label=_("ignore administrative state"),
4136 ))]),
4137 TextAscii(
4138 title=_("port name"),
4139 help=_("The name of the switch port"),
4141 match_type="dict",
4144 register_check_parameters(
4145 RulespecGroupCheckParametersStorage, "brocade_sfp", _("Brocade SFPs"),
4146 Dictionary(elements=[
4147 ("rx_power",
4148 Tuple(
4149 title=_("Rx power level"),
4150 elements=[
4151 Float(title=_("Critical below"), unit=_("dBm")),
4152 Float(title=_("Warning below"), unit=_("dBm")),
4153 Float(title=_("Warning at"), unit=_("dBm")),
4154 Float(title=_("Critical at"), unit=_("dBm"))
4155 ])),
4156 ("tx_power",
4157 Tuple(
4158 title=_("Tx power level"),
4159 elements=[
4160 Float(title=_("Critical below"), unit=_("dBm")),
4161 Float(title=_("Warning below"), unit=_("dBm")),
4162 Float(title=_("Warning at"), unit=_("dBm")),
4163 Float(title=_("Critical at"), unit=_("dBm"))
4164 ])),
4165 ]), TextAscii(title=_("Port index")), "dict")
4167 register_check_parameters(
4168 RulespecGroupCheckParametersStorage, "fcport_words", _("Atto Fibrebridge FC port"),
4169 Dictionary(
4170 title=_("Levels for transmitted and received words"),
4171 elements=[
4172 ("fc_tx_words", Levels(title=_("Tx"), unit=_("words/s"))),
4173 ("fc_rx_words", Levels(title=_("Rx"), unit=_("words/s"))),
4175 ), TextAscii(title=_("Port index"),), "dict")
4177 register_check_parameters(
4178 RulespecGroupCheckParametersStorage, "fs_mount_options",
4179 _("Filesystem mount options (Linux/UNIX)"),
4180 ListOfStrings(
4181 title=_("Expected mount options"),
4182 help=_("Specify all expected mount options here. If the list of "
4183 "actually found options differs from this list, the check will go "
4184 "warning or critical. Just the option <tt>commit</tt> is being "
4185 "ignored since it is modified by the power saving algorithms."),
4186 valuespec=TextUnicode(),
4187 ), TextAscii(title=_("Mount point"), allow_empty=False), "first")
4189 register_check_parameters(
4190 RulespecGroupCheckParametersStorage, "storcli_vdrives", _("LSI RAID VDrives (StorCLI)"),
4191 Dictionary(
4192 title=_("Evaluation of VDrive States"),
4193 elements=[
4194 ("Optimal", MonitoringState(
4195 title=_("State for <i>Optimal</i>"),
4196 default_value=0,
4198 ("Partially Degraded",
4199 MonitoringState(
4200 title=_("State for <i>Partially Degraded</i>"),
4201 default_value=1,
4203 ("Degraded", MonitoringState(
4204 title=_("State for <i>Degraded</i>"),
4205 default_value=2,
4207 ("Offline", MonitoringState(
4208 title=_("State for <i>Offline</i>"),
4209 default_value=1,
4211 ("Recovery", MonitoringState(
4212 title=_("State for <i>Recovery</i>"),
4213 default_value=1,
4215 ]), TextAscii(
4216 title=_("Virtual Drive"),
4217 allow_empty=False,
4218 ), "dict")
4220 register_check_parameters(
4221 RulespecGroupCheckParametersStorage, "storcli_pdisks", _("LSI RAID physical disks (StorCLI)"),
4222 Dictionary(
4223 title=_("Evaluation of PDisk States"),
4224 elements=[
4225 ("Dedicated Hot Spare",
4226 MonitoringState(
4227 title=_("State for <i>Dedicated Hot Spare</i>"),
4228 default_value=0,
4230 ("Global Hot Spare",
4231 MonitoringState(
4232 title=_("State for <i>Global Hot Spare</i>"),
4233 default_value=0,
4235 ("Unconfigured Good",
4236 MonitoringState(
4237 title=_("State for <i>Unconfigured Good</i>"),
4238 default_value=0,
4240 ("Unconfigured Bad",
4241 MonitoringState(
4242 title=_("State for <i>Unconfigured Bad</i>"),
4243 default_value=1,
4245 ("Online", MonitoringState(
4246 title=_("State for <i>Online</i>"),
4247 default_value=0,
4249 ("Offline", MonitoringState(
4250 title=_("State for <i>Offline</i>"),
4251 default_value=2,
4253 ]), TextAscii(
4254 title=_("PDisk EID:Slot-Device"),
4255 allow_empty=False,
4256 ), "dict")
4258 register_check_parameters(
4259 RulespecGroupCheckParametersStorage,
4260 "veeam_tapejobs",
4261 _("VEEAM tape backup jobs"),
4262 Tuple(
4263 title=_("Levels for duration of backup job"),
4264 elements=[
4265 Age(title="Warning at"),
4266 Age(title="Critical at"),
4269 TextAscii(title=_("Name of the tape job"),),
4270 "first",
4274 def ceph_epoch_element(title):
4275 return [("epoch",
4276 Tuple(
4277 title=title,
4278 elements=[
4279 Float(title=_("Warning at")),
4280 Float(title=_("Critical at")),
4281 Integer(title=_("Average interval"), unit=_("minutes")),
4282 ]))]
4285 register_check_parameters(
4286 RulespecGroupCheckParametersStorage,
4287 "ceph_status",
4288 _("Ceph Status"),
4289 Dictionary(elements=ceph_epoch_element(_("Status epoch levels and average")),),
4290 None,
4291 "dict",
4294 register_check_parameters(
4295 RulespecGroupCheckParametersStorage,
4296 "ceph_osds",
4297 _("Ceph OSDs"),
4298 Dictionary(
4299 elements=[
4300 ("num_out_osds",
4301 Tuple(
4302 title=_("Upper levels for number of OSDs which are out"),
4303 elements=[
4304 Percentage(title=_("Warning at")),
4305 Percentage(title=_("Critical at")),
4306 ])),
4307 ("num_down_osds",
4308 Tuple(
4309 title=_("Upper levels for number of OSDs which are down"),
4310 elements=[
4311 Percentage(title=_("Warning at")),
4312 Percentage(title=_("Critical at")),
4313 ])),
4314 ] + ceph_epoch_element(_("OSDs epoch levels and average")),),
4315 None,
4316 "dict",
4319 register_check_parameters(
4320 RulespecGroupCheckParametersStorage,
4321 "ceph_mgrs",
4322 _("Ceph MGRs"),
4323 Dictionary(elements=ceph_epoch_element(_("MGRs epoch levels and average")),),
4324 None,
4325 "dict",
4328 register_check_parameters(
4329 RulespecGroupCheckParametersStorage,
4330 "quantum_storage_status",
4331 _("Quantum Storage Status"),
4332 Dictionary(elements=[
4333 ("map_states",
4334 Dictionary(
4335 elements=[
4336 ("unavailable", MonitoringState(title=_("Device unavailable"), default_value=2)),
4337 ("available", MonitoringState(title=_("Device available"), default_value=0)),
4338 ("online", MonitoringState(title=_("Device online"), default_value=0)),
4339 ("offline", MonitoringState(title=_("Device offline"), default_value=2)),
4340 ("going online", MonitoringState(title=_("Device going online"), default_value=1)),
4341 ("state not available",
4342 MonitoringState(title=_("Device state not available"), default_value=3)),
4344 title=_('Map Device States'),
4345 optional_keys=[],
4348 None,
4349 "dict",
4352 register_check_parameters(
4353 RulespecGroupCheckParametersEnvironment, "apc_system_events", _("APC Inrow System Events"),
4354 Dictionary(
4355 title=_("System Events on APX Inrow Devices"),
4356 elements=[
4357 ("state", MonitoringState(
4358 title=_("State during active system events"),
4359 default_value=2,
4361 ]), None, "dict")
4363 # Note: This hack is only required on very old filesystem checks (prior August 2013)
4364 fs_levels_elements_hack = [
4365 # Beware: this is a nasty hack that helps us to detect new-style parameters.
4366 # Something hat has todo with float/int conversion and has not been documented
4367 # by the one who implemented this.
4368 ("flex_levels", FixedValue(
4369 None,
4370 totext="",
4371 title="",
4376 # Match and transform functions for level configurations like
4377 # -- used absolute, positive int (2, 4)
4378 # -- used percentage, positive float (2.0, 4.0)
4379 # -- available absolute, negative int (-2, -4)
4380 # -- available percentage, negative float (-2.0, -4.0)
4381 # (4 alternatives)
4382 def match_dual_level_type(value):
4383 if isinstance(value, list):
4384 for entry in value:
4385 if entry[1][0] < 0 or entry[1][1] < 0:
4386 return 1
4387 return 0
4388 if value[0] < 0 or value[1] < 0:
4389 return 1
4390 return 0
4393 def get_free_used_dynamic_valuespec(what, name, default_value=(80.0, 90.0)):
4394 if what == "used":
4395 title = _("used space")
4396 course = _("above")
4397 else:
4398 title = _("free space")
4399 course = _("below")
4401 vs_subgroup = [
4402 Tuple(
4403 title=_("Percentage %s") % title,
4404 elements=[
4405 Percentage(title=_("Warning if %s") % course, unit="%", minvalue=0.0),
4406 Percentage(title=_("Critical if %s") % course, unit="%", minvalue=0.0),
4408 Tuple(
4409 title=_("Absolute %s") % title,
4410 elements=[
4411 Integer(title=_("Warning if %s") % course, unit=_("MB"), minvalue=0),
4412 Integer(title=_("Critical if %s") % course, unit=_("MB"), minvalue=0),
4416 def validate_dynamic_levels(value, varprefix):
4417 if [v for v in value if v[0] < 0]:
4418 raise MKUserError(varprefix, _("You need to specify levels " "of at least 0 bytes."))
4420 return Alternative(
4421 title=_("Levels for %s %s") % (name, title),
4422 style="dropdown",
4423 show_alternative_title=True,
4424 default_value=default_value,
4425 elements=vs_subgroup + [
4426 ListOf(
4427 Tuple(
4428 orientation="horizontal",
4429 elements=[
4430 Filesize(title=_("%s larger than") % name.title()),
4431 Alternative(elements=vs_subgroup)
4433 title=_('Dynamic levels'),
4434 allow_empty=False,
4435 validate=validate_dynamic_levels,
4441 def transform_filesystem_free(value):
4442 tuple_convert = lambda val: tuple(-x for x in val)
4444 if isinstance(value, tuple):
4445 return tuple_convert(value)
4447 result = []
4448 for item in value:
4449 result.append((item[0], tuple_convert(item[1])))
4450 return result
4453 fs_levels_elements = [("levels",
4454 Alternative(
4455 title=_("Levels for filesystem"),
4456 show_alternative_title=True,
4457 default_value=(80.0, 90.0),
4458 match=match_dual_level_type,
4459 elements=[
4460 get_free_used_dynamic_valuespec("used", "filesystem"),
4461 Transform(
4462 get_free_used_dynamic_valuespec(
4463 "free", "filesystem", default_value=(20.0, 10.0)),
4464 title=_("Levels for filesystem free space"),
4465 allow_empty=False,
4466 forth=transform_filesystem_free,
4467 back=transform_filesystem_free)
4468 ])),
4469 ("show_levels",
4470 DropdownChoice(
4471 title=_("Display warn/crit levels in check output..."),
4472 choices=[
4473 ("onproblem", _("Only if the status is non-OK")),
4474 ("onmagic", _("If the status is non-OK or a magic factor is set")),
4475 ("always", _("Always")),
4477 default_value="onmagic",
4480 fs_reserved_elements = [
4481 ("show_reserved",
4482 DropdownChoice(
4483 title=_("Show space reserved for the <tt>root</tt> user"),
4484 help=
4485 _("Check_MK treats space that is reserved for the <tt>root</tt> user on Linux and Unix as "
4486 "used space. Usually, 5% are being reserved for root when a new filesystem is being created. "
4487 "With this option you can have Check_MK display the current amount of reserved but yet unused "
4488 "space."),
4489 choices=[
4490 (True, _("Show reserved space")),
4491 (False, _("Do now show reserved space")),
4492 ])),
4493 ("subtract_reserved",
4494 DropdownChoice(
4495 title=_(
4496 "Exclude space reserved for the <tt>root</tt> user from calculation of used space"),
4497 help=
4498 _("By default Check_MK treats space that is reserved for the <tt>root</tt> user on Linux and Unix as "
4499 "used space. Usually, 5% are being reserved for root when a new filesystem is being created. "
4500 "With this option you can have Check_MK exclude the current amount of reserved but yet unused "
4501 "space from the calculations regarding the used space percentage."),
4502 choices=[
4503 (False, _("Include reserved space")),
4504 (True, _("Exclude reserved space")),
4505 ])),
4508 fs_inodes_elements = [
4509 ("inodes_levels",
4510 Alternative(
4511 title=_("Levels for Inodes"),
4512 help=_("The number of remaining inodes on the filesystem. "
4513 "Please note that this setting has no effect on some filesystem checks."),
4514 elements=[
4515 Tuple(
4516 title=_("Percentage free"),
4517 elements=[
4518 Percentage(title=_("Warning if less than")),
4519 Percentage(title=_("Critical if less than")),
4521 Tuple(
4522 title=_("Absolute free"),
4523 elements=[
4524 Integer(
4525 title=_("Warning if less than"),
4526 size=10,
4527 unit=_("inodes"),
4528 minvalue=0,
4529 default_value=10000),
4530 Integer(
4531 title=_("Critical if less than"),
4532 size=10,
4533 unit=_("inodes"),
4534 minvalue=0,
4535 default_value=5000),
4538 default_value=(10.0, 5.0),
4540 ("show_inodes",
4541 DropdownChoice(
4542 title=_("Display inode usage in check output..."),
4543 choices=[
4544 ("onproblem", _("Only in case of a problem")),
4545 ("onlow", _("Only in case of a problem or if inodes are below 50%")),
4546 ("always", _("Always")),
4548 default_value="onlow",
4552 fs_magic_elements = [
4553 ("magic",
4554 Float(
4555 title=_("Magic factor (automatic level adaptation for large filesystems)"),
4556 default_value=0.8,
4557 minvalue=0.1,
4558 maxvalue=1.0)),
4559 ("magic_normsize",
4560 Integer(
4561 title=_("Reference size for magic factor"), default_value=20, minvalue=1, unit=_("GB"))),
4562 ("levels_low",
4563 Tuple(
4564 title=_("Minimum levels if using magic factor"),
4565 help=_("The filesystem levels will never fall below these values, when using "
4566 "the magic factor and the filesystem is very small."),
4567 elements=[
4568 Percentage(title=_("Warning at"), unit=_("% usage"), allow_int=True, default_value=50),
4569 Percentage(
4570 title=_("Critical at"), unit=_("% usage"), allow_int=True, default_value=60)
4574 size_trend_elements = [
4575 ("trend_range",
4576 Optional(
4577 Integer(
4578 title=_("Time Range for trend computation"),
4579 default_value=24,
4580 minvalue=1,
4581 unit=_("hours")),
4582 title=_("Trend computation"),
4583 label=_("Enable trend computation"))),
4584 ("trend_mb",
4585 Tuple(
4586 title=_("Levels on trends in MB per time range"),
4587 elements=[
4588 Integer(title=_("Warning at"), unit=_("MB / range"), default_value=100),
4589 Integer(title=_("Critical at"), unit=_("MB / range"), default_value=200)
4590 ])),
4591 ("trend_perc",
4592 Tuple(
4593 title=_("Levels for the percentual growth per time range"),
4594 elements=[
4595 Percentage(
4596 title=_("Warning at"),
4597 unit=_("% / range"),
4598 default_value=5,
4600 Percentage(
4601 title=_("Critical at"),
4602 unit=_("% / range"),
4603 default_value=10,
4605 ])),
4606 ("trend_timeleft",
4607 Tuple(
4608 title=_("Levels on the time left until full"),
4609 elements=[
4610 Integer(
4611 title=_("Warning if below"),
4612 unit=_("hours"),
4613 default_value=12,
4615 Integer(
4616 title=_("Critical if below"),
4617 unit=_("hours"),
4618 default_value=6,
4620 ])),
4621 ("trend_showtimeleft",
4622 Checkbox(
4623 title=_("Display time left in check output"),
4624 label=_("Enable"),
4625 help=_("Normally, the time left until the disk is full is only displayed when "
4626 "the configured levels have been breached. If you set this option "
4627 "the check always reports this information"))),
4628 ("trend_perfdata",
4629 Checkbox(
4630 title=_("Trend performance data"),
4631 label=_("Enable generation of performance data from trends"))),
4634 filesystem_elements = fs_levels_elements + fs_levels_elements_hack + fs_reserved_elements + fs_inodes_elements + fs_magic_elements + size_trend_elements
4637 def vs_filesystem(extra_elements=None):
4638 if extra_elements is None:
4639 extra_elements = []
4640 return Dictionary(
4641 help=_("This ruleset allows to set parameters for space and inodes usage"),
4642 elements=filesystem_elements + extra_elements,
4643 hidden_keys=["flex_levels"],
4644 ignored_keys=["patterns"],
4648 register_check_parameters(
4649 RulespecGroupCheckParametersStorage, "filesystem", _("Filesystems (used space and growth)"),
4650 vs_filesystem(),
4651 TextAscii(
4652 title=_("Mount point"),
4653 help=_("For Linux/UNIX systems, specify the mount point, for Windows systems "
4654 "the drive letter uppercase followed by a colon and a slash, e.g. <tt>C:/</tt>"),
4655 allow_empty=False), "dict")
4657 register_check_parameters(
4658 RulespecGroupCheckParametersStorage, "threepar_capacity",
4659 _("3Par Capacity (used space and growth)"),
4660 vs_filesystem([
4662 "failed_capacity_levels",
4663 Tuple(
4664 title=_("Levels for failed capacity in percent"),
4665 elements=[
4666 Percentage(title=_("Warning at"), default=0.0),
4667 Percentage(title=_("Critical at"), default=0.0),
4671 ]), TextAscii(title=_("Device type"), allow_empty=False), "dict")
4673 register_check_parameters(RulespecGroupCheckParametersStorage, "threepar_cpgs",
4674 _("3Par CPG (used space and growth)"), vs_filesystem(),
4675 TextAscii(title=_("CPG member name"), allow_empty=False), "dict")
4677 register_check_parameters(
4678 RulespecGroupCheckParametersStorage,
4679 "nfsiostats",
4680 _("NFS IO Statistics"),
4681 Dictionary(
4682 title=_("NFS IO Statistics"),
4683 optional_keys=True,
4684 elements=[
4685 ("op_s",
4686 Tuple(
4687 title=_("Operations"),
4688 elements=[
4689 Float(title=_("Warning at"), default_value=None, unit="1/s"),
4690 Float(title=_("Critical at"), default_value=None, unit="1/s"),
4691 ])),
4692 ("rpc_backlog",
4693 Tuple(
4694 title=_("RPC Backlog"),
4695 elements=[
4696 Float(title=_("Warning below"), default_value=None, unit="queue"),
4697 Float(title=_("Critical below"), default_value=None, unit="queue"),
4698 ])),
4699 ("read_ops",
4700 Tuple(
4701 title=_("Read Operations /s"),
4702 elements=[
4703 Float(title=_("Warning at"), default_value=None, unit="1/s"),
4704 Float(title=_("Critical at"), default_value=None, unit="1/s"),
4705 ])),
4706 ("read_b_s",
4707 Tuple(
4708 title=_("Reads size /s"),
4709 elements=[
4710 Float(title=_("Warning at"), default_value=None, unit="bytes/s"),
4711 Float(title=_("Critical at"), default_value=None, unit="bytes/s"),
4712 ])),
4713 ("read_b_op",
4714 Tuple(
4715 title=_("Read bytes per operation"),
4716 elements=[
4717 Float(title=_("Warning at"), default_value=None, unit="bytes/op"),
4718 Float(title=_("Critical at"), default_value=None, unit="bytes/op"),
4719 ])),
4720 ("read_retrans",
4721 Tuple(
4722 title=_("Read Retransmissions"),
4723 elements=[
4724 Percentage(title=_("Warning at"), default_value=None),
4725 Percentage(title=_("Critical at"), default_value=None),
4726 ])),
4727 ("read_avg_rtt_ms",
4728 Tuple(
4729 title=_("Read Average RTT (ms)"),
4730 elements=[
4731 Float(title=_("Warning at"), default_value=None, unit="ms"),
4732 Float(title=_("Critical at"), default_value=None, unit="ms"),
4733 ])),
4734 ("read_avg_exe_ms",
4735 Tuple(
4736 title=_("Read Average Executions (ms)"),
4737 elements=[
4738 Float(title=_("Warning at"), default_value=None, unit="ms"),
4739 Float(title=_("Critical at"), default_value=None, unit="ms"),
4740 ])),
4741 ("write_ops_s",
4742 Tuple(
4743 title=_("Write Operations/s"),
4744 elements=[
4745 Float(title=_("Warning at"), default_value=None, unit="1/s"),
4746 Float(title=_("Critical at"), default_value=None, unit="1/s"),
4747 ])),
4748 ("write_b_s",
4749 Tuple(
4750 title=_("Write size /s"),
4751 elements=[
4752 Float(title=_("Warning at"), default_value=None, unit="bytes/s"),
4753 Float(title=_("Critical at"), default_value=None, unit="bytes/s"),
4754 ])),
4755 ("write_b_op",
4756 Tuple(
4757 title=_("Write bytes per operation"),
4758 elements=[
4759 Float(title=_("Warning at"), default_value=None, unit="bytes/s"),
4760 Float(title=_("Critical at"), default_value=None, unit="bytes/s"),
4761 ])),
4762 ("write_retrans",
4763 Tuple(
4764 title=_("Write Retransmissions"),
4765 elements=[
4766 Percentage(title=_("Warning at"), default_value=None),
4767 Percentage(title=_("Critical at"), default_value=None),
4768 ])),
4769 ("write_avg_rtt_ms",
4770 Tuple(
4771 title=_("Write Avg RTT (ms)"),
4772 elements=[
4773 Float(title=_("Warning at"), default_value=None, unit="ms"),
4774 Float(title=_("Critical at"), default_value=None, unit="ms"),
4775 ])),
4776 ("write_avg_exe_ms",
4777 Tuple(
4778 title=_("Write Avg exe (ms)"),
4779 elements=[
4780 Float(title=_("Warning at"), default_value=None, unit="ms"),
4781 Float(title=_("Critical at"), default_value=None, unit="ms"),
4782 ])),
4784 TextAscii(title=_("NFS IO Statistics"),),
4785 match_type="dict",
4789 # .--Printing------------------------------------------------------------.
4790 # | ____ _ _ _ |
4791 # | | _ \ _ __(_)_ __ | |_(_)_ __ __ _ |
4792 # | | |_) | '__| | '_ \| __| | '_ \ / _` | |
4793 # | | __/| | | | | | | |_| | | | | (_| | |
4794 # | |_| |_| |_|_| |_|\__|_|_| |_|\__, | |
4795 # | |___/ |
4796 # '----------------------------------------------------------------------'
4799 def transform_printer_supply(params):
4800 if isinstance(params, tuple):
4801 if len(params) == 2:
4802 return {"levels": params}
4803 return {"levels": params[:2], "upturn_toner": params[2]}
4804 return params
4807 register_check_parameters(
4808 RulespecGroupCheckParametersPrinters,
4809 "printer_supply",
4810 _("Printer cartridge levels"),
4811 Transform(
4812 Dictionary(elements=[
4813 ("levels",
4814 Tuple(
4815 title=_("Levels for remaining supply"),
4816 elements=[
4817 Percentage(
4818 title=_("Warning level for remaining"),
4819 allow_int=True,
4820 default_value=20.0,
4821 help=_("For consumable supplies, this is configured as the percentage of "
4822 "remaining capacity. For supplies that fill up, this is configured "
4823 "as remaining space."),
4825 Percentage(
4826 title=_("Critical level for remaining"),
4827 allow_int=True,
4828 default_value=10.0,
4829 help=_("For consumable supplies, this is configured as the percentage of "
4830 "remaining capacity. For supplies that fill up, this is configured "
4831 "as remaining space."),
4833 ])),
4834 ("some_remaining",
4835 MonitoringState(
4836 title=_("State for <i>some remaining</i>"),
4837 help=_("Some printers do not report a precise percentage but "
4838 "just <i>some remaining</i> at a low fill state. Here you "
4839 "can set the monitoring state for that situation"),
4840 default_value=1,
4842 ("upturn_toner",
4843 Checkbox(
4844 title=_("Upturn toner levels"),
4845 label=_("Printer sends <i>used</i> material instead of <i>remaining</i>"),
4846 help=_("Some Printers (eg. Konica for Drum Cartdiges) returning the available"
4847 " fuel instead of what is left. In this case it's possible"
4848 " to upturn the levels to handle this behavior"),
4851 forth=transform_printer_supply,
4853 TextAscii(title=_("cartridge specification"), allow_empty=True),
4854 match_type="first",
4857 register_check_parameters(
4858 RulespecGroupCheckParametersPrinters,
4859 "printer_input",
4860 _("Printer Input Units"),
4861 Dictionary(
4862 elements=[
4863 ('capacity_levels',
4864 Tuple(
4865 title=_('Capacity remaining'),
4866 elements=[
4867 Percentage(title=_("Warning at"), default_value=0.0),
4868 Percentage(title=_("Critical at"), default_value=0.0),
4872 default_keys=['capacity_levels'],
4874 TextAscii(title=_('Unit Name'), allow_empty=True),
4875 match_type="dict",
4878 register_check_parameters(
4879 RulespecGroupCheckParametersPrinters,
4880 "printer_output",
4881 _("Printer Output Units"),
4882 Dictionary(
4883 elements=[
4884 ('capacity_levels',
4885 Tuple(
4886 title=_('Capacity filled'),
4887 elements=[
4888 Percentage(title=_("Warning at"), default_value=0.0),
4889 Percentage(title=_("Critical at"), default_value=0.0),
4893 default_keys=['capacity_levels'],
4895 TextAscii(title=_('Unit Name'), allow_empty=True),
4896 match_type="dict",
4899 register_check_parameters(
4900 RulespecGroupCheckParametersPrinters,
4901 "cups_queues",
4902 _("CUPS Queue"),
4903 Dictionary(
4904 elements=[
4905 ("job_count",
4906 Tuple(
4907 title=_("Levels of current jobs"),
4908 default_value=(5, 10),
4909 elements=[Integer(title=_("Warning at")),
4910 Integer(title=_("Critical at"))])),
4911 ("job_age",
4912 Tuple(
4913 title=_("Levels for age of jobs"),
4914 help=_("A value in seconds"),
4915 default_value=(360, 720),
4916 elements=[Integer(title=_("Warning at")),
4917 Integer(title=_("Critical at"))])),
4918 ("is_idle", MonitoringState(
4919 title=_("State for 'is idle'"),
4920 default_value=0,
4922 ("now_printing", MonitoringState(
4923 title=_("State for 'now printing'"),
4924 default_value=0,
4926 ("disabled_since",
4927 MonitoringState(
4928 title=_("State for 'disabled since'"),
4929 default_value=2,
4931 ],),
4932 TextAscii(title=_("CUPS Queue")),
4933 "dict",
4937 # .--Os------------------------------------------------------------------.
4938 # | ___ |
4939 # | / _ \ ___ |
4940 # | | | | / __| |
4941 # | | |_| \__ \ |
4942 # | \___/|___/ |
4943 # | |
4944 # '----------------------------------------------------------------------'
4946 register_check_parameters(
4947 RulespecGroupCheckParametersOperatingSystem,
4948 "uptime",
4949 _("Uptime since last reboot"),
4950 Dictionary(elements=[
4951 ("min",
4952 Tuple(
4953 title=_("Minimum required uptime"),
4954 elements=[
4955 Age(title=_("Warning if below")),
4956 Age(title=_("Critical if below")),
4957 ])),
4958 ("max",
4959 Tuple(
4960 title=_("Maximum allowed uptime"),
4961 elements=[
4962 Age(title=_("Warning at")),
4963 Age(title=_("Critical at")),
4964 ])),
4966 None,
4967 match_type="dict",
4970 register_check_parameters(
4971 RulespecGroupCheckParametersOperatingSystem, "systemtime", _("Windows system time offset"),
4972 Tuple(
4973 title=_("Time offset"),
4974 elements=[
4975 Integer(title=_("Warning at"), unit=_("Seconds")),
4976 Integer(title=_("Critical at"), unit=_("Seconds")),
4977 ]), None, "first")
4980 # .--Unsorted--(Don't create new stuff here!)----------------------------.
4981 # | _ _ _ _ |
4982 # | | | | |_ __ ___ ___ _ __| |_ ___ __| | |
4983 # | | | | | '_ \/ __|/ _ \| '__| __/ _ \/ _` | |
4984 # | | |_| | | | \__ \ (_) | | | || __/ (_| | |
4985 # | \___/|_| |_|___/\___/|_| \__\___|\__,_| |
4986 # | |
4987 # +----------------------------------------------------------------------+
4988 # | All these rules have not been moved into their according sections. |
4989 # | Please move them as you come along - but beware of dependecies! |
4990 # | Remove this section as soon as it's empty. |
4991 # '----------------------------------------------------------------------'
4993 register_check_parameters(
4994 RulespecGroupCheckParametersEnvironment, "ups_test", _("Time since last UPS selftest"),
4995 Tuple(
4996 title=_("Time since last UPS selftest"),
4997 elements=[
4998 Integer(
4999 title=_("Warning Level for time since last self test"),
5000 help=_("Warning Level for time since last diagnostic test of the device. "
5001 "For a value of 0 the warning level will not be used"),
5002 unit=_("days"),
5003 default_value=0,
5005 Integer(
5006 title=_("Critical Level for time since last self test"),
5007 help=_("Critical Level for time since last diagnostic test of the device. "
5008 "For a value of 0 the critical level will not be used"),
5009 unit=_("days"),
5010 default_value=0,
5012 ]), None, "first")
5014 register_check_parameters(
5015 RulespecGroupCheckParametersEnvironment,
5016 "apc_power",
5017 _("APC Power Consumption"),
5018 Tuple(
5019 title=_("Power Comsumption of APC Devices"),
5020 elements=[
5021 Integer(
5022 title=_("Warning below"),
5023 unit=_("W"),
5024 default_value=20,
5026 Integer(
5027 title=_("Critical below"),
5028 unit=_("W"),
5029 default_value=1,
5032 TextAscii(
5033 title=_("Phase"),
5034 help=_("The identifier of the phase the power is related to."),
5036 match_type="first")
5038 register_check_parameters(
5039 RulespecGroupCheckParametersStorage,
5040 "fileinfo",
5041 _("Size and age of single files"),
5042 Dictionary(elements=[
5043 ("minage",
5044 Tuple(
5045 title=_("Minimal age"),
5046 elements=[
5047 Age(title=_("Warning if younger than")),
5048 Age(title=_("Critical if younger than")),
5049 ])),
5050 ("maxage",
5051 Tuple(
5052 title=_("Maximal age"),
5053 elements=[
5054 Age(title=_("Warning if older than")),
5055 Age(title=_("Critical if older than")),
5056 ])),
5057 ("minsize",
5058 Tuple(
5059 title=_("Minimal size"),
5060 elements=[
5061 Filesize(title=_("Warning if below")),
5062 Filesize(title=_("Critical if below")),
5063 ])),
5064 ("maxsize",
5065 Tuple(
5066 title=_("Maximal size"),
5067 elements=[
5068 Filesize(title=_("Warning at")),
5069 Filesize(title=_("Critical at")),
5070 ])),
5071 ("timeofday",
5072 ListOfTimeRanges(
5073 title=_("Only check during the following times of the day"),
5074 help=_("Outside these ranges the check will always be OK"),
5076 ("state_missing", MonitoringState(default_value=3, title=_("State when file is missing"))),
5078 TextAscii(title=_("File name"), allow_empty=True),
5079 match_type="dict",
5082 register_rule(
5083 RulespecGroupCheckParametersStorage,
5084 varname="filesystem_groups",
5085 title=_('Filesystem grouping patterns'),
5086 help=_('Normally the filesystem checks (<tt>df</tt>, <tt>hr_fs</tt> and others) '
5087 'will create a single service for each filesystem. '
5088 'By defining grouping '
5089 'patterns you can handle groups of filesystems like one filesystem. '
5090 'For each group you can define one or several patterns. '
5091 'The filesystems matching one of the patterns '
5092 'will be monitored like one big filesystem in a single service.'),
5093 valuespec=ListOf(
5094 Tuple(
5095 show_titles=True,
5096 orientation="horizontal",
5097 elements=[
5098 TextAscii(title=_("Name of group"),),
5099 TextAscii(
5100 title=_("Pattern for mount point (using * and ?)"),
5101 help=_("You can specify one or several patterns containing "
5102 "<tt>*</tt> and <tt>?</tt>, for example <tt>/spool/tmpspace*</tt>. "
5103 "The filesystems matching the patterns will be monitored "
5104 "like one big filesystem in a single service."),
5107 add_label=_("Add pattern"),
5109 match='all',
5112 register_rule(
5113 RulespecGroupCheckParametersStorage,
5114 varname="fileinfo_groups",
5115 title=_('File Grouping Patterns'),
5116 help=_('The check <tt>fileinfo</tt> monitors the age and size of '
5117 'a single file. Each file information that is sent '
5118 'by the agent will create one service. By defining grouping '
5119 'patterns you can switch to the check <tt>fileinfo.groups</tt>. '
5120 'That check monitors a list of files at once. You can set levels '
5121 'not only for the total size and the age of the oldest/youngest '
5122 'file but also on the count. You can define one or several '
5123 'patterns for a group containing <tt>*</tt> and <tt>?</tt>, for example '
5124 '<tt>/var/log/apache/*.log</tt>. Please see Python\'s fnmatch for more '
5125 'information regarding globbing patterns and special characters. '
5126 'If the pattern begins with a tilde then this pattern is interpreted as '
5127 'a regular expression instead of as a filename globbing pattern and '
5128 '<tt>*</tt> and <tt>?</tt> are treated differently. '
5129 'For files contained in a group '
5130 'the discovery will automatically create a group service instead '
5131 'of single services for each file. This rule also applies when '
5132 'you use manually configured checks instead of inventorized ones. '
5133 'Furthermore, the current time/date in a configurable format '
5134 'may be included in the include pattern. The syntax is as follows: '
5135 '$DATE:format-spec$ or $YESTERDAY:format-spec$, where format-spec '
5136 'is a list of time format directives of the unix date command. '
5137 'Example: $DATE:%Y%m%d$ is todays date, e.g. 20140127. A pattern '
5138 'of /var/tmp/backups/$DATE:%Y%m%d$.txt would search for .txt files '
5139 'with todays date as name in the directory /var/tmp/backups. '
5140 'The YESTERDAY syntax simply subtracts one day from the reference time.'),
5141 valuespec=ListOf(
5142 Tuple(
5143 help=_("This defines one file grouping pattern."),
5144 show_titles=True,
5145 orientation="horizontal",
5146 elements=[
5147 TextAscii(
5148 title=_("Name of group"),
5149 size=10,
5151 Transform(
5152 Tuple(
5153 show_titles=True,
5154 orientation="vertical",
5155 elements=[
5156 TextAscii(title=_("Include Pattern"), size=40),
5157 TextAscii(title=_("Exclude Pattern"), size=40),
5160 forth=lambda params: isinstance(params, str) and (params, '') or params),
5163 add_label=_("Add pattern group"),
5165 match='all',
5168 register_check_parameters(
5169 RulespecGroupCheckParametersStorage,
5170 "fileinfo-groups",
5171 _("Size, age and count of file groups"),
5172 Dictionary(
5173 elements=[
5174 ("minage_oldest",
5175 Tuple(
5176 title=_("Minimal age of oldest file"),
5177 elements=[
5178 Age(title=_("Warning if younger than")),
5179 Age(title=_("Critical if younger than")),
5180 ])),
5181 ("maxage_oldest",
5182 Tuple(
5183 title=_("Maximal age of oldest file"),
5184 elements=[
5185 Age(title=_("Warning if older than")),
5186 Age(title=_("Critical if older than")),
5187 ])),
5188 ("minage_newest",
5189 Tuple(
5190 title=_("Minimal age of newest file"),
5191 elements=[
5192 Age(title=_("Warning if younger than")),
5193 Age(title=_("Critical if younger than")),
5194 ])),
5195 ("maxage_newest",
5196 Tuple(
5197 title=_("Maximal age of newest file"),
5198 elements=[
5199 Age(title=_("Warning if older than")),
5200 Age(title=_("Critical if older than")),
5201 ])),
5202 ("minsize_smallest",
5203 Tuple(
5204 title=_("Minimal size of smallest file"),
5205 elements=[
5206 Filesize(title=_("Warning if below")),
5207 Filesize(title=_("Critical if below")),
5208 ])),
5209 ("maxsize_smallest",
5210 Tuple(
5211 title=_("Maximal size of smallest file"),
5212 elements=[
5213 Filesize(title=_("Warning if above")),
5214 Filesize(title=_("Critical if above")),
5215 ])),
5216 ("minsize_largest",
5217 Tuple(
5218 title=_("Minimal size of largest file"),
5219 elements=[
5220 Filesize(title=_("Warning if below")),
5221 Filesize(title=_("Critical if below")),
5222 ])),
5223 ("maxsize_largest",
5224 Tuple(
5225 title=_("Maximal size of largest file"),
5226 elements=[
5227 Filesize(title=_("Warning if above")),
5228 Filesize(title=_("Critical if above")),
5229 ])),
5230 ("minsize",
5231 Tuple(
5232 title=_("Minimal size"),
5233 elements=[
5234 Filesize(title=_("Warning if below")),
5235 Filesize(title=_("Critical if below")),
5236 ])),
5237 ("maxsize",
5238 Tuple(
5239 title=_("Maximal size"),
5240 elements=[
5241 Filesize(title=_("Warning if above")),
5242 Filesize(title=_("Critical if above")),
5243 ])),
5244 ("mincount",
5245 Tuple(
5246 title=_("Minimal file count"),
5247 elements=[
5248 Integer(title=_("Warning if below")),
5249 Integer(title=_("Critical if below")),
5250 ])),
5251 ("maxcount",
5252 Tuple(
5253 title=_("Maximal file count"),
5254 elements=[
5255 Integer(title=_("Warning if above")),
5256 Integer(title=_("Critical if above")),
5257 ])),
5258 ("timeofday",
5259 ListOfTimeRanges(
5260 title=_("Only check during the following times of the day"),
5261 help=_("Outside these ranges the check will always be OK"),
5263 ("conjunctions",
5264 ListOf(
5265 Tuple(elements=[
5266 MonitoringState(title=_("Monitoring state"), default_value=2),
5267 ListOf(
5268 CascadingDropdown(
5269 orientation="hroizontal",
5270 choices=[
5271 ("count", _("File count at"), Integer()),
5272 ("count_lower", _("File count below"), Integer()),
5273 ("size", _("File size at"), Filesize()),
5274 ("size_lower", _("File size below"), Filesize()),
5275 ("largest_size", _("Largest file size at"), Filesize()),
5276 ("largest_size_lower", _("Largest file size below"), Filesize()),
5277 ("smallest_size", _("Smallest file size at"), Filesize()),
5278 ("smallest_size_lower", _("Smallest file size below"), Filesize()),
5279 ("oldest_age", _("Oldest file age at"), Age()),
5280 ("oldest_age_lower", _("Oldest file age below"), Age()),
5281 ("newest_age", _("Newest file age at"), Age()),
5282 ("newest_age_lower", _("Newest file age below"), Age()),
5284 magic="@#@#",
5287 title=_("Level conjunctions"),
5288 help=
5289 _("In order to check dependent file group statistics you can configure "
5290 "conjunctions of single levels now. A conjunction consists of a monitoring state "
5291 "and any number of upper or lower levels. If all of the configured levels within "
5292 "a conjunction are reached then the related state is reported."),
5295 ignored_keys=["precompiled_patterns"]),
5296 TextAscii(
5297 title=_("File Group Name"),
5298 help=_(
5299 "This name must match the name of the group defined "
5300 "in the <a href=\"wato.py?mode=edit_ruleset&varname=fileinfo_groups\">%s</a> ruleset.")
5301 % (_('File Grouping Patterns')),
5302 allow_empty=True),
5303 match_type="dict",
5306 register_check_parameters(
5307 RulespecGroupCheckParametersStorage,
5308 "netapp_fcportio",
5309 _("Netapp FC Port throughput"),
5310 Dictionary(elements=[("read",
5311 Tuple(
5312 title=_("Read"),
5313 elements=[
5314 Filesize(title=_("Warning if below")),
5315 Filesize(title=_("Critical if below")),
5316 ])),
5317 ("write",
5318 Tuple(
5319 title=_("Write"),
5320 elements=[
5321 Filesize(title=_("Warning at")),
5322 Filesize(title=_("Critical at")),
5323 ]))]),
5324 TextAscii(title=_("File name"), allow_empty=True),
5325 match_type="dict",
5328 register_check_parameters(
5329 RulespecGroupCheckParametersOperatingSystem,
5330 "memory_pagefile_win",
5331 _("Memory and pagefile levels for Windows"),
5332 Dictionary(elements=[
5334 "memory",
5335 Alternative(
5336 title=_("Memory Levels"),
5337 style="dropdown",
5338 elements=[
5339 Tuple(
5340 title=_("Memory usage in percent"),
5341 elements=[
5342 Percentage(title=_("Warning at")),
5343 Percentage(title=_("Critical at")),
5346 Transform(
5347 Tuple(
5348 title=_("Absolute free memory"),
5349 elements=[
5350 Filesize(title=_("Warning if less than")),
5351 Filesize(title=_("Critical if less than")),
5353 # Note: Filesize values lesser 1MB will not work
5354 # -> need hide option in filesize valuespec
5355 back=lambda x: (x[0] / 1024 / 1024, x[1] / 1024 / 1024),
5356 forth=lambda x: (x[0] * 1024 * 1024, x[1] * 1024 * 1024)),
5357 PredictiveLevels(unit=_("GB"), default_difference=(0.5, 1.0))
5359 default_value=(80.0, 90.0))),
5361 "pagefile",
5362 Alternative(
5363 title=_("Pagefile Levels"),
5364 style="dropdown",
5365 elements=[
5366 Tuple(
5367 title=_("Pagefile usage in percent"),
5368 elements=[
5369 Percentage(title=_("Warning at")),
5370 Percentage(title=_("Critical at")),
5372 Transform(
5373 Tuple(
5374 title=_("Absolute free pagefile"),
5375 elements=[
5376 Filesize(title=_("Warning if less than")),
5377 Filesize(title=_("Critical if less than")),
5379 # Note: Filesize values lesser 1MB will not work
5380 # -> need hide option in filesize valuespec
5381 back=lambda x: (x[0] / 1024 / 1024, x[1] / 1024 / 1024),
5382 forth=lambda x: (x[0] * 1024 * 1024, x[1] * 1024 * 1024)),
5383 PredictiveLevels(
5384 title=_("Predictive levels"), unit=_("GB"), default_difference=(0.5, 1.0))
5386 default_value=(80.0, 90.0))),
5387 ("average",
5388 Integer(
5389 title=_("Averaging"),
5390 help=_("If this parameter is set, all measured values will be averaged "
5391 "over the specified time interval before levels are being applied. Per "
5392 "default, averaging is turned off. "),
5393 unit=_("minutes"),
5394 minvalue=1,
5395 default_value=60,
5398 None,
5399 "dict")
5401 register_check_parameters(
5402 RulespecGroupCheckParametersApplications,
5403 "apache_status",
5404 ("Apache Status"),
5405 Dictionary(elements=[
5406 ("OpenSlots",
5407 Tuple(
5408 title=_("Remaining Open Slots"),
5409 help=_("Here you can set the number of remaining open slots"),
5410 elements=[
5411 Integer(title=_("Warning below"), label=_("slots")),
5412 Integer(title=_("Critical below"), label=_("slots"))
5413 ])),
5414 ("BusyWorkers",
5415 Tuple(
5416 title=_("Busy workers"),
5417 help=_("Here you can set upper levels of busy workers"),
5418 elements=[
5419 Integer(title=_("Warning at"), label=_("busy workers")),
5420 Integer(title=_("Critical at"), label=_("busy workers"))
5421 ])),
5423 TextAscii(
5424 title=_("Apache Server"),
5425 help=_("A string-combination of servername and port, e.g. 127.0.0.1:5000.")),
5426 match_type="dict",
5429 register_check_parameters(
5430 RulespecGroupCheckParametersApplications,
5431 "saprouter_cert_age",
5432 _("SAP router certificate time settings"),
5433 Dictionary(elements=[
5434 ("validity_age",
5435 Tuple(
5436 title=_('Lower levels for certificate age'),
5437 elements=[
5438 Age(title=_("Warning below"), default_value=30 * 86400),
5439 Age(title=_("Critical below"), default_value=7 * 86400),
5440 ])),
5442 None,
5443 "dict",
5446 register_check_parameters(
5447 RulespecGroupCheckParametersApplications,
5448 "sap_dialog",
5449 ("SAP Dialog"),
5450 Dictionary(elements=[
5451 ("UsersLoggedIn",
5452 Tuple(
5453 title=_("Number of Loggedin Users"),
5454 elements=[
5455 Integer(title=_("Warning at"), label=_("Users")),
5456 Integer(title=_("Critical at"), label=_("Users"))
5457 ])),
5458 ("FrontEndNetTime",
5459 Tuple(
5460 title=_("Frontend net time"),
5461 elements=[
5462 Float(title=_("Warning at"), unit=_('ms')),
5463 Float(title=_("Critical at"), unit=_('ms'))
5464 ])),
5465 ("ResponseTime",
5466 Tuple(
5467 title=_("Response Time"),
5468 elements=[
5469 Float(title=_("Warning at"), unit=_('ms')),
5470 Float(title=_("Critical at"), unit=_('ms'))
5471 ])),
5473 TextAscii(
5474 title=_("System ID"),
5475 help=_("The SAP system ID."),
5477 match_type="dict",
5480 register_check_parameters(
5481 RulespecGroupCheckParametersApplications,
5482 "nginx_status",
5483 ("Nginx Status"),
5484 Dictionary(elements=[("active_connections",
5485 Tuple(
5486 title=_("Active Connections"),
5487 help=_("You can configure upper thresholds for the currently active "
5488 "connections handled by the web server."),
5489 elements=[
5490 Integer(title=_("Warning at"), unit=_("connections")),
5491 Integer(title=_("Critical at"), unit=_("connections"))
5492 ]))]),
5493 TextAscii(
5494 title=_("Nginx Server"),
5495 help=_("A string-combination of servername and port, e.g. 127.0.0.1:80.")),
5496 match_type="dict",
5499 register_check_parameters(
5500 RulespecGroupCheckParametersApplications,
5501 "sles_license",
5502 ("SLES License"),
5503 Dictionary(elements=[
5504 ("status",
5505 DropdownChoice(
5506 title=_("Status"),
5507 help=_("Status of the SLES license"),
5508 choices=[
5509 ('Registered', _('Registered')),
5510 ('Ignore', _('Do not check')),
5511 ])),
5512 ("subscription_status",
5513 DropdownChoice(
5514 title=_("Subscription"),
5515 help=_("Status of the SLES subscription"),
5516 choices=[
5517 ('ACTIVE', _('ACTIVE')),
5518 ('Ignore', _('Do not check')),
5519 ])),
5520 ("days_left",
5521 Tuple(
5522 title=_("Time until license expiration"),
5523 help=_("Remaining days until the SLES license expires"),
5524 elements=[
5525 Integer(title=_("Warning at"), unit=_("days")),
5526 Integer(title=_("Critical at"), unit=_("days"))
5527 ])),
5529 None,
5530 match_type="dict",
5533 register_check_parameters(
5534 RulespecGroupCheckParametersNetworking,
5535 "viprinet_router",
5536 _("Viprinet router"),
5537 Dictionary(elements=[
5538 ("expect_mode",
5539 DropdownChoice(
5540 title=_("Set expected router mode"),
5541 choices=[
5542 ("inv", _("Mode found during inventory")),
5543 ("0", _("Node")),
5544 ("1", _("Hub")),
5545 ("2", _("Hub running as HotSpare")),
5546 ("3", _("Hotspare-Hub replacing another router")),
5547 ])),
5549 None,
5550 match_type="dict",
5553 register_check_parameters(
5554 RulespecGroupCheckParametersNetworking, 'docsis_channels_upstream',
5555 _("Docsis Upstream Channels"),
5556 Dictionary(elements=[
5557 ('signal_noise',
5558 Tuple(
5559 title=_("Levels for signal/noise ratio"),
5560 elements=[
5561 Float(title=_("Warning at or below"), unit="dB", default_value=10.0),
5562 Float(title=_("Critical at or below"), unit="dB", default_value=5.0),
5563 ])),
5564 ('correcteds',
5565 Tuple(
5566 title=_("Levels for rate of corrected errors"),
5567 elements=[
5568 Percentage(title=_("Warning at"), default_value=5.0),
5569 Percentage(title=_("Critical at"), default_value=8.0),
5570 ])),
5571 ('uncorrectables',
5572 Tuple(
5573 title=_("Levels for rate of uncorrectable errors"),
5574 elements=[
5575 Percentage(title=_("Warning at"), default_value=1.0),
5576 Percentage(title=_("Critical at"), default_value=2.0),
5577 ])),
5578 ]), TextAscii(title=_("ID of the channel (usually ranging from 1)")), "dict")
5580 register_check_parameters(
5581 RulespecGroupCheckParametersNetworking, "docsis_channels_downstream",
5582 _("Docsis Downstream Channels"),
5583 Dictionary(elements=[
5584 ("power",
5585 Tuple(
5586 title=_("Transmit Power"),
5587 help=_("The operational transmit power"),
5588 elements=[
5589 Float(title=_("warning at or below"), unit="dBmV", default_value=5.0),
5590 Float(title=_("critical at or below"), unit="dBmV", default_value=1.0),
5591 ])),
5592 ]), TextAscii(title=_("ID of the channel (usually ranging from 1)")), "dict")
5594 register_check_parameters(
5595 RulespecGroupCheckParametersNetworking, "docsis_cm_status", _("Docsis Cable Modem Status"),
5596 Dictionary(elements=[
5597 ("error_states",
5598 ListChoice(
5599 title=_("Modem States that lead to a critical state"),
5600 help=_(
5601 "If one of the selected states occurs the check will repsond with a critical state "
5603 choices=[
5604 (1, "other"),
5605 (2, "notReady"),
5606 (3, "notSynchronized"),
5607 (4, "phySynchronized"),
5608 (5, "usParametersAcquired"),
5609 (6, "rangingComplete"),
5610 (7, "ipComplete"),
5611 (8, "todEstablished"),
5612 (9, "securityEstablished"),
5613 (10, "paramTransferComplete"),
5614 (11, "registrationComplete"),
5615 (12, "operational"),
5616 (13, "accessDenied"),
5618 default_value=[1, 2, 13],
5620 ("tx_power",
5621 Tuple(
5622 title=_("Transmit Power"),
5623 help=_("The operational transmit power"),
5624 elements=[
5625 Float(title=_("warning at"), unit="dBmV", default_value=20.0),
5626 Float(title=_("critical at"), unit="dBmV", default_value=10.0),
5627 ])),
5628 ]), TextAscii(title=_("ID of the Entry")), "dict")
5630 register_check_parameters(
5631 RulespecGroupCheckParametersNetworking,
5632 "vpn_tunnel",
5633 _("VPN Tunnel"),
5634 Dictionary(
5635 elements=[
5636 ("tunnels",
5637 ListOf(
5638 Tuple(
5639 title=("VPN Tunnel Endpoints"),
5640 elements=[
5641 IPv4Address(
5642 title=_("IP-Address or Name of Tunnel Endpoint"),
5643 help=_(
5644 "The configured value must match a tunnel reported by the monitored "
5645 "device."),
5646 allow_empty=False,
5648 TextUnicode(
5649 title=_("Tunnel Alias"),
5650 help=_(
5651 "You can configure an individual alias here for the tunnel matching "
5652 "the IP-Address or Name configured in the field above."),
5654 MonitoringState(
5655 default_value=2,
5656 title=_("State if tunnel is not found"),
5659 add_label=_("Add tunnel"),
5660 movable=False,
5661 title=_("VPN tunnel specific configuration"),
5663 ("state",
5664 MonitoringState(
5665 title=_("Default state to report when tunnel can not be found anymore"),
5666 help=_("Default state if a tunnel, which is not listed above in this rule, "
5667 "can no longer be found."),
5669 ],),
5670 TextAscii(title=_("IP-Address of Tunnel Endpoint")),
5671 match_type="dict",
5674 register_check_parameters(
5675 RulespecGroupCheckParametersNetworking, "lsnat", _("Enterasys LSNAT Bindings"),
5676 Dictionary(
5677 elements=[
5678 ("current_bindings",
5679 Tuple(
5680 title=_("Number of current LSNAT bindings"),
5681 elements=[
5682 Integer(title=_("Warning at"), size=10, unit=_("bindings")),
5683 Integer(title=_("Critical at"), size=10, unit=_("bindings")),
5684 ])),
5686 optional_keys=False,
5687 ), None, "dict")
5689 register_check_parameters(
5690 RulespecGroupCheckParametersNetworking, "enterasys_powersupply",
5691 _("Enterasys Power Supply Settings"),
5692 Dictionary(
5693 elements=[
5694 ("redundancy_ok_states",
5695 ListChoice(
5696 title=_("States treated as OK"),
5697 choices=[
5698 (1, 'redundant'),
5699 (2, 'notRedundant'),
5700 (3, 'notSupported'),
5702 default_value=[1],
5705 optional_keys=False,
5706 ), TextAscii(title=_("Number of Powersupply"),), "dict")
5708 hivemanger_states = [
5709 ("Critical", "Critical"),
5710 ("Maybe", "Maybe"),
5711 ("Major", "Major"),
5712 ("Minor", "Minor"),
5714 register_check_parameters(
5715 RulespecGroupCheckParametersNetworking,
5716 "hivemanager_devices",
5717 _("Hivemanager Devices"),
5718 Dictionary(elements=[
5719 ('max_clients',
5720 Tuple(
5721 title=_("Number of clients"),
5722 help=_("Number of clients connected to a Device."),
5723 elements=[
5724 Integer(title=_("Warning at"), unit=_("clients")),
5725 Integer(title=_("Critical at"), unit=_("clients")),
5726 ])),
5727 ('max_uptime',
5728 Tuple(
5729 title=_("Maximum uptime of Device"),
5730 elements=[
5731 Age(title=_("Warning at")),
5732 Age(title=_("Critical at")),
5733 ])),
5734 ('alert_on_loss', FixedValue(
5735 False,
5736 totext="",
5737 title=_("Do not alert on connection loss"),
5739 ("warn_states",
5740 ListChoice(
5741 title=_("States treated as warning"),
5742 choices=hivemanger_states,
5743 default_value=['Maybe', 'Major', 'Minor'],
5745 ("crit_states",
5746 ListChoice(
5747 title=_("States treated as critical"),
5748 choices=hivemanger_states,
5749 default_value=['Critical'],
5752 TextAscii(title=_("Hostname of the Device")),
5753 match_type="dict",
5756 register_check_parameters(
5757 RulespecGroupCheckParametersNetworking,
5758 "hivemanager_ng_devices",
5759 _("HiveManager NG Devices"),
5760 Dictionary(elements=[
5761 ('max_clients',
5762 Tuple(
5763 title=_("Number of clients"),
5764 help=_("Number of clients connected to a Device."),
5765 elements=[
5766 Integer(title=_("Warning at"), unit=_("clients")),
5767 Integer(title=_("Critical at"), unit=_("clients")),
5768 ])),
5770 TextAscii(title=_("Hostname of the Device")),
5771 match_type="dict",
5774 register_check_parameters(
5775 RulespecGroupCheckParametersNetworking,
5776 "wlc_clients",
5777 _("WLC WiFi client connections"),
5778 Transform(
5779 Dictionary(
5780 title = _("Number of connections"),
5781 elements = [
5782 ("levels",
5783 Tuple(
5784 title = _("Upper levels"),
5785 elements = [
5786 Integer(title = _("Warning at"), unit=_("connections")),
5787 Integer(title = _("Critical at"), unit=_("connections")),
5790 ("levels_lower",
5791 Tuple(
5792 title = _("Lower levels"),
5793 elements= [
5794 Integer(title = _("Critical if below"), unit=_("connections")),
5795 Integer(title = _("Warning if below"), unit=_("connections")),
5800 # old params = (crit_low, warn_low, warn, crit)
5801 forth = lambda v: isinstance(v, tuple) and { "levels" : (v[2], v[3]), "levels_lower" : (v[1], v[0]) } or v,
5803 TextAscii( title = _("Name of Wifi")),
5804 "first"
5807 register_check_parameters(
5808 RulespecGroupCheckParametersNetworking,
5809 "cisco_wlc",
5810 _("Cisco WLAN AP"),
5811 Dictionary(
5812 help=_("Here you can set which alert type is set when the given "
5813 "access point is missing (might be powered off). The access point "
5814 "can be specified by the AP name or the AP model"),
5815 elements=[("ap_name",
5816 ListOf(
5817 Tuple(elements=[
5818 TextAscii(title=_("AP name")),
5819 MonitoringState(title=_("State when missing"), default_value=2)
5821 title=_("Access point name"),
5822 add_label=_("Add name")))]),
5823 TextAscii(title=_("Access Point")),
5824 match_type="dict",
5827 register_check_parameters(
5828 RulespecGroupCheckParametersNetworking,
5829 "tcp_conn_stats",
5830 _("TCP connection statistics"),
5831 Dictionary(elements=[
5832 ("ESTABLISHED",
5833 Tuple(
5834 title=_("ESTABLISHED"),
5835 help=_("connection up and passing data"),
5836 elements=[
5837 Integer(title=_("Warning at"), label=_("connections")),
5838 Integer(title=_("Critical at"), label=_("connections"))
5839 ])),
5840 ("SYN_SENT",
5841 Tuple(
5842 title=_("SYN_SENT"),
5843 help=_("session has been requested by us; waiting for reply from remote endpoint"),
5844 elements=[
5845 Integer(title=_("Warning at"), label=_("connections")),
5846 Integer(title=_("Critical at"), label=_("connections"))
5847 ])),
5848 ("SYN_RECV",
5849 Tuple(
5850 title=_("SYN_RECV"),
5851 help=_("session has been requested by a remote endpoint "
5852 "for a socket on which we were listening"),
5853 elements=[
5854 Integer(title=_("Warning at"), label=_("connections")),
5855 Integer(title=_("Critical at"), label=_("connections"))
5856 ])),
5857 ("LAST_ACK",
5858 Tuple(
5859 title=_("LAST_ACK"),
5860 help=_("our socket is closed; remote endpoint has also shut down; "
5861 " we are waiting for a final acknowledgement"),
5862 elements=[
5863 Integer(title=_("Warning at"), label=_("connections")),
5864 Integer(title=_("Critical at"), label=_("connections"))
5865 ])),
5866 ("CLOSE_WAIT",
5867 Tuple(
5868 title=_("CLOSE_WAIT"),
5869 help=_("remote endpoint has shut down; the kernel is waiting "
5870 "for the application to close the socket"),
5871 elements=[
5872 Integer(title=_("Warning at"), label=_("connections")),
5873 Integer(title=_("Critical at"), label=_("connections"))
5874 ])),
5875 ("TIME_WAIT",
5876 Tuple(
5877 title=_("TIME_WAIT"),
5878 help=_("socket is waiting after closing for any packets left on the network"),
5879 elements=[
5880 Integer(title=_("Warning at"), label=_("connections")),
5881 Integer(title=_("Critical at"), label=_("connections"))
5882 ])),
5883 ("CLOSED",
5884 Tuple(
5885 title=_("CLOSED"),
5886 help=_("socket is not being used"),
5887 elements=[
5888 Integer(title=_("Warning at"), label=_("connections")),
5889 Integer(title=_("Critical at"), label=_("connections"))
5890 ])),
5891 ("CLOSING",
5892 Tuple(
5893 title=_("CLOSING"),
5894 help=_("our socket is shut down; remote endpoint is shut down; "
5895 "not all data has been sent"),
5896 elements=[
5897 Integer(title=_("Warning at"), label=_("connections")),
5898 Integer(title=_("Critical at"), label=_("connections"))
5899 ])),
5900 ("FIN_WAIT1",
5901 Tuple(
5902 title=_("FIN_WAIT1"),
5903 help=_("our socket has closed; we are in the process of "
5904 "tearing down the connection"),
5905 elements=[
5906 Integer(title=_("Warning at"), label=_("connections")),
5907 Integer(title=_("Critical at"), label=_("connections"))
5908 ])),
5909 ("FIN_WAIT2",
5910 Tuple(
5911 title=_("FIN_WAIT2"),
5912 help=_("the connection has been closed; our socket is waiting "
5913 "for the remote endpoint to shutdown"),
5914 elements=[
5915 Integer(title=_("Warning at"), label=_("connections")),
5916 Integer(title=_("Critical at"), label=_("connections"))
5917 ])),
5918 ("LISTEN",
5919 Tuple(
5920 title=_("LISTEN"),
5921 help=_("represents waiting for a connection request from any remote TCP and port"),
5922 elements=[
5923 Integer(title=_("Warning at"), label=_("connections")),
5924 Integer(title=_("Critical at"), label=_("connections"))
5925 ])),
5926 ("BOUND",
5927 Tuple(
5928 title=_("BOUND"),
5929 help=_("the socket has been created and an address assigned "
5930 "to with bind(). The TCP stack is not active yet. "
5931 "This state is only reported on Solaris."),
5932 elements=[
5933 Integer(title=_("Warning at"), label=_("connections")),
5934 Integer(title=_("Critical at"), label=_("connections"))
5935 ])),
5936 ("IDLE",
5937 Tuple(
5938 title=_("IDLE"),
5939 help=_("a TCP session that is active but that has no data being "
5940 "transmitted by either device for a prolonged period of time"),
5941 elements=[
5942 Integer(title=_("Warning at"), label=_("connections")),
5943 Integer(title=_("Critical at"), label=_("connections"))
5944 ])),
5946 None,
5947 match_type="dict",
5950 register_check_parameters(
5951 RulespecGroupCheckParametersNetworking,
5952 "tcp_connections",
5953 _("Monitor specific TCP/UDP connections and listeners"),
5954 Dictionary(
5955 help=_("This rule allows to monitor the existence of specific TCP connections or "
5956 "TCP/UDP listeners."),
5957 elements=[
5959 "proto",
5960 DropdownChoice(
5961 title=_("Protocol"),
5962 choices=[("TCP", _("TCP")), ("UDP", _("UDP"))],
5963 default_value="TCP",
5967 "state",
5968 DropdownChoice(
5969 title=_("State"),
5970 choices=[
5971 ("ESTABLISHED", "ESTABLISHED"),
5972 ("LISTENING", "LISTENING"),
5973 ("SYN_SENT", "SYN_SENT"),
5974 ("SYN_RECV", "SYN_RECV"),
5975 ("LAST_ACK", "LAST_ACK"),
5976 ("CLOSE_WAIT", "CLOSE_WAIT"),
5977 ("TIME_WAIT", "TIME_WAIT"),
5978 ("CLOSED", "CLOSED"),
5979 ("CLOSING", "CLOSING"),
5980 ("FIN_WAIT1", "FIN_WAIT1"),
5981 ("FIN_WAIT2", "FIN_WAIT2"),
5982 ("BOUND", "BOUND"),
5985 ("local_ip", IPv4Address(title=_("Local IP address"))),
5986 ("local_port", Integer(
5987 title=_("Local port number"),
5988 minvalue=1,
5989 maxvalue=65535,
5991 ("remote_ip", IPv4Address(title=_("Remote IP address"))),
5992 ("remote_port", Integer(
5993 title=_("Remote port number"),
5994 minvalue=1,
5995 maxvalue=65535,
5997 ("max_states",
5998 Tuple(
5999 title=_("Maximum number of connections or listeners"),
6000 elements=[
6001 Integer(title=_("Warning at")),
6002 Integer(title=_("Critical at")),
6005 ("min_states",
6006 Tuple(
6007 title=_("Minimum number of connections or listeners"),
6008 elements=[
6009 Integer(title=_("Warning if below")),
6010 Integer(title=_("Critical if below")),
6014 TextAscii(
6015 title=_("Connection name"),
6016 help=_("Specify an arbitrary name of this connection here"),
6017 allow_empty=False),
6018 "dict",
6019 has_inventory=False,
6022 register_check_parameters(
6023 RulespecGroupCheckParametersApplications,
6024 'msx_info_store',
6025 _("MS Exchange Information Store"),
6026 Dictionary(
6027 title=_("Set Levels"),
6028 elements=[('store_latency',
6029 Tuple(
6030 title=_("Average latency for store requests"),
6031 elements=[
6032 Float(title=_("Warning at"), unit=_('ms'), default_value=40.0),
6033 Float(title=_("Critical at"), unit=_('ms'), default_value=50.0)
6034 ])),
6035 ('clienttype_latency',
6036 Tuple(
6037 title=_("Average latency for client type requests"),
6038 elements=[
6039 Float(title=_("Warning at"), unit=_('ms'), default_value=40.0),
6040 Float(title=_("Critical at"), unit=_('ms'), default_value=50.0)
6041 ])),
6042 ('clienttype_requests',
6043 Tuple(
6044 title=_("Maximum number of client type requests per second"),
6045 elements=[
6046 Integer(title=_("Warning at"), unit=_('requests'), default_value=60),
6047 Integer(title=_("Critical at"), unit=_('requests'), default_value=70)
6048 ]))],
6049 optional_keys=[]),
6050 TextAscii(
6051 title=_("Store"),
6052 help=_("Specify the name of a store (This is either a mailbox or public folder)")),
6053 match_type='dict')
6055 register_check_parameters(
6056 RulespecGroupCheckParametersApplications,
6057 'msx_rpcclientaccess',
6058 _("MS Exchange RPC Client Access"),
6059 Dictionary(
6060 title=_("Set Levels"),
6061 elements=[('latency',
6062 Tuple(
6063 title=_("Average latency for RPC requests"),
6064 elements=[
6065 Float(title=_("Warning at"), unit=_('ms'), default_value=200.0),
6066 Float(title=_("Critical at"), unit=_('ms'), default_value=250.0)
6067 ])),
6068 ('requests',
6069 Tuple(
6070 title=_("Maximum number of RPC requests per second"),
6071 elements=[
6072 Integer(title=_("Warning at"), unit=_('requests'), default_value=30),
6073 Integer(title=_("Critical at"), unit=_('requests'), default_value=40)
6074 ]))],
6075 optional_keys=[]),
6076 None,
6077 match_type='dict')
6079 register_check_parameters(
6080 RulespecGroupCheckParametersApplications,
6081 'msx_database',
6082 _("MS Exchange Database"),
6083 Dictionary(
6084 title=_("Set Levels"),
6085 elements=[
6086 ('read_attached_latency',
6087 Tuple(
6088 title=_("I/O Database Reads (Attached) Average Latency"),
6089 elements=[
6090 Float(title=_("Warning at"), unit=_('ms'), default_value=200.0),
6091 Float(title=_("Critical at"), unit=_('ms'), default_value=250.0)
6092 ])),
6093 ('read_recovery_latency',
6094 Tuple(
6095 title=_("I/O Database Reads (Recovery) Average Latency"),
6096 elements=[
6097 Float(title=_("Warning at"), unit=_('ms'), default_value=150.0),
6098 Float(title=_("Critical at"), unit=_('ms'), default_value=200.0)
6099 ])),
6100 ('write_latency',
6101 Tuple(
6102 title=_("I/O Database Writes (Attached) Average Latency"),
6103 elements=[
6104 Float(title=_("Warning at"), unit=_('ms'), default_value=40.0),
6105 Float(title=_("Critical at"), unit=_('ms'), default_value=50.0)
6106 ])),
6107 ('log_latency',
6108 Tuple(
6109 title=_("I/O Log Writes Average Latency"),
6110 elements=[
6111 Float(title=_("Warning at"), unit=_('ms'), default_value=5.0),
6112 Float(title=_("Critical at"), unit=_('ms'), default_value=10.0)
6113 ])),
6115 optional_keys=[]),
6116 TextAscii(
6117 title=_("Database Name"),
6118 help=_("Specify database names that the rule should apply to"),
6120 match_type='dict')
6123 def transform_msx_queues(params):
6124 if isinstance(params, tuple):
6125 return {"levels": (params[0], params[1])}
6126 return params
6129 register_check_parameters(
6130 RulespecGroupCheckParametersApplications, "msx_queues", _("MS Exchange Message Queues"),
6131 Transform(
6132 Dictionary(
6133 title=_("Set Levels"),
6134 elements=[
6135 ('levels',
6136 Tuple(
6137 title=_("Maximum Number of E-Mails in Queue"),
6138 elements=[
6139 Integer(title=_("Warning at"), unit=_("E-Mails")),
6140 Integer(title=_("Critical at"), unit=_("E-Mails"))
6141 ])),
6142 ('offset',
6143 Integer(
6144 title=_("Offset"),
6145 help=
6146 _("Use this only if you want to overwrite the postion of the information in the agent "
6147 "output. Also refer to the rule <i>Microsoft Exchange Queues Discovery</i> "
6148 ))),
6150 optional_keys=["offset"],
6152 forth=transform_msx_queues,
6154 TextAscii(
6155 title=_("Explicit Queue Names"),
6156 help=_("Specify queue names that the rule should apply to"),
6157 ), "first")
6159 register_check_parameters(
6160 RulespecGroupCheckParametersApplications, "msexch_copyqueue", _("MS Exchange DAG CopyQueue"),
6161 Tuple(
6162 title=_("Upper Levels for CopyQueue Length"),
6163 help=_("This rule sets upper levels to the number of transaction logs waiting to be copied "
6164 "and inspected on your Exchange Mailbox Servers in a Database Availability Group "
6165 "(DAG). This is also known as the CopyQueue length."),
6166 elements=[Integer(title=_("Warning at")),
6167 Integer(title=_("Critical at"))],
6168 ), TextAscii(
6169 title=_("Database Name"),
6170 help=_("The database name on the Mailbox Server."),
6171 ), "first")
6173 register_check_parameters(RulespecGroupCheckParametersStorage, "mongodb_collections",
6174 _("MongoDB Collection Size"),
6175 Dictionary(elements=fs_levels_elements + size_trend_elements),
6176 TextAscii(title=_("Collection name"),), "dict")
6178 register_check_parameters(
6179 RulespecGroupCheckParametersStorage, "volume_groups", _("Volume Groups (LVM)"),
6180 Dictionary(
6181 elements=[
6182 ("levels",
6183 Alternative(
6184 title=_("Levels for volume group"),
6185 show_alternative_title=True,
6186 default_value=(80.0, 90.0),
6187 match=match_dual_level_type,
6188 elements=[
6189 get_free_used_dynamic_valuespec("used", "volume group"),
6190 Transform(
6191 get_free_used_dynamic_valuespec(
6192 "free", "volume group", default_value=(20.0, 10.0)),
6193 title=_("Levels for volume group free space"),
6194 allow_empty=False,
6195 forth=transform_filesystem_free,
6196 back=transform_filesystem_free)
6197 ])),
6199 optional_keys=False), TextAscii(title=_("Volume Group"), allow_empty=False), "dict")
6201 register_check_parameters(
6202 RulespecGroupCheckParametersStorage, "ibm_svc_mdiskgrp", _("IBM SVC Pool Capacity"),
6203 Dictionary(
6204 elements=filesystem_elements + [
6205 ("provisioning_levels",
6206 Tuple(
6207 title=_("Provisioning Levels"),
6208 help=_("A provisioning of over 100% means over provisioning."),
6209 elements=[
6210 Percentage(
6211 title=_("Warning at a provisioning of"),
6212 default_value=110.0,
6213 maxvalue=None),
6214 Percentage(
6215 title=_("Critical at a provisioning of"),
6216 default_value=120.0,
6217 maxvalue=None),
6218 ])),
6220 hidden_keys=["flex_levels"],
6221 ), TextAscii(title=_("Name of the pool"), allow_empty=False), "dict")
6223 register_check_parameters(
6224 RulespecGroupCheckParametersOperatingSystem,
6225 "sp_util",
6226 _("Storage Processor Utilization"),
6227 Tuple(
6228 title=_("Specify levels in percentage of storage processor usage"),
6229 elements=[
6230 Percentage(title=_("Warning at"), default_value=50.0),
6231 Percentage(title=_("Critical at"), default_value=60.0),
6233 None,
6234 "first",
6237 register_check_parameters(
6238 RulespecGroupCheckParametersStorage, "esx_vsphere_datastores",
6239 _("ESX Datastores (used space and growth)"),
6240 Dictionary(
6241 elements=filesystem_elements + [
6242 ("provisioning_levels",
6243 Tuple(
6244 title=_("Provisioning Levels"),
6245 help=
6246 _("A provisioning of more than 100% is called "
6247 "over provisioning and can be a useful strategy for saving disk space. But you cannot guarantee "
6248 "any longer that every VM can really use all space that it was assigned. Here you can "
6249 "set levels for the maximum provisioning. A warning level of 150% will warn at 50% over provisioning."
6251 elements=[
6252 Percentage(
6253 title=_("Warning at a provisioning of"),
6254 maxvalue=None,
6255 default_value=120.0),
6256 Percentage(
6257 title=_("Critical at a provisioning of"),
6258 maxvalue=None,
6259 default_value=150.0),
6260 ])),
6262 hidden_keys=["flex_levels"],
6263 ), TextAscii(title=_("Datastore Name"), help=_("The name of the Datastore"), allow_empty=False),
6264 "dict")
6266 register_check_parameters(
6267 RulespecGroupCheckParametersStorage, "esx_hostystem_maintenance",
6268 _("ESX Hostsystem Maintenance Mode"),
6269 Dictionary(
6270 elements=[
6271 ("target_state",
6272 DropdownChoice(
6273 title=_("Target State"),
6274 help=_("Configure the target mode for the system."),
6275 choices=[
6276 ('true', "System should be in Maintenance Mode"),
6277 ('false', "System not should be in Maintenance Mode"),
6278 ])),
6279 ],), None, "dict")
6281 register_check_parameters(
6282 RulespecGroupCheckParametersNetworking, "bonding", _("Status of Linux bonding interfaces"),
6283 Dictionary(elements=[
6284 ("expect_active",
6285 DropdownChoice(
6286 title=_("Warn on unexpected active interface"),
6287 choices=[
6288 ("ignore", _("ignore which one is active")),
6289 ("primary", _("require primary interface to be active")),
6290 ("lowest", _("require interface that sorts lowest alphabetically")),
6292 default_value="ignore",
6294 ("ieee_302_3ad_agg_id_missmatch_state",
6295 MonitoringState(
6296 title=_("State for missmatching Aggregator IDs for LACP"),
6297 default_state=1,
6299 ]), TextAscii(title=_("Name of the bonding interface"),), "dict")
6302 def vs_interface_traffic():
6303 def vs_abs_perc():
6304 return CascadingDropdown(
6305 orientation="horizontal",
6306 choices=[("perc", _("Percentual levels (in relation to port speed)"),
6307 Tuple(
6308 orientation="float",
6309 show_titles=False,
6310 elements=[
6311 Percentage(label=_("Warning at")),
6312 Percentage(label=_("Critical at")),
6313 ])),
6314 ("abs", _("Absolute levels in bits or bytes per second"),
6315 Tuple(
6316 orientation="float",
6317 show_titles=False,
6318 elements=[
6319 Integer(label=_("Warning at")),
6320 Integer(label=_("Critical at")),
6321 ])), ("predictive", _("Predictive Levels"), PredictiveLevels())])
6323 return CascadingDropdown(
6324 orientation="horizontal",
6325 choices=[
6326 ("upper", _("Upper"), vs_abs_perc()),
6327 ("lower", _("Lower"), vs_abs_perc()),
6331 def transform_if(v):
6332 new_traffic = []
6334 if 'traffic' in v and not isinstance(v['traffic'], list):
6335 warn, crit = v['traffic']
6336 if isinstance(warn, int):
6337 new_traffic.append(('both', ('upper', ('abs', (warn, crit)))))
6338 elif isinstance(warn, float):
6339 new_traffic.append(('both', ('upper', ('perc', (warn, crit)))))
6341 if 'traffic_minimum' in v:
6342 warn, crit = v['traffic_minimum']
6343 if isinstance(warn, int):
6344 new_traffic.append(('both', ('lower', ('abs', (warn, crit)))))
6345 elif isinstance(warn, float):
6346 new_traffic.append(('both', ('lower', ('perc', (warn, crit)))))
6347 del v['traffic_minimum']
6349 if new_traffic:
6350 v['traffic'] = new_traffic
6352 return v
6355 register_check_parameters(
6356 RulespecGroupCheckParametersNetworking,
6357 "if",
6358 _("Network interfaces and switch ports"),
6359 # Transform old traffic related levels which used "traffic" and "traffic_minimum"
6360 # keys where each was configured with an Alternative valuespec
6361 Transform(
6362 Dictionary(
6363 ignored_keys=["aggregate"], # Created by discovery when using interface grouping
6364 elements=[
6365 ("errors",
6366 Alternative(
6367 title=_("Levels for error rates"),
6368 help=
6369 _("These levels make the check go warning or critical whenever the "
6370 "<b>percentual error rate</b> or the <b>absolute error rate</b> of the monitored interface reaches "
6371 "the given bounds. The percentual error rate is computed by dividing number of "
6372 "errors by the total number of packets (successful plus errors)."),
6373 elements=[
6374 Tuple(
6375 title=_("Percentual levels for error rates"),
6376 elements=[
6377 Percentage(
6378 title=_("Warning at"),
6379 unit=_("percent errors"),
6380 default_value=0.01,
6381 display_format='%.3f'),
6382 Percentage(
6383 title=_("Critical at"),
6384 unit=_("percent errors"),
6385 default_value=0.1,
6386 display_format='%.3f')
6388 Tuple(
6389 title=_("Absolute levels for error rates"),
6390 elements=[
6391 Integer(title=_("Warning at"), unit=_("errors")),
6392 Integer(title=_("Critical at"), unit=_("errors"))
6394 ])),
6395 ("speed",
6396 OptionalDropdownChoice(
6397 title=_("Operating speed"),
6398 help=_("If you use this parameter then the check goes warning if the "
6399 "interface is not operating at the expected speed (e.g. it "
6400 "is working with 100Mbit/s instead of 1Gbit/s.<b>Note:</b> "
6401 "some interfaces do not provide speed information. In such cases "
6402 "this setting is used as the assumed speed when it comes to "
6403 "traffic monitoring (see below)."),
6404 choices=[
6405 (None, _("ignore speed")),
6406 (10000000, "10 Mbit/s"),
6407 (100000000, "100 Mbit/s"),
6408 (1000000000, "1 Gbit/s"),
6409 (10000000000, "10 Gbit/s"),
6411 otherlabel=_("specify manually ->"),
6412 explicit=Integer(
6413 title=_("Other speed in bits per second"), label=_("Bits per second")))),
6414 ("state",
6415 Optional(
6416 ListChoice(
6417 title=_("Allowed states:"), choices=defines.interface_oper_states()),
6418 title=_("Operational state"),
6419 help=
6420 _("If you activate the monitoring of the operational state (<tt>ifOperStatus</tt>) "
6421 "the check will get warning or critical if the current state "
6422 "of the interface does not match one of the expected states. Note: the status 9 (<i>admin down</i>) "
6423 "is only visible if you activate this status during switch port inventory or if you manually "
6424 "use the check plugin <tt>if64adm</tt> instead of <tt>if64</tt>."),
6425 label=_("Ignore the operational state"),
6426 none_label=_("ignore"),
6427 negate=True)),
6428 ("map_operstates",
6429 ListOf(
6430 Tuple(
6431 orientation="horizontal",
6432 elements=[
6433 DropdownChoice(choices=defines.interface_oper_states()),
6434 MonitoringState()
6436 title=_('Map operational states'),
6438 ("assumed_speed_in",
6439 OptionalDropdownChoice(
6440 title=_("Assumed input speed"),
6441 help=_(
6442 "If the automatic detection of the link speed does not work "
6443 "or the switch's capabilities are throttled because of the network setup "
6444 "you can set the assumed speed here."),
6445 choices=[
6446 (None, _("ignore speed")),
6447 (10000000, "10 Mbit/s"),
6448 (100000000, "100 Mbit/s"),
6449 (1000000000, "1 Gbit/s"),
6450 (10000000000, "10 Gbit/s"),
6452 otherlabel=_("specify manually ->"),
6453 default_value=16000000,
6454 explicit=Integer(
6455 title=_("Other speed in bits per second"),
6456 label=_("Bits per second"),
6457 size=10))),
6458 ("assumed_speed_out",
6459 OptionalDropdownChoice(
6460 title=_("Assumed output speed"),
6461 help=_(
6462 "If the automatic detection of the link speed does not work "
6463 "or the switch's capabilities are throttled because of the network setup "
6464 "you can set the assumed speed here."),
6465 choices=[
6466 (None, _("ignore speed")),
6467 (10000000, "10 Mbit/s"),
6468 (100000000, "100 Mbit/s"),
6469 (1000000000, "1 Gbit/s"),
6470 (10000000000, "10 Gbit/s"),
6472 otherlabel=_("specify manually ->"),
6473 default_value=1500000,
6474 explicit=Integer(
6475 title=_("Other speed in bits per second"),
6476 label=_("Bits per second"),
6477 size=12))),
6478 ("unit",
6479 RadioChoice(
6480 title=_("Measurement unit"),
6481 help=_("Here you can specifiy the measurement unit of the network interface"),
6482 default_value="byte",
6483 choices=[
6484 ("bit", _("Bits")),
6485 ("byte", _("Bytes")),
6488 ("infotext_format",
6489 DropdownChoice(
6490 title=_("Change infotext in check output"),
6491 help=
6492 _("This setting allows you to modify the information text which is displayed between "
6493 "the two brackets in the check output. Please note that this setting does not work for "
6494 "grouped interfaces, since the additional information of grouped interfaces is different"
6496 choices=[
6497 ("alias", _("Show alias")),
6498 ("description", _("Show description")),
6499 ("alias_and_description", _("Show alias and description")),
6500 ("alias_or_description", _("Show alias if set, else description")),
6501 ("desription_or_alias", _("Show description if set, else alias")),
6502 ("hide", _("Hide infotext")),
6503 ])),
6504 ("traffic",
6505 ListOf(
6506 CascadingDropdown(
6507 title=_("Direction"),
6508 orientation="horizontal",
6509 choices=[
6510 ('both', _("In / Out"), vs_interface_traffic()),
6511 ('in', _("In"), vs_interface_traffic()),
6512 ('out', _("Out"), vs_interface_traffic()),
6514 title=_("Used bandwidth (minimum or maximum traffic)"),
6515 help=_("Setting levels on the used bandwidth is optional. If you do set "
6516 "levels you might also consider using averaging."),
6519 "nucasts",
6520 Tuple(
6521 title=_("Non-unicast packet rates"),
6522 help=_(
6523 "Setting levels on non-unicast packet rates is optional. This may help "
6524 "to detect broadcast storms and other unwanted traffic."),
6525 elements=[
6526 Integer(title=_("Warning at"), unit=_("pkts / sec")),
6527 Integer(title=_("Critical at"), unit=_("pkts / sec")),
6530 ("discards",
6531 Tuple(
6532 title=_("Absolute levels for discards rates"),
6533 elements=[
6534 Integer(title=_("Warning at"), unit=_("discards")),
6535 Integer(title=_("Critical at"), unit=_("discards"))
6536 ])),
6537 ("average",
6538 Integer(
6539 title=_("Average values"),
6540 help=_("By activating the computation of averages, the levels on "
6541 "errors and traffic are applied to the averaged value. That "
6542 "way you can make the check react only on long-time changes, "
6543 "not on one-minute events."),
6544 unit=_("minutes"),
6545 minvalue=1,
6546 default_value=15,
6549 forth=transform_if,
6551 TextAscii(title=_("port specification"), allow_empty=False),
6552 "dict",
6555 register_check_parameters(
6556 RulespecGroupCheckParametersNetworking,
6557 "fcp",
6558 _("Fibrechannel Interfaces"),
6559 Dictionary(elements=[
6560 ("speed",
6561 OptionalDropdownChoice(
6562 title=_("Operating speed"),
6563 help=_("If you use this parameter then the check goes warning if the "
6564 "interface is not operating at the expected speed (e.g. it "
6565 "is working with 8Gbit/s instead of 16Gbit/s)."),
6566 choices=[
6567 (None, _("ignore speed")),
6568 (4000000000, "4 Gbit/s"),
6569 (8000000000, "8 Gbit/s"),
6570 (16000000000, "16 Gbit/s"),
6572 otherlabel=_("specify manually ->"),
6573 explicit=Integer(
6574 title=_("Other speed in bits per second"), label=_("Bits per second")))),
6575 ("traffic",
6576 ListOf(
6577 CascadingDropdown(
6578 title=_("Direction"),
6579 orientation="horizontal",
6580 choices=[
6581 ('both', _("In / Out"), vs_interface_traffic()),
6582 ('in', _("In"), vs_interface_traffic()),
6583 ('out', _("Out"), vs_interface_traffic()),
6585 title=_("Used bandwidth (minimum or maximum traffic)"),
6586 help=_("Setting levels on the used bandwidth is optional. If you do set "
6587 "levels you might also consider using averaging."),
6589 ("read_latency",
6590 Levels(
6591 title=_("Read latency"),
6592 unit=_("ms"),
6593 default_value=None,
6594 default_levels=(50.0, 100.0))),
6595 ("write_latency",
6596 Levels(
6597 title=_("Write latency"),
6598 unit=_("ms"),
6599 default_value=None,
6600 default_levels=(50.0, 100.0))),
6601 ("latency",
6602 Levels(
6603 title=_("Overall latency"),
6604 unit=_("ms"),
6605 default_value=None,
6606 default_levels=(50.0, 100.0))),
6608 TextAscii(title=_("Port specification"), allow_empty=False),
6609 "dict",
6612 register_check_parameters(
6613 RulespecGroupCheckParametersNetworking,
6614 "signal_quality",
6615 _("Signal quality of Wireless device"),
6616 Tuple(elements=[
6617 Percentage(title=_("Warning if under"), maxvalue=100),
6618 Percentage(title=_("Critical if under"), maxvalue=100),
6620 TextAscii(title=_("Network specification"), allow_empty=True),
6621 "first",
6624 register_check_parameters(
6625 RulespecGroupCheckParametersNetworking,
6626 "cisco_ip_sla",
6627 _("Cisco IP SLA"),
6628 Dictionary(elements=[
6629 ("rtt_type",
6630 DropdownChoice(
6631 title=_("RTT type"),
6632 choices=[
6633 ('echo', _("echo")),
6634 ('path echo', _("path echo")),
6635 ('file IO', _("file IO")),
6636 ('UDP echo', _("UDP echo")),
6637 ('TCP connect', _("TCP connect")),
6638 ('HTTP', _("HTTP")),
6639 ('DNS', _("DNS")),
6640 ('jitter', _("jitter")),
6641 ('DLSw', _("DLSw")),
6642 ('DHCP', _("DHCP")),
6643 ('FTP', _("FTP")),
6644 ('VoIP', _("VoIP")),
6645 ('RTP', _("RTP")),
6646 ('LSP group', _("LSP group")),
6647 ('ICMP jitter', _("ICMP jitter")),
6648 ('LSP ping', _("LSP ping")),
6649 ('LSP trace', _("LSP trace")),
6650 ('ethernet ping', _("ethernet ping")),
6651 ('ethernet jitter', _("ethernet jitter")),
6652 ('LSP ping pseudowire', _("LSP ping pseudowire")),
6654 default_value="echo",
6656 ("threshold",
6657 Integer(
6658 title=_("Treshold"),
6659 help=_("Depending on the precision the unit can be "
6660 "either milliseconds or micoseconds."),
6661 unit=_("ms/us"),
6662 minvalue=1,
6663 default_value=5000,
6665 ("state",
6666 DropdownChoice(
6667 title=_("State"),
6668 choices=[
6669 ('active', _("active")),
6670 ('inactive', _("inactive")),
6671 ('reset', _("reset")),
6672 ('orderly stop', _("orderly stop")),
6673 ('immediate stop', _("immediate stop")),
6674 ('pending', _("pending")),
6675 ('restart', _("restart")),
6677 default_value="active",
6679 ("connection_lost_occured",
6680 DropdownChoice(
6681 title=_("Connection lost occured"),
6682 choices=[
6683 ("yes", _("yes")),
6684 ("no", _("no")),
6686 default_value="no",
6688 ("timeout_occured",
6689 DropdownChoice(
6690 title=_("Timeout occured"),
6691 choices=[
6692 ("yes", _("yes")),
6693 ("no", _("no")),
6695 default_value="no",
6697 ("completion_time_over_treshold_occured",
6698 DropdownChoice(
6699 title=_("Completion time over treshold occured"),
6700 choices=[
6701 ("yes", _("yes")),
6702 ("no", _("no")),
6704 default_value="no",
6706 ("latest_rtt_completion_time",
6707 Tuple(
6708 title=_("Latest RTT completion time"),
6709 help=_("Depending on the precision the unit can be "
6710 "either milliseconds or micoseconds."),
6711 elements=[
6712 Integer(
6713 title=_("Warning at"),
6714 unit=_("ms/us"),
6715 minvalue=1,
6716 default_value=100,
6718 Integer(
6719 title=_("Critical at"),
6720 unit=_("ms/us"),
6721 minvalue=1,
6722 default_value=200,
6724 ])),
6725 ("latest_rtt_state",
6726 DropdownChoice(
6727 title=_("Latest RTT state"),
6728 choices=[
6729 ('ok', _("OK")),
6730 ('disconnected', _("disconnected")),
6731 ('over treshold', _("over treshold")),
6732 ('timeout', _("timeout")),
6733 ('other', _("other")),
6735 default_value="ok",
6738 TextAscii(
6739 title=_("RTT row index of the service"),
6740 allow_empty=True,
6742 "dict",
6745 register_check_parameters(
6746 RulespecGroupCheckParametersNetworking,
6747 "cisco_qos",
6748 _("Cisco quality of service"),
6749 Dictionary(elements=[
6750 ("unit",
6751 RadioChoice(
6752 title=_("Measurement unit"),
6753 help=_("Here you can specifiy the measurement unit of the network interface"),
6754 default_value="bit",
6755 choices=[
6756 ("bit", _("Bits")),
6757 ("byte", _("Bytes")),
6760 ("post",
6761 Alternative(
6762 title=_("Used bandwidth (traffic)"),
6763 help=_("Settings levels on the used bandwidth is optional. If you do set "
6764 "levels you might also consider using averaging."),
6765 elements=[
6766 Tuple(
6767 title=_("Percentual levels (in relation to policy speed)"),
6768 elements=[
6769 Percentage(
6770 title=_("Warning at"), maxvalue=1000, label=_("% of port speed")),
6771 Percentage(
6772 title=_("Critical at"), maxvalue=1000, label=_("% of port speed")),
6774 Tuple(
6775 title=_("Absolute levels in bits or bytes per second"),
6776 help=
6777 _("Depending on the measurement unit (defaults to bit) the absolute levels are set in bit or byte"
6779 elements=[
6780 Integer(
6781 title=_("Warning at"), size=10, label=_("bits / bytes per second")),
6782 Integer(
6783 title=_("Critical at"), size=10, label=_("bits / bytes per second")),
6785 ])),
6786 ("average",
6787 Integer(
6788 title=_("Average values"),
6789 help=_("By activating the computation of averages, the levels on "
6790 "errors and traffic are applied to the averaged value. That "
6791 "way you can make the check react only on long-time changes, "
6792 "not on one-minute events."),
6793 unit=_("minutes"),
6794 minvalue=1,
6796 ("drop",
6797 Alternative(
6798 title=_("Number of dropped bits or bytes per second"),
6799 help=_(
6800 "Depending on the measurement unit (defaults to bit) you can set the warn and crit "
6801 "levels for the number of dropped bits or bytes"),
6802 elements=[
6803 Tuple(
6804 title=_("Percentual levels (in relation to policy speed)"),
6805 elements=[
6806 Percentage(
6807 title=_("Warning at"), maxvalue=1000, label=_("% of port speed")),
6808 Percentage(
6809 title=_("Critical at"), maxvalue=1000, label=_("% of port speed")),
6811 Tuple(elements=[
6812 Integer(title=_("Warning at"), size=8, label=_("bits / bytes per second")),
6813 Integer(title=_("Critical at"), size=8, label=_("bits / bytes per second")),
6815 ])),
6817 TextAscii(title=_("port specification"), allow_empty=False),
6818 "dict",
6821 register_check_parameters(
6822 RulespecGroupCheckParametersOperatingSystem, "innovaphone_mem", _("Innovaphone Memory Usage"),
6823 Tuple(
6824 title=_("Specify levels in percentage of total RAM"),
6825 elements=[
6826 Percentage(title=_("Warning at a usage of"), unit=_("% of RAM")),
6827 Percentage(title=_("Critical at a usage of"), unit=_("% of RAM")),
6828 ]), None, "first")
6830 register_check_parameters(
6831 RulespecGroupCheckParametersOperatingSystem, "mem_pages", _("Memory Pages Statistics"),
6832 Dictionary(elements=[(
6833 "pages_per_second",
6834 Tuple(
6835 title=_("Pages per second"),
6836 elements=[
6837 Integer(title=_("Warning at"), unit=_("pages/s")),
6838 Integer(title=_("Critical at"), unit=_("pages/s")),
6840 )]), None, "dict")
6842 register_check_parameters(
6843 RulespecGroupCheckParametersOperatingSystem,
6844 "statgrab_mem",
6845 _("Statgrab Memory Usage"),
6846 Alternative(elements=[
6847 Tuple(
6848 title=_("Specify levels in percentage of total RAM"),
6849 elements=[
6850 Percentage(title=_("Warning at a usage of"), unit=_("% of RAM"), maxvalue=None),
6851 Percentage(title=_("Critical at a usage of"), unit=_("% of RAM"), maxvalue=None)
6853 Tuple(
6854 title=_("Specify levels in absolute usage values"),
6855 elements=[
6856 Integer(title=_("Warning at"), unit=_("MB")),
6857 Integer(title=_("Critical at"), unit=_("MB"))
6860 None,
6861 "first",
6862 deprecated=True,
6865 register_check_parameters(
6866 RulespecGroupCheckParametersOperatingSystem,
6867 "cisco_mem",
6868 _("Cisco Memory Usage"),
6869 Transform(
6870 Dictionary(elements=[
6871 ("levels",
6872 Alternative(
6873 title=_("Levels for memory usage"),
6874 elements=[
6875 Tuple(
6876 title=_("Specify levels in percentage of total RAM"),
6877 elements=[
6878 Percentage(
6879 title=_("Warning at a usage of"),
6880 unit=_("% of RAM"),
6881 maxvalue=None),
6882 Percentage(
6883 title=_("Critical at a usage of"),
6884 unit=_("% of RAM"),
6885 maxvalue=None)
6887 Tuple(
6888 title=_("Specify levels in absolute usage values"),
6889 elements=[
6890 Integer(title=_("Warning at"), unit=_("MB")),
6891 Integer(title=_("Critical at"), unit=_("MB"))
6893 ])),
6894 ] + size_trend_elements),
6895 forth=lambda spec: spec if isinstance(spec, dict) else {"levels": spec},
6897 TextAscii(title=_("Memory Pool Name"), allow_empty=False),
6898 match_type="first",
6901 register_check_parameters(
6902 RulespecGroupCheckParametersOperatingSystem, "juniper_mem", _("Juniper Memory Usage"),
6903 Tuple(
6904 title=_("Specify levels in percentage of total memory usage"),
6905 elements=[
6906 Percentage(
6907 title=_("Warning at a usage of"),
6908 unit=_("% of RAM"),
6909 default_value=80.0,
6910 maxvalue=100.0),
6911 Percentage(
6912 title=_("Critical at a usage of"),
6913 unit=_("% of RAM"),
6914 default_value=90.0,
6915 maxvalue=100.0)
6916 ]), None, "first")
6918 # TODO: Remove situations where a rule is used once with and once without items
6919 register_check_parameters(
6920 RulespecGroupCheckParametersOperatingSystem,
6921 "juniper_mem_modules",
6922 _("Juniper Modules Memory Usage"),
6923 Tuple(
6924 title=_("Specify levels in percentage of total memory usage"),
6925 elements=[
6926 Percentage(
6927 title=_("Warning at a usage of"),
6928 unit=_("% of RAM"),
6929 default_value=80.0,
6930 maxvalue=100.0),
6931 Percentage(
6932 title=_("Critical at a usage of"),
6933 unit=_("% of RAM"),
6934 default_value=90.0,
6935 maxvalue=100.0)
6937 TextAscii(
6938 title=_("Module Name"),
6939 help=_("The identificator of the module."),
6941 "first",
6944 register_check_parameters(
6945 RulespecGroupCheckParametersOperatingSystem,
6946 "juniper_cpu_util",
6947 _("Juniper Processor Utilization of Routing Engine"),
6948 Transform(
6949 Dictionary(
6950 help=_("CPU utilization of routing engine."),
6951 optional_keys=[],
6952 elements=[
6954 "levels",
6955 Tuple(
6956 title=_("Specify levels in percentage of processor routing engine usage"),
6957 elements=[
6958 Percentage(title=_("Warning at"), default_value=80.0),
6959 Percentage(title=_("Critical at"), default_value=90.0),
6964 forth=lambda old: not old and {'levels': (80.0, 90.0)} or old,
6966 TextAscii(title=_("Routing Engine"),),
6967 "dict",
6970 register_check_parameters(
6971 RulespecGroupCheckParametersOperatingSystem, "netscaler_mem", _("Netscaler Memory Usage"),
6972 Tuple(
6973 title=_("Specify levels in percentage of total memory usage"),
6974 elements=[
6975 Percentage(
6976 title=_("Warning at a usage of"),
6977 unit=_("% of RAM"),
6978 default_value=80.0,
6979 maxvalue=100.0),
6980 Percentage(
6981 title=_("Critical at a usage of"),
6982 unit=_("% of RAM"),
6983 default_value=90.0,
6984 maxvalue=100.0)
6985 ]), None, "first")
6987 register_check_parameters(
6988 RulespecGroupCheckParametersOperatingSystem, "netscaler_vserver", _("Netscaler VServer States"),
6989 Dictionary(elements=[
6990 ("health_levels",
6991 Tuple(
6992 title=_("Lower health levels"),
6993 elements=[
6994 Percentage(title=_("Warning below"), default_value=100.0),
6995 Percentage(title=_("Critical below"), default_value=0.1),
6996 ])),
6997 ]), TextAscii(title=_("Name of VServer")), "dict")
6999 register_check_parameters(
7000 RulespecGroupCheckParametersOperatingSystem,
7001 "general_flash_usage",
7002 _("Flash Space Usage"),
7003 Alternative(elements=[
7004 Tuple(
7005 title=_("Specify levels in percentage of total Flash"),
7006 elements=[
7007 Percentage(title=_("Warning at a usage of"), label=_("% of Flash"), maxvalue=None),
7008 Percentage(title=_("Critical at a usage of"), label=_("% of Flash"), maxvalue=None)
7010 Tuple(
7011 title=_("Specify levels in absolute usage values"),
7012 elements=[
7013 Integer(title=_("Warning at"), unit=_("MB")),
7014 Integer(title=_("Critical at"), unit=_("MB"))
7017 None,
7018 match_type="first",
7021 register_check_parameters(
7022 RulespecGroupCheckParametersOperatingSystem,
7023 "cisco_supervisor_mem",
7024 _("Cisco Nexus Supervisor Memory Usage"),
7025 Tuple(
7026 title=_("The average utilization of memory on the active supervisor"),
7027 elements=[
7028 Percentage(title=_("Warning at a usage of"), default_value=80.0, maxvalue=100.0),
7029 Percentage(title=_("Critical at a usage of"), default_value=90.0, maxvalue=100.0)
7031 None,
7032 match_type="first",
7036 def UsedSize(**args):
7037 GB = 1024 * 1024 * 1024
7038 return Tuple(
7039 elements=[
7040 Filesize(title=_("Warning at"), default_value=1 * GB),
7041 Filesize(title=_("Critical at"), default_value=2 * GB),
7043 **args)
7046 def FreeSize(**args):
7047 GB = 1024 * 1024 * 1024
7048 return Tuple(
7049 elements=[
7050 Filesize(title=_("Warning below"), default_value=2 * GB),
7051 Filesize(title=_("Critical below"), default_value=1 * GB),
7053 **args)
7056 def UsedPercentage(default_percents=None, of_what=None):
7057 if of_what:
7058 unit = _("%% of %s") % of_what
7059 maxvalue = None
7060 else:
7061 unit = "%"
7062 maxvalue = 101.0
7063 return Tuple(elements=[
7064 Percentage(
7065 title=_("Warning at"),
7066 default_value=default_percents and default_percents[0] or 80.0,
7067 unit=unit,
7068 maxvalue=maxvalue,
7070 Percentage(
7071 title=_("Critical at"),
7072 default_value=default_percents and default_percents[1] or 90.0,
7073 unit=unit,
7074 maxvalue=maxvalue),
7078 def FreePercentage(default_percents=None, of_what=None):
7079 if of_what:
7080 unit = _("%% of %s") % of_what
7081 else:
7082 unit = "%"
7083 return Tuple(elements=[
7084 Percentage(
7085 title=_("Warning below"),
7086 default_value=default_percents and default_percents[0] or 20.0,
7087 unit=unit),
7088 Percentage(
7089 title=_("Critical below"),
7090 default_value=default_percents and default_percents[1] or 10.0,
7091 unit=unit),
7095 def DualMemoryLevels(what, default_percents=None):
7096 return CascadingDropdown(
7097 title=_("Levels for %s") % what,
7098 choices=[
7099 ("perc_used", _("Percentual levels for used %s") % what,
7100 UsedPercentage(default_percents)),
7101 ("perc_free", _("Percentual levels for free %s") % what, FreePercentage()),
7102 ("abs_used", _("Absolute levels for used %s") % what, UsedSize()),
7103 ("abs_free", _("Absolute levels for free %s") % what, FreeSize()),
7104 # PredictiveMemoryChoice(_("used %s") % what), # not yet implemented
7105 ("ignore", _("Do not impose levels")),
7109 def UpperMemoryLevels(what, default_percents=None, of_what=None):
7110 return CascadingDropdown(
7111 title=_("Upper levels for %s") % what,
7112 choices=[
7113 ("perc_used", _("Percentual levels%s") % (of_what and
7114 (_(" in relation to %s") % of_what) or ""),
7115 UsedPercentage(default_percents, of_what)),
7116 ("abs_used", _("Absolute levels"), UsedSize()),
7117 # PredictiveMemoryChoice(what), # not yet implemented
7118 ("ignore", _("Do not impose levels")),
7122 def LowerMemoryLevels(what, default_percents=None, of_what=None, help_text=None):
7123 return CascadingDropdown(
7124 title=_("Lower levels for %s") % what,
7125 help=help_text,
7126 choices=[
7127 ("perc_free", _("Percentual levels"), FreePercentage(default_percents, of_what)),
7128 ("abs_free", _("Absolute levels"), FreeSize()),
7129 # PredictiveMemoryChoice(what), # not yet implemented
7130 ("ignore", _("Do not impose levels")),
7134 # Beware: This is not yet implemented in the check.
7135 # def PredictiveMemoryChoice(what):
7136 # return ( "predictive", _("Predictive levels for %s") % what,
7137 # PredictiveLevels(
7138 # unit = _("GB"),
7139 # default_difference = (0.5, 1.0)
7140 # ))
7142 register_check_parameters(
7143 RulespecGroupCheckParametersOperatingSystem,
7144 "memory_linux",
7145 _("Memory and Swap usage on Linux"),
7146 Dictionary(
7147 elements=[
7148 ("levels_ram", DualMemoryLevels(_("RAM"))),
7149 ("levels_swap", DualMemoryLevels(_("Swap"))),
7150 ("levels_virtual", DualMemoryLevels(_("Total virtual memory"), (80.0, 90.0))),
7151 ("levels_total",
7152 UpperMemoryLevels(_("Total Data in relation to RAM"), (120.0, 150.0), _("RAM"))),
7153 ("levels_shm", UpperMemoryLevels(_("Shared memory"), (20.0, 30.0), _("RAM"))),
7154 ("levels_pagetables", UpperMemoryLevels(_("Page tables"), (8.0, 16.0), _("RAM"))),
7155 ("levels_writeback", UpperMemoryLevels(_("Disk Writeback"))),
7156 ("levels_committed",
7157 UpperMemoryLevels(_("Committed memory"), (100.0, 150.0), _("RAM + Swap"))),
7158 ("levels_commitlimit",
7159 LowerMemoryLevels(_("Commit Limit"), (20.0, 10.0), _("RAM + Swap"))),
7160 ("levels_available",
7161 LowerMemoryLevels(
7162 _("Estimated RAM for new processes"), (20.0, 10.0), _("RAM"),
7163 _("If the host has a kernel of version 3.14 or newer, the information MemAvailable is provided: "
7164 "\"An estimate of how much memory is available for starting new "
7165 "applications, without swapping. Calculated from MemFree, "
7166 "SReclaimable, the size of the file LRU lists, and the low "
7167 "watermarks in each zone. "
7168 "The estimate takes into account that the system needs some "
7169 "page cache to function well, and that not all reclaimable "
7170 "slab will be reclaimable, due to items being in use. The "
7171 "impact of those factors will vary from system to system.\" "
7172 "(https://www.kernel.org/doc/Documentation/filesystems/proc.txt)"))),
7173 ("levels_vmalloc", LowerMemoryLevels(_("Largest Free VMalloc Chunk"))),
7174 ("handle_hw_corrupted_error",
7175 MonitoringState(
7176 title=_("Handle Hardware Corrupted Error"),
7177 default_value=2,
7179 ],),
7180 None,
7181 "dict",
7184 register_check_parameters(
7185 RulespecGroupCheckParametersOperatingSystem,
7186 "memory",
7187 _("Main memory usage (UNIX / Other Devices)"),
7188 Transform(
7189 Dictionary(
7190 elements=[
7192 "levels",
7193 Alternative(
7194 title=_("Levels for memory"),
7195 show_alternative_title=True,
7196 default_value=(150.0, 200.0),
7197 match=match_dual_level_type,
7198 help=
7199 _("The used and free levels for the memory on UNIX systems take into account the "
7200 "currently used memory (RAM or SWAP) by all processes and sets this in relation "
7201 "to the total RAM of the system. This means that the memory usage can exceed 100%. "
7202 "A usage of 200% means that the total size of all processes is twice as large as "
7203 "the main memory, so <b>at least</b> half of it is currently swapped out. For systems "
7204 "without Swap space you should choose levels below 100%."),
7205 elements=[
7206 Alternative(
7207 title=_("Levels for used memory"),
7208 style="dropdown",
7209 elements=[
7210 Tuple(
7211 title=_("Specify levels in percentage of total RAM"),
7212 elements=[
7213 Percentage(
7214 title=_("Warning at a usage of"), maxvalue=None),
7215 Percentage(
7216 title=_("Critical at a usage of"), maxvalue=None)
7218 Tuple(
7219 title=_("Specify levels in absolute values"),
7220 elements=[
7221 Integer(title=_("Warning at"), unit=_("MB")),
7222 Integer(title=_("Critical at"), unit=_("MB"))
7225 Transform(
7226 Alternative(
7227 style="dropdown",
7228 elements=[
7229 Tuple(
7230 title=_("Specify levels in percentage of total RAM"),
7231 elements=[
7232 Percentage(
7233 title=_("Warning if less than"), maxvalue=None),
7234 Percentage(
7235 title=_("Critical if less than"), maxvalue=None)
7237 Tuple(
7238 title=_("Specify levels in absolute values"),
7239 elements=[
7240 Integer(title=_("Warning if below"), unit=_("MB")),
7241 Integer(title=_("Critical if below"), unit=_("MB"))
7244 title=_("Levels for free memory"),
7245 help=
7246 _("Keep in mind that if you have 1GB RAM and 1GB SWAP you need to "
7247 "specify 120% or 1200MB to get an alert if there is only 20% free RAM available. "
7248 "The free memory levels do not work with the fortigate check, because it does "
7249 "not provide total memory data."),
7250 allow_empty=False,
7251 forth=lambda val: tuple(-x for x in val),
7252 back=lambda val: tuple(-x for x in val))
7255 ("average",
7256 Integer(
7257 title=_("Averaging"),
7258 help=_("If this parameter is set, all measured values will be averaged "
7259 "over the specified time interval before levels are being applied. Per "
7260 "default, averaging is turned off."),
7261 unit=_("minutes"),
7262 minvalue=1,
7263 default_value=60,
7266 optional_keys=["average"],
7268 forth=lambda t: isinstance(t, tuple) and {"levels": t} or t,
7270 None,
7271 match_type="first",
7274 register_check_parameters(
7275 RulespecGroupCheckParametersOperatingSystem, "memory_relative",
7276 _("Main memory usage for Brocade fibre channel switches"),
7277 OptionalDropdownChoice(
7278 title=_("Memory usage"),
7279 choices=[(None, _("Do not impose levels"))],
7280 otherlabel=_("Percentual levels ->"),
7281 explicit=Tuple(elements=[
7282 Integer(title=_("Warning at"), default_value=85, unit="%"),
7283 Integer(title=_("Critical at"), default_value=90, unit="%"),
7284 ])), None, "first")
7286 register_check_parameters(
7287 RulespecGroupCheckParametersOperatingSystem,
7288 "memory_simple",
7289 _("Main memory usage of simple devices"),
7290 Transform(
7291 Dictionary(
7292 help=_("Memory levels for simple devices not running more complex OSs"),
7293 elements=[
7294 ("levels",
7295 CascadingDropdown(
7296 title=_("Levels for memory usage"),
7297 choices=[
7298 ("perc_used", _("Percentual levels for used memory"),
7299 Tuple(elements=[
7300 Percentage(
7301 title=_("Warning at a memory usage of"),
7302 default_value=80.0,
7303 maxvalue=None),
7304 Percentage(
7305 title=_("Critical at a memory usage of"),
7306 default_value=90.0,
7307 maxvalue=None)
7308 ])),
7309 ("abs_free", _("Absolute levels for free memory"),
7310 Tuple(elements=[
7311 Filesize(title=_("Warning below")),
7312 Filesize(title=_("Critical below"))
7313 ])),
7314 ("ignore", _("Do not impose levels")),
7315 ])),
7317 optional_keys=[],
7319 # Convert default levels from discovered checks
7320 forth=lambda v: not isinstance(v, dict) and {"levels": ("perc_used", v)} or v,
7322 TextAscii(
7323 title=_("Module name or empty"),
7324 help=_("Leave this empty for systems without modules, which just "
7325 "have one global memory usage."),
7326 allow_empty=True,
7328 "dict",
7331 register_check_parameters(
7332 RulespecGroupCheckParametersOperatingSystem,
7333 "memory_multiitem",
7334 _("Main memory usage of devices with modules"),
7335 Dictionary(
7336 help=_(
7337 "The memory levels for one specific module of this host. This is relevant for hosts that have "
7338 "several distinct memory areas, e.g. pluggable cards"),
7339 elements=[
7340 ("levels",
7341 Alternative(
7342 title=_("Memory levels"),
7343 elements=[
7344 Tuple(
7345 title=_("Specify levels in percentage of total RAM"),
7346 elements=[
7347 Percentage(
7348 title=_("Warning at a memory usage of"),
7349 default_value=80.0,
7350 maxvalue=None),
7351 Percentage(
7352 title=_("Critical at a memory usage of"),
7353 default_value=90.0,
7354 maxvalue=None)
7356 Tuple(
7357 title=_("Specify levels in absolute usage values"),
7358 elements=[
7359 Filesize(title=_("Warning at")),
7360 Filesize(title=_("Critical at"))
7362 ])),
7364 optional_keys=[]),
7365 TextAscii(title=_("Module name"), allow_empty=False),
7366 "dict",
7369 register_check_parameters(
7370 RulespecGroupCheckParametersOperatingSystem,
7371 "memory_arbor",
7372 _("Memory and Swap usage on Arbor devices"),
7373 Dictionary(
7374 elements=[
7375 ("levels_ram", DualMemoryLevels(_("RAM"))),
7376 ("levels_swap", DualMemoryLevels(_("Swap"))),
7377 ],),
7378 None,
7379 "dict",
7382 register_check_parameters(
7383 RulespecGroupCheckParametersNetworking, "mem_cluster", _("Memory Usage of Clusters"),
7384 ListOf(
7385 Tuple(elements=[
7386 Integer(title=_("Equal or more than"), unit=_("nodes")),
7387 Tuple(
7388 title=_("Percentage of total RAM"),
7389 elements=[
7390 Percentage(title=_("Warning at a RAM usage of"), default_value=80.0),
7391 Percentage(title=_("Critical at a RAM usage of"), default_value=90.0),
7394 help=_("Here you can specify the total memory usage levels for clustered hosts."),
7395 title=_("Memory Usage"),
7396 add_label=_("Add limits")), None, "first", False)
7398 register_check_parameters(
7399 RulespecGroupCheckParametersNetworking, "cpu_utilization_cluster",
7400 _("CPU Utilization of Clusters"),
7401 ListOf(
7402 Tuple(elements=[
7403 Integer(title=_("Equal or more than"), unit=_("nodes")),
7404 Tuple(
7405 elements=[
7406 Percentage(title=_("Warning at a utilization of"), default_value=90.0),
7407 Percentage(title=_("Critical at a utilization of"), default_value=95.0)
7409 title=_("Alert on too high CPU utilization"),
7412 help=_(
7413 "Configure levels for averaged CPU utilization depending on number of cluster nodes. "
7414 "The CPU utilization sums up the percentages of CPU time that is used "
7415 "for user processes and kernel routines over all available cores within "
7416 "the last check interval. The possible range is from 0% to 100%"),
7417 title=_("Memory Usage"),
7418 add_label=_("Add limits")), None, "first", False)
7420 register_check_parameters(
7421 RulespecGroupCheckParametersOperatingSystem,
7422 "esx_host_memory",
7423 _("Main memory usage of ESX host system"),
7424 Tuple(
7425 title=_("Specify levels in percentage of total RAM"),
7426 elements=[
7427 Percentage(title=_("Warning at a RAM usage of"), default_value=80.0),
7428 Percentage(title=_("Critical at a RAM usage of"), default_value=90.0),
7430 None,
7431 match_type="first",
7434 register_check_parameters(
7435 RulespecGroupCheckParametersOperatingSystem,
7436 "vm_guest_tools",
7437 _("Virtual machine (for example ESX) guest tools status"),
7438 Dictionary(
7439 optional_keys=False,
7440 elements=[
7441 ("guestToolsCurrent",
7442 MonitoringState(
7443 title=_("VMware Tools is installed, and the version is current"),
7444 default_value=0,
7446 ("guestToolsNeedUpgrade",
7447 MonitoringState(
7448 title=_("VMware Tools is installed, but the version is not current"),
7449 default_value=1,
7451 ("guestToolsNotInstalled",
7452 MonitoringState(
7453 title=_("VMware Tools have never been installed"),
7454 default_value=2,
7456 ("guestToolsUnmanaged",
7457 MonitoringState(
7458 title=_("VMware Tools is installed, but it is not managed by VMWare"),
7459 default_value=1,
7462 None,
7463 "dict",
7465 register_check_parameters(
7466 RulespecGroupCheckParametersOperatingSystem,
7467 "vm_heartbeat",
7468 _("Virtual machine (for example ESX) heartbeat status"),
7469 Dictionary(
7470 optional_keys=False,
7471 elements=[
7472 ("heartbeat_missing",
7473 MonitoringState(
7474 title=_("No heartbeat"),
7475 help=_("Guest operating system may have stopped responding."),
7476 default_value=2,
7478 ("heartbeat_intermittend",
7479 MonitoringState(
7480 title=_("Intermittent heartbeat"),
7481 help=_("May be due to high guest load."),
7482 default_value=1,
7484 ("heartbeat_no_tools",
7485 MonitoringState(
7486 title=_("Heartbeat tools missing or not installed"),
7487 help=_("No VMWare Tools installed."),
7488 default_value=1,
7490 ("heartbeat_ok",
7491 MonitoringState(
7492 title=_("Heartbeat OK"),
7493 help=_("Guest operating system is responding normally."),
7494 default_value=0,
7497 None,
7498 "dict",
7501 register_check_parameters(
7502 RulespecGroupCheckParametersApplications, "services_summary", _("Windows Service Summary"),
7503 Dictionary(
7504 title=_('Autostart Services'),
7505 elements=[
7506 ('ignored',
7507 ListOfStrings(
7508 title=_("Ignored autostart services"),
7509 help=_('Regular expressions matching the begining of the internal name '
7510 'or the description of the service. '
7511 'If no name is given then this rule will match all services. The '
7512 'match is done on the <i>beginning</i> of the service name. It '
7513 'is done <i>case sensitive</i>. You can do a case insensitive match '
7514 'by prefixing the regular expression with <tt>(?i)</tt>. Example: '
7515 '<tt>(?i).*mssql</tt> matches all services which contain <tt>MSSQL</tt> '
7516 'or <tt>MsSQL</tt> or <tt>mssql</tt> or...'),
7517 orientation="horizontal",
7519 ('state_if_stopped',
7520 MonitoringState(
7521 title=_("Default state if stopped autostart services are found"),
7522 default_value=0,
7525 ), None, "dict")
7527 register_check_parameters(
7528 RulespecGroupCheckParametersApplications, "solaris_services_summary",
7529 _("Solaris Services Summary"),
7530 Dictionary(
7531 elements=[
7532 ('maintenance_state',
7533 MonitoringState(
7534 title=_("State if 'maintenance' services are found"),
7535 default_value=0,
7537 ],), None, "dict")
7539 register_check_parameters(
7540 RulespecGroupCheckParametersApplications,
7541 "esx_vsphere_objects",
7542 _("State of ESX hosts and virtual machines"),
7543 Dictionary(
7544 help=_("Usually the check goes to WARN if a VM or host is powered off and OK otherwise. "
7545 "You can change this behaviour on a per-state-basis here."),
7546 optional_keys=False,
7547 elements=[
7548 ("states",
7549 Dictionary(
7550 title=_("Target states"),
7551 optional_keys=False,
7552 elements=[
7553 ("poweredOn",
7554 MonitoringState(
7555 title=_("Powered ON"),
7556 help=_("Check result if the host or VM is powered on"),
7557 default_value=0,
7559 ("poweredOff",
7560 MonitoringState(
7561 title=_("Powered OFF"),
7562 help=_("Check result if the host or VM is powered off"),
7563 default_value=1,
7565 ("suspended",
7566 MonitoringState(
7567 title=_("Suspended"),
7568 help=_("Check result if the host or VM is suspended"),
7569 default_value=1,
7571 ("unknown",
7572 MonitoringState(
7573 title=_("Unknown"),
7574 help=_(
7575 "Check result if the host or VM state is reported as <i>unknown</i>"),
7576 default_value=3,
7578 ])),
7580 TextAscii(
7581 title=_("Name of the VM/HostSystem"),
7582 help=_(
7583 "Please do not forget to specify either <tt>VM</tt> or <tt>HostSystem</tt>. Example: <tt>VM abcsrv123</tt>. Also note, "
7584 "that we match the <i>beginning</i> of the name."),
7585 regex="(^VM|HostSystem)( .*|$)",
7586 regex_error=_("The name of the system must begin with <tt>VM</tt> or <tt>HostSystem</tt>."),
7587 allow_empty=False,
7589 "dict",
7592 register_check_parameters(
7593 RulespecGroupCheckParametersApplications,
7594 "esx_vsphere_objects_count",
7595 _("Distribution of virtual machines over ESX hosts"),
7596 Dictionary(
7597 optional_keys=False,
7598 elements=[
7599 ("distribution",
7600 ListOf(
7601 Dictionary(
7602 optional_keys=False,
7603 elements=[("vm_names", ListOfStrings(title=_("VMs"))),
7604 ("hosts_count", Integer(title=_("Number of hosts"),
7605 default_value=2)),
7606 ("state",
7607 MonitoringState(title=_("State if violated"), default_value=1))]),
7608 title=_("VM distribution"),
7609 help=_(
7610 "You can specify lists of VM names and a number of hosts,"
7611 " to make sure the specfied VMs are distributed across at least so many hosts."
7612 " E.g. provide two VM names and set 'Number of hosts' to two,"
7613 " to make sure those VMs are not running on the same host."))),
7615 None,
7616 "dict",
7620 def windows_printer_queues_forth(old):
7621 default = {
7622 "warn_states": [8, 11],
7623 "crit_states": [9, 10],
7625 if isinstance(old, tuple):
7626 default['levels'] = old
7627 if isinstance(old, dict):
7628 return old
7629 return default
7632 register_check_parameters(
7633 RulespecGroupCheckParametersPrinters,
7634 "windows_printer_queues",
7635 _("Number of open jobs of a printer on windows"),
7636 Transform(
7637 Dictionary(
7638 title=_("Windows Printer Configuration"),
7639 elements=[
7641 "levels",
7642 Tuple(
7643 title=_("Levels for the number of print jobs"),
7644 help=_("This rule is applied to the number of print jobs "
7645 "currently waiting in windows printer queue."),
7646 elements=[
7647 Integer(title=_("Warning at"), unit=_("jobs"), default_value=40),
7648 Integer(title=_("Critical at"), unit=_("jobs"), default_value=60),
7651 ("crit_states",
7652 ListChoice(
7653 title=_("States who should lead to critical"),
7654 choices=[
7655 (0, "Unkown"),
7656 (1, "Other"),
7657 (2, "No Error"),
7658 (3, "Low Paper"),
7659 (4, "No Paper"),
7660 (5, "Low Toner"),
7661 (6, "No Toner"),
7662 (7, "Door Open"),
7663 (8, "Jammed"),
7664 (9, "Offline"),
7665 (10, "Service Requested"),
7666 (11, "Output Bin Full"),
7668 default_value=[9, 10],
7670 ("warn_states",
7671 ListChoice(
7672 title=_("States who should lead to warning"),
7673 choices=[
7674 (0, "Unkown"),
7675 (1, "Other"),
7676 (2, "No Error"),
7677 (3, "Low Paper"),
7678 (4, "No Paper"),
7679 (5, "Low Toner"),
7680 (6, "No Toner"),
7681 (7, "Door Open"),
7682 (8, "Jammed"),
7683 (9, "Offline"),
7684 (10, "Service Requested"),
7685 (11, "Output Bin Full"),
7687 default_value=[8, 11],
7690 forth=windows_printer_queues_forth,
7692 TextAscii(title=_("Printer Name"), allow_empty=True),
7693 match_type="first",
7696 register_check_parameters(
7697 RulespecGroupCheckParametersPrinters,
7698 "printer_input",
7699 _("Printer Input Units"),
7700 Dictionary(
7701 elements=[
7702 ('capacity_levels',
7703 Tuple(
7704 title=_('Capacity remaining'),
7705 elements=[
7706 Percentage(title=_("Warning at"), default_value=0.0),
7707 Percentage(title=_("Critical at"), default_value=0.0),
7711 default_keys=['capacity_levels'],
7713 TextAscii(title=_('Unit Name'), allow_empty=True),
7714 match_type="dict",
7717 register_check_parameters(
7718 RulespecGroupCheckParametersPrinters,
7719 "printer_output",
7720 _("Printer Output Units"),
7721 Dictionary(
7722 elements=[
7723 ('capacity_levels',
7724 Tuple(
7725 title=_('Capacity filled'),
7726 elements=[
7727 Percentage(title=_("Warning at"), default_value=0.0),
7728 Percentage(title=_("Critical at"), default_value=0.0),
7732 default_keys=['capacity_levels'],
7734 TextAscii(title=_('Unit Name'), allow_empty=True),
7735 match_type="dict",
7738 register_check_parameters(
7739 RulespecGroupCheckParametersOperatingSystem,
7740 "cpu_load",
7741 _("CPU load (not utilization!)"),
7742 Levels(
7743 help=_("The CPU load of a system is the number of processes currently being "
7744 "in the state <u>running</u>, i.e. either they occupy a CPU or wait "
7745 "for one. The <u>load average</u> is the averaged CPU load over the last 1, "
7746 "5 or 15 minutes. The following levels will be applied on the average "
7747 "load. On Linux system the 15-minute average load is used when applying "
7748 "those levels. The configured levels are multiplied with the number of "
7749 "CPUs, so you should configure the levels based on the value you want to "
7750 "be warned \"per CPU\"."),
7751 unit="per core",
7752 default_difference=(2.0, 4.0),
7753 default_levels=(5.0, 10.0),
7755 None,
7756 match_type="first",
7759 register_check_parameters(
7760 RulespecGroupCheckParametersOperatingSystem,
7761 "cpu_utilization",
7762 _("CPU utilization for Appliances"),
7763 Optional(
7764 Tuple(elements=[
7765 Percentage(title=_("Warning at a utilization of")),
7766 Percentage(title=_("Critical at a utilization of"))
7768 label=_("Alert on too high CPU utilization"),
7769 help=_("The CPU utilization sums up the percentages of CPU time that is used "
7770 "for user processes and kernel routines over all available cores within "
7771 "the last check interval. The possible range is from 0% to 100%"),
7772 default_value=(90.0, 95.0)),
7773 None,
7774 match_type="first",
7777 register_check_parameters(
7778 RulespecGroupCheckParametersOperatingSystem,
7779 "cpu_utilization_multiitem",
7780 _("CPU utilization of Devices with Modules"),
7781 Dictionary(
7782 help=_("The CPU utilization sums up the percentages of CPU time that is used "
7783 "for user processes and kernel routines over all available cores within "
7784 "the last check interval. The possible range is from 0% to 100%"),
7785 elements=[
7787 "levels",
7788 Tuple(
7789 title=_("Alert on too high CPU utilization"),
7790 elements=[
7791 Percentage(title=_("Warning at a utilization of"), default_value=90.0),
7792 Percentage(title=_("Critical at a utilization of"), default_value=95.0)
7797 TextAscii(title=_("Module name"), allow_empty=False),
7798 match_type="dict",
7801 register_check_parameters(
7802 RulespecGroupCheckParametersOperatingSystem,
7803 "fpga_utilization",
7804 _("FPGA utilization"),
7805 Dictionary(
7806 help=_("Give FPGA utilization levels in percent. The possible range is from 0% to 100%."),
7807 elements=[
7809 "levels",
7810 Tuple(
7811 title=_("Alert on too high FPGA utilization"),
7812 elements=[
7813 Percentage(title=_("Warning at a utilization of"), default_value=80.0),
7814 Percentage(title=_("Critical at a utilization of"), default_value=90.0)
7819 TextAscii(title=_("FPGA"), allow_empty=False),
7820 match_type="dict",
7823 cpu_util_common_elements = [
7824 ("levels_single",
7825 Tuple(
7826 title=_("Levels on single cores"),
7827 elements=[
7828 Percentage(title=_("Warning at"), default_value=90.0),
7829 Percentage(title=_("Critical at"), default_value=95.0)
7831 help=_("Here you can set levels on the CPU utilization on single cores"),
7833 ("core_util_time_total",
7834 Tuple(
7835 title=_("Levels over an extended time period on total CPU utilization"),
7836 elements=[
7837 Percentage(title=_("High utilization at "), default_value=100.0),
7838 Age(title=_("Warning after "), default_value=5 * 60),
7839 Age(title=_("Critical after "), default_value=15 * 60),
7841 help=_(
7842 "With this configuration, check_mk will alert if the total CPU is "
7843 "exceeding a utilization threshold over an extended period of time. "
7844 "ATTENTION: This configuration cannot be used for check <i>lparstat_aix.cpu_util</i>!")
7846 ("core_util_time",
7847 Tuple(
7848 title=_("Levels over an extended time period on a single core CPU utilization"),
7849 elements=[
7850 Percentage(title=_("High utilization at "), default_value=100.0),
7851 Age(title=_("Warning after "), default_value=5 * 60),
7852 Age(title=_("Critical after "), default_value=15 * 60),
7854 help=_("A single thread fully utilizing a single core (potentially due to a bug) "
7855 "may go unnoticed when only monitoring the total utilization of the CPU. "
7856 "With this configuration, check_mk will alert if a single core is "
7857 "exceeding a utilization threshold over an extended period of time."
7858 "This is currently only supported on linux and windows agents "
7859 "as well as devices monitored through the host-resource mib"))),
7860 ("core_util_graph",
7861 Checkbox(
7862 title=_("Graphs for individual cores"),
7863 label=_("Enable performance graph for utilization of individual cores"),
7864 help=_("This adds another graph to the performance CPU utilization "
7865 "details page, showing utilization of individual cores. "
7866 "Please note that this graph may be impractical on "
7867 "device with very many cores. "
7868 "This is currently only supported on linux and windows agents "
7869 "as well as devices monitored through the host-resource mib"))),
7872 register_check_parameters(
7873 RulespecGroupCheckParametersOperatingSystem,
7874 "cpu_utilization_os",
7875 _("CPU utilization for simple devices"),
7876 Dictionary(
7877 help=_("This rule configures levels for the CPU utilization (not load) for "
7878 "the operating systems Windows and VMWare ESX host systems, as well as devices "
7879 "implementing the Host Resources MIB. The utilization "
7880 "ranges from 0 to 100 - regardless of the number of CPUs."),
7881 elements=[
7882 ("average",
7883 Integer(
7884 title=_("Averaging"),
7885 help=_("When this option is activated then the CPU utilization is being "
7886 "averaged <b>before</b> the levels are being applied."),
7887 unit=_("minutes"),
7888 minvalue=1,
7889 default_value=15,
7890 label=_("Compute average over last "),
7892 ("levels",
7893 Levels(
7894 title=_("Levels on total CPU utilization"),
7895 unit="%",
7896 default_levels=(85, 90),
7897 default_difference=(5, 8),
7898 default_value=None,
7900 ] + cpu_util_common_elements,
7902 None,
7903 match_type="dict",
7907 def transform_cpu_iowait(params):
7908 if isinstance(params, tuple):
7909 return {"iowait": params}
7911 return params
7914 register_check_parameters(
7915 RulespecGroupCheckParametersOperatingSystem,
7916 "cpu_iowait",
7917 _("CPU utilization on Linux/UNIX"),
7918 Transform(
7919 Dictionary(elements=[
7920 ("util",
7921 Levels(
7922 title=_("Levels on total CPU utilization"),
7923 unit="%",
7924 default_levels=(90, 95),
7925 default_difference=(5, 8),
7926 default_value=None,
7927 help=
7928 _("The CPU utilization sums up the percentages of CPU time that is used "
7929 "for user processes, kernel routines (system), disk wait (sometimes also "
7930 "called IO wait) or nothing (idle). The levels are always applied "
7931 "on the average utiliazation since the last check - which is usually one minute."
7934 ("iowait",
7935 Tuple(
7936 title=_("Levels on disk wait (IO wait)"),
7937 elements=[
7938 Percentage(title=_("Warning at a disk wait of"), default_value=30.0),
7939 Percentage(title=_("Critical at a disk wait of"), default_value=50.0)
7941 help=
7942 _("The disk wait is the total percentage of time all CPUs have nothing else to do but waiting "
7943 "for data coming from or going to disk. If you have a significant disk wait "
7944 "the the bottleneck of your server is IO. Please note that depending on the "
7945 "applications being run this might or might not be totally normal."))),
7946 ("steal",
7947 Tuple(
7948 title=_("Levels on steal CPU utilization"),
7949 elements=[
7950 Percentage(title=_("Warning at a steal time of"), default_value=30.0),
7951 Percentage(title=_("Critical at a steal time of"), default_value=50.0)
7953 help=_("Here you can set levels on the steal CPU utilization."),
7955 ] + cpu_util_common_elements),
7956 forth=transform_cpu_iowait,
7958 None,
7959 "dict",
7963 def transform_humidity(p):
7964 if isinstance(p, (list, tuple)):
7965 p = {
7966 "levels_lower": (float(p[1]), float(p[0])),
7967 "levels": (float(p[2]), float(p[3])),
7969 return p
7972 register_check_parameters(
7973 RulespecGroupCheckParametersEnvironment,
7974 "humidity",
7975 _("Humidity Levels"),
7976 Transform(
7977 Dictionary(
7978 help=_("This Ruleset sets the threshold limits for humidity sensors"),
7979 elements=[
7980 ("levels",
7981 Tuple(
7982 title=_("Upper levels"),
7983 elements=[
7984 Percentage(title=_("Warning at")),
7985 Percentage(title=_("Critical at")),
7986 ])),
7987 ("levels_lower",
7988 Tuple(
7989 title=_("Lower levels"),
7990 elements=[
7991 Percentage(title=_("Warning below")),
7992 Percentage(title=_("Critical below")),
7993 ])),
7995 forth=transform_humidity,
7997 TextAscii(
7998 title=_("Sensor name"),
7999 help=_("The identifier of the sensor."),
8001 match_type="dict",
8004 register_check_parameters(
8005 RulespecGroupCheckParametersEnvironment,
8006 "single_humidity",
8007 _("Humidity Levels for devices with a single sensor"),
8008 Tuple(
8009 help=_("This Ruleset sets the threshold limits for humidity sensors"),
8010 elements=[
8011 Integer(title=_("Critical at or below"), unit="%"),
8012 Integer(title=_("Warning at or below"), unit="%"),
8013 Integer(title=_("Warning at or above"), unit="%"),
8014 Integer(title=_("Critical at or above"), unit="%"),
8016 None,
8017 match_type="first",
8020 db_levels_common = [
8021 ("levels",
8022 Alternative(
8023 title=_("Levels for the Tablespace usage"),
8024 default_value=(10.0, 5.0),
8025 elements=[
8026 Tuple(
8027 title=_("Percentage free space"),
8028 elements=[
8029 Percentage(title=_("Warning if below"), unit=_("% free")),
8030 Percentage(title=_("Critical if below"), unit=_("% free")),
8032 Tuple(
8033 title=_("Absolute free space"),
8034 elements=[
8035 Integer(title=_("Warning if below"), unit=_("MB"), default_value=1000),
8036 Integer(title=_("Critical if below"), unit=_("MB"), default_value=500),
8038 ListOf(
8039 Tuple(
8040 orientation="horizontal",
8041 elements=[
8042 Filesize(title=_("Tablespace larger than")),
8043 Alternative(
8044 title=_("Levels for the Tablespace size"),
8045 elements=[
8046 Tuple(
8047 title=_("Percentage free space"),
8048 elements=[
8049 Percentage(title=_("Warning if below"), unit=_("% free")),
8050 Percentage(title=_("Critical if below"), unit=_("% free")),
8052 Tuple(
8053 title=_("Absolute free space"),
8054 elements=[
8055 Integer(title=_("Warning if below"), unit=_("MB")),
8056 Integer(title=_("Critical if below"), unit=_("MB")),
8061 title=_('Dynamic levels'),
8063 ])),
8064 ("magic",
8065 Float(
8066 title=_("Magic factor (automatic level adaptation for large tablespaces)"),
8067 help=_("This is only be used in case of percentual levels"),
8068 minvalue=0.1,
8069 maxvalue=1.0,
8070 default_value=0.9)),
8071 ("magic_normsize",
8072 Integer(
8073 title=_("Reference size for magic factor"), minvalue=1, default_value=1000, unit=_("MB"))),
8074 ("magic_maxlevels",
8075 Tuple(
8076 title=_("Maximum levels if using magic factor"),
8077 help=_("The tablespace levels will never be raise above these values, when using "
8078 "the magic factor and the tablespace is very small."),
8079 elements=[
8080 Percentage(
8081 title=_("Maximum warning level"),
8082 unit=_("% free"),
8083 allow_int=True,
8084 default_value=60.0),
8085 Percentage(
8086 title=_("Maximum critical level"),
8087 unit=_("% free"),
8088 allow_int=True,
8089 default_value=50.0)
8093 register_check_parameters(
8094 RulespecGroupCheckParametersApplications,
8095 "oracle_tablespaces",
8096 _("Oracle Tablespaces"),
8097 Dictionary(
8098 help=_("A tablespace is a container for segments (tables, indexes, etc). A "
8099 "database consists of one or more tablespaces, each made up of one or "
8100 "more data files. Tables and indexes are created within a particular "
8101 "tablespace. "
8102 "This rule allows you to define checks on the size of tablespaces."),
8103 elements=db_levels_common + [
8104 ("autoextend",
8105 DropdownChoice(
8106 title=_("Expected autoextend setting"),
8107 choices=[
8108 (True, _("Autoextend is expected to be ON")),
8109 (False, _("Autoextend is expected to be OFF")),
8110 (None, _("Autoextend will be ignored")),
8111 ])),
8112 ("autoextend_severity",
8113 MonitoringState(
8114 title=_("Severity of invalid autoextend setting"),
8115 default_value=2,
8117 ("defaultincrement",
8118 DropdownChoice(
8119 title=_("Default Increment"),
8120 choices=[
8121 (True, _("State is WARNING in case the next extent has the default size.")),
8122 (False, _("Ignore default increment")),
8123 ])),
8124 ("map_file_online_states",
8125 ListOf(
8126 Tuple(
8127 orientation="horizontal",
8128 elements=[
8129 DropdownChoice(choices=[
8130 ("RECOVER", _("Recover")),
8131 ("OFFLINE", _("Offline")),
8133 MonitoringState()
8135 title=_('Map file online states'),
8139 TextAscii(
8140 title=_("Explicit tablespaces"),
8141 help=
8142 _("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>"
8144 regex=r'.+\..+',
8145 allow_empty=False),
8146 match_type="dict",
8149 register_check_parameters(
8150 RulespecGroupCheckParametersApplications,
8151 "oracle_processes",
8152 _("Oracle Processes"),
8153 Dictionary(
8154 help=_(
8155 "Here you can override the default levels for the ORACLE Processes check. The levels "
8156 "are applied on the number of used processes in percentage of the configured limit."),
8157 elements=[
8158 ("levels",
8159 Tuple(
8160 title=_("Levels for used processes"),
8161 elements=[
8162 Percentage(title=_("Warning if more than"), default_value=70.0),
8163 Percentage(title=_("Critical if more than"), default_value=90.0)
8164 ])),
8166 optional_keys=False,
8168 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
8169 "dict",
8172 register_check_parameters(
8173 RulespecGroupCheckParametersApplications,
8174 "oracle_recovery_area",
8175 _("Oracle Recovery Area"),
8176 Dictionary(elements=[("levels",
8177 Tuple(
8178 title=_("Levels for used space (reclaimable is considered as free)"),
8179 elements=[
8180 Percentage(title=_("warning at"), default_value=70.0),
8181 Percentage(title=_("critical at"), default_value=90.0),
8182 ]))]),
8183 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
8184 "dict",
8187 register_check_parameters(
8188 RulespecGroupCheckParametersApplications,
8189 "oracle_dataguard_stats",
8190 _("Oracle Data-Guard Stats"),
8191 Dictionary(
8192 help=
8193 _("The Data-Guard statistics are available in Oracle Enterprise Edition with enabled Data-Guard. "
8194 "The <tt>init.ora</tt> parameter <tt>dg_broker_start</tt> must be <tt>TRUE</tt> for this check. "
8195 "The apply and transport lag can be configured with this rule."),
8196 elements=[
8197 ("apply_lag",
8198 Tuple(
8199 title=_("Apply Lag Maximum Time"),
8200 help=_("The maximum limit for the apply lag in <tt>v$dataguard_stats</tt>."),
8201 elements=[Age(title=_("Warning at"),),
8202 Age(title=_("Critical at"),)])),
8203 ("apply_lag_min",
8204 Tuple(
8205 title=_("Apply Lag Minimum Time"),
8206 help=_(
8207 "The minimum limit for the apply lag in <tt>v$dataguard_stats</tt>. "
8208 "This is only useful if also <i>Apply Lag Maximum Time</i> has been configured."
8210 elements=[Age(title=_("Warning at"),),
8211 Age(title=_("Critical at"),)])),
8212 ("transport_lag",
8213 Tuple(
8214 title=_("Transport Lag"),
8215 help=_("The limit for the transport lag in <tt>v$dataguard_stats</tt>"),
8216 elements=[Age(title=_("Warning at"),),
8217 Age(title=_("Critical at"),)])),
8219 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
8220 "dict",
8223 register_check_parameters(
8224 RulespecGroupCheckParametersApplications,
8225 "oracle_undostat",
8226 _("Oracle Undo Retention"),
8227 Dictionary(elements=[
8228 ("levels",
8229 Tuple(
8230 title=_("Levels for remaining undo retention"),
8231 elements=[
8232 Age(title=_("warning if less then"), default_value=600),
8233 Age(title=_("critical if less then"), default_value=300),
8234 ])),
8236 'nospaceerrcnt_state',
8237 MonitoringState(
8238 default_value=2,
8239 title=_("State in case of non space error count is greater then 0: "),
8243 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
8244 "dict",
8247 register_check_parameters(
8248 RulespecGroupCheckParametersApplications,
8249 "oracle_rman",
8250 _("Oracle RMAN Backups"),
8251 Dictionary(elements=[("levels",
8252 Tuple(
8253 title=_("Maximum Age for RMAN backups"),
8254 elements=[
8255 Age(title=_("warning if older than"), default_value=1800),
8256 Age(title=_("critical if older than"), default_value=3600),
8257 ]))]),
8258 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
8259 "dict",
8262 register_check_parameters(
8263 RulespecGroupCheckParametersApplications,
8264 "oracle_recovery_status",
8265 _("Oracle Recovery Status"),
8266 Dictionary(elements=[("levels",
8267 Tuple(
8268 title=_("Levels for checkpoint time"),
8269 elements=[
8270 Age(title=_("warning if higher then"), default_value=1800),
8271 Age(title=_("critical if higher then"), default_value=3600),
8272 ])),
8273 ("backup_age",
8274 Tuple(
8275 title=_("Levels for user managed backup files"),
8276 help=_("Important! This checks is only for monitoring of datafiles "
8277 "who were left in backup mode. "
8278 "(alter database datafile ... begin backup;) "),
8279 elements=[
8280 Age(title=_("warning if higher then"), default_value=1800),
8281 Age(title=_("critical if higher then"), default_value=3600),
8282 ]))]),
8283 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
8284 "dict",
8287 register_check_parameters(
8288 RulespecGroupCheckParametersApplications,
8289 "oracle_jobs",
8290 _("Oracle Scheduler Job"),
8291 Dictionary(
8292 help=_("A scheduler job is an object in an ORACLE database which could be "
8293 "compared to a cron job on Unix. "),
8294 elements=[
8295 ("run_duration",
8296 Tuple(
8297 title=_("Maximum run duration for last execution"),
8298 help=_("Here you can define an upper limit for the run duration of "
8299 "last execution of the job."),
8300 elements=[
8301 Age(title=_("warning at")),
8302 Age(title=_("critical at")),
8303 ])),
8304 ("disabled",
8305 DropdownChoice(
8306 title=_("Job State"),
8307 help=_("The state of the job is ignored per default."),
8308 totext="",
8309 choices=[
8310 (True, _("Ignore the state of the Job")),
8311 (False, _("Consider the state of the job")),
8314 ("status_disabled_jobs",
8315 MonitoringState(title="Status of service in case of disabled job", default_value=0)),
8316 ("status_missing_jobs",
8317 MonitoringState(
8318 title=_("Status of service in case of missing job."),
8319 default_value=2,
8322 TextAscii(
8323 title=_("Scheduler Job Name"),
8324 help=_("Here you can set explicit Scheduler-Jobs by defining them via SID, Job-Owner "
8325 "and Job-Name, separated by a dot, for example <tt>TUX12C.SYS.PURGE_LOG</tt>"),
8326 regex=r'.+\..+',
8327 allow_empty=False),
8328 match_type="dict",
8331 register_check_parameters(
8332 RulespecGroupCheckParametersApplications,
8333 "oracle_instance",
8334 _("Oracle Instance"),
8335 Dictionary(
8336 title=_("Consider state of Archivelogmode: "),
8337 elements=[
8338 ('archivelog',
8339 MonitoringState(
8340 default_value=0,
8341 title=_("State in case of Archivelogmode is enabled: "),
8344 'noarchivelog',
8345 MonitoringState(
8346 default_value=1,
8347 title=_("State in case of Archivelogmode is disabled: "),
8351 'forcelogging',
8352 MonitoringState(
8353 default_value=0,
8354 title=_("State in case of Force Logging is enabled: "),
8358 'noforcelogging',
8359 MonitoringState(
8360 default_value=1,
8361 title=_("State in case of Force Logging is disabled: "),
8365 'logins',
8366 MonitoringState(
8367 default_value=2,
8368 title=_("State in case of logins are not possible: "),
8372 'primarynotopen',
8373 MonitoringState(
8374 default_value=2,
8375 title=_("State in case of Database is PRIMARY and not OPEN: "),
8378 ('uptime_min',
8379 Tuple(
8380 title=_("Minimum required uptime"),
8381 elements=[
8382 Age(title=_("Warning if below")),
8383 Age(title=_("Critical if below")),
8384 ])),
8385 ('ignore_noarchivelog',
8386 Checkbox(
8387 title=_("Ignore state of no-archive log"),
8388 label=_("Enable"),
8389 help=_("If active, only a single summary item is displayed. The summary "
8390 "will explicitly mention sensors in warn/crit state but the "
8391 "sensors that are ok are aggregated."),
8392 default_value=False)),
8395 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
8396 match_type="dict",
8399 register_check_parameters(
8400 RulespecGroupCheckParametersApplications, "asm_diskgroup",
8401 _("ASM Disk Group (used space and growth)"),
8402 Dictionary(
8403 elements=filesystem_elements + [
8404 ("req_mir_free",
8405 DropdownChoice(
8406 title=_("Handling for required mirror space"),
8407 totext="",
8408 choices=[
8409 (False, _("Do not regard required mirror space as free space")),
8410 (True, _("Regard required mirror space as free space")),
8412 help=_(
8413 "ASM calculates the free space depending on free_mb or required mirror "
8414 "free space. Enable this option to set the check against required "
8415 "mirror free space. This only works for normal or high redundancy Disk Groups."
8416 ))),
8418 hidden_keys=["flex_levels"],
8420 TextAscii(
8421 title=_("ASM Disk Group"),
8422 help=_("Specify the name of the ASM Disk Group "),
8423 allow_empty=False), "dict")
8426 def _vs_mssql_backup_age(title):
8427 return Alternative(
8428 title=_("%s" % title),
8429 style="dropdown",
8430 elements=[
8431 Tuple(
8432 title=_("Set levels"),
8433 elements=[
8434 Age(title=_("Warning if older than")),
8435 Age(title=_("Critical if older than")),
8437 Tuple(
8438 title=_("No levels"),
8439 elements=[
8440 FixedValue(None, totext=""),
8441 FixedValue(None, totext=""),
8445 register_check_parameters(
8446 RulespecGroupCheckParametersApplications,
8447 "mssql_backup",
8448 _("MSSQL Backup summary"),
8449 Transform(
8450 Dictionary(
8451 help = _("This rule allows you to set limits on the age of backups for "
8452 "different backup types. If your agent does not support "
8453 "backup types (e.g. <i>Log Backup</i>, <i>Database Diff "
8454 "Backup</i>, etc.) you can use the option <i>Database Backup"
8455 "</i> to set a general limit"),
8456 elements = [
8457 ("database", _vs_mssql_backup_age("Database backup")),
8458 ("database_diff", _vs_mssql_backup_age("Database diff backup")),
8459 ("log", _vs_mssql_backup_age("Log backup")),
8460 ("file_or_filegroup", _vs_mssql_backup_age("File or filegroup backup")),
8461 ("file_diff", _vs_mssql_backup_age("File diff backup")),
8462 ("partial", _vs_mssql_backup_age("Partial backup")),
8463 ("partial_diff", _vs_mssql_backup_age("Partial diff backup")),
8464 ("unspecific", _vs_mssql_backup_age("Unspecific backup")),
8465 ("not_found", MonitoringState(title=_("State if no backup found"))),
8468 forth = lambda params: (params if isinstance(params, dict)
8469 else {'database': (params[0], params[1])})
8471 TextAscii(
8472 title = _("Service descriptions"),
8473 allow_empty = False),
8474 "first",
8477 register_check_parameters(
8478 RulespecGroupCheckParametersApplications,
8479 "mssql_backup_per_type",
8480 _("MSSQL Backup"),
8481 Dictionary(elements=[
8482 ("levels", _vs_mssql_backup_age("Upper levels for the backup age")),
8484 TextAscii(title=_("Backup name"), allow_empty=False),
8485 "dict",
8488 register_check_parameters(
8489 RulespecGroupCheckParametersApplications, "mssql_file_sizes",
8490 _("MSSQL Log and Data File Sizes"),
8491 Dictionary(
8492 title=_("File Size Levels"),
8493 elements=[
8494 ("data_files",
8495 Tuple(
8496 title=_("Levels for Datafiles"),
8497 elements=[
8498 Filesize(title=_("Warning at")),
8499 Filesize(title=_("Critical at")),
8500 ])),
8501 ("log_files",
8502 Tuple(
8503 title=_("Log files: Absolute upper thresholds"),
8504 elements=[Filesize(title=_("Warning at")),
8505 Filesize(title=_("Critical at"))])),
8506 ("log_files_used",
8507 Alternative(
8508 title=_("Levels for log files used"),
8509 elements=[
8510 Tuple(
8511 title=_("Upper absolute levels"),
8512 elements=[
8513 Filesize(title=_("Warning at")),
8514 Filesize(title=_("Critical at"))
8516 Tuple(
8517 title=_("Upper percentage levels"),
8518 elements=[
8519 Percentage(title=_("Warning at")),
8520 Percentage(title=_("Critical at"))
8522 ])),
8523 ]), TextAscii(title=_("Service descriptions"), allow_empty=False), "dict")
8525 register_check_parameters(
8526 RulespecGroupCheckParametersApplications,
8527 "mssql_tablespaces",
8528 _("MSSQL Size of Tablespace"),
8529 Dictionary(
8530 elements=[
8531 ("size",
8532 Tuple(
8533 title=_("Upper levels for size"),
8534 elements=[Filesize(title=_("Warning at")),
8535 Filesize(title=_("Critical at"))])),
8536 ("reserved",
8537 Alternative(
8538 title=_("Upper levels for reserved space"),
8539 elements=[
8540 Tuple(
8541 title=_("Absolute levels"),
8542 elements=[
8543 Filesize(title=_("Warning at")),
8544 Filesize(title=_("Critical at"))
8546 Tuple(
8547 title=_("Percentage levels"),
8548 elements=[
8549 Percentage(title=_("Warning at")),
8550 Percentage(title=_("Critical at"))
8552 ])),
8553 ("data",
8554 Alternative(
8555 title=_("Upper levels for data"),
8556 elements=[
8557 Tuple(
8558 title=_("Absolute levels"),
8559 elements=[
8560 Filesize(title=_("Warning at")),
8561 Filesize(title=_("Critical at"))
8563 Tuple(
8564 title=_("Percentage levels"),
8565 elements=[
8566 Percentage(title=_("Warning at")),
8567 Percentage(title=_("Critical at"))
8569 ])),
8570 ("indexes",
8571 Alternative(
8572 title=_("Upper levels for indexes"),
8573 elements=[
8574 Tuple(
8575 title=_("Absolute levels"),
8576 elements=[
8577 Filesize(title=_("Warning at")),
8578 Filesize(title=_("Critical at"))
8580 Tuple(
8581 title=_("Percentage levels"),
8582 elements=[
8583 Percentage(title=_("Warning at")),
8584 Percentage(title=_("Critical at"))
8586 ])),
8587 ("unused",
8588 Alternative(
8589 title=_("Upper levels for unused space"),
8590 elements=[
8591 Tuple(
8592 title=_("Absolute levels"),
8593 elements=[
8594 Filesize(title=_("Warning at")),
8595 Filesize(title=_("Critical at"))
8597 Tuple(
8598 title=_("Percentage levels"),
8599 elements=[
8600 Percentage(title=_("Warning at")),
8601 Percentage(title=_("Critical at"))
8603 ])),
8604 ("unallocated",
8605 Alternative(
8606 title=_("Lower levels for unallocated space"),
8607 elements=[
8608 Tuple(
8609 title=_("Absolute levels"),
8610 elements=[
8611 Filesize(title=_("Warning below")),
8612 Filesize(title=_("Critical below"))
8614 Tuple(
8615 title=_("Percentage levels"),
8616 elements=[
8617 Percentage(title=_("Warning below")),
8618 Percentage(title=_("Critical below"))
8620 ])),
8621 ],),
8622 TextAscii(title=_("Tablespace name"), allow_empty=False),
8623 match_type="dict",
8626 register_check_parameters(
8627 RulespecGroupCheckParametersApplications,
8628 "mssql_page_activity",
8629 _("MSSQL Page Activity"),
8630 Dictionary(
8631 title=_("Page Activity Levels"),
8632 elements=[
8633 ("page_reads/sec",
8634 Tuple(
8635 title=_("Reads/sec"),
8636 elements=[
8637 Float(title=_("warning at"), unit=_("/sec")),
8638 Float(title=_("critical at"), unit=_("/sec")),
8639 ])),
8640 ("page_writes/sec",
8641 Tuple(
8642 title=_("Writes/sec"),
8643 elements=[
8644 Float(title=_("warning at"), unit=_("/sec")),
8645 Float(title=_("critical at"), unit=_("/sec")),
8646 ])),
8647 ("page_lookups/sec",
8648 Tuple(
8649 title=_("Lookups/sec"),
8650 elements=[
8651 Float(title=_("warning at"), unit=_("/sec")),
8652 Float(title=_("critical at"), unit=_("/sec")),
8653 ])),
8655 TextAscii(title=_("Service descriptions"), allow_empty=False),
8656 match_type="dict")
8659 def levels_absolute_or_dynamic(name, value):
8660 return Alternative(
8661 title=_("Levels of %s %s") % (name, value),
8662 default_value=(80.0, 90.0),
8663 elements=[
8664 Tuple(
8665 title=_("Percentage %s space") % value,
8666 elements=[
8667 Percentage(title=_("Warning at"), unit=_("% used")),
8668 Percentage(title=_("Critical at"), unit=_("% used")),
8670 Tuple(
8671 title=_("Absolute %s space") % value,
8672 elements=[
8673 Integer(title=_("Warning at"), unit=_("MB"), default_value=500),
8674 Integer(title=_("Critical at"), unit=_("MB"), default_value=1000),
8676 ListOf(
8677 Tuple(
8678 orientation="horizontal",
8679 elements=[
8680 Filesize(title=_(" larger than")),
8681 Alternative(
8682 title=_("Levels for the %s %s size") % (name, value),
8683 elements=[
8684 Tuple(
8685 title=_("Percentage %s space") % value,
8686 elements=[
8687 Percentage(title=_("Warning at"), unit=_("% used")),
8688 Percentage(title=_("Critical at"), unit=_("% used")),
8690 Tuple(
8691 title=_("Absolute free space"),
8692 elements=[
8693 Integer(title=_("Warning at"), unit=_("MB")),
8694 Integer(title=_("Critical at"), unit=_("MB")),
8699 title=_('Dynamic levels'),
8704 register_check_parameters(
8705 RulespecGroupCheckParametersApplications, "mssql_transactionlogs",
8706 _("MSSQL Transactionlog Sizes"),
8707 Dictionary(
8708 title=_("File Size Levels"),
8709 help=_("Specify levels for transactionlogs of a database. Please note that relative "
8710 "levels will only work if there is a max_size set for the file on the database "
8711 "side."),
8712 elements=[
8713 ("used_levels", levels_absolute_or_dynamic(_("Transactionlog"), _("used"))),
8714 ("allocated_used_levels",
8715 levels_absolute_or_dynamic(_("Transactionlog"), _("used of allocation"))),
8716 ("allocated_levels", levels_absolute_or_dynamic(_("Transactionlog"), _("allocated"))),
8717 ]), TextAscii(title=_("Database Name"), allow_empty=False), "dict")
8719 register_check_parameters(
8720 RulespecGroupCheckParametersApplications, "mssql_datafiles", _("MSSQL Datafile Sizes"),
8721 Dictionary(
8722 title=_("File Size Levels"),
8723 help=_("Specify levels for datafiles of a database. Please note that relative "
8724 "levels will only work if there is a max_size set for the file on the database "
8725 "side."),
8726 elements=[
8727 ("used_levels", levels_absolute_or_dynamic(_("Datafile"), _("used"))),
8728 ("allocated_used_levels",
8729 levels_absolute_or_dynamic(_("Datafile"), _("used of allocation"))),
8730 ("allocated_levels", levels_absolute_or_dynamic(_("Datafile"), _("allocated"))),
8731 ]), TextAscii(title=_("Database Name"), allow_empty=False), "dict")
8733 register_check_parameters(
8734 RulespecGroupCheckParametersApplications,
8735 "vm_snapshots",
8736 _("Virtual Machine Snapshots"),
8737 Dictionary(elements=[
8738 ("age",
8739 Tuple(
8740 title=_("Age of the last snapshot"),
8741 elements=[
8742 Age(title=_("Warning if older than")),
8743 Age(title=_("Critical if older than"))
8744 ])),
8745 ("age_oldest",
8746 Tuple(
8747 title=_("Age of the oldest snapshot"),
8748 elements=[
8749 Age(title=_("Warning if older than")),
8750 Age(title=_("Critical if older than"))
8751 ])),
8753 None,
8754 match_type="dict",
8757 register_check_parameters(
8758 RulespecGroupCheckParametersApplications,
8759 "veeam_backup",
8760 _("Veeam: Time since last Backup"),
8761 Dictionary(elements=[("age",
8762 Tuple(
8763 title=_("Time since end of last backup"),
8764 elements=[
8765 Age(title=_("Warning if older than"), default_value=108000),
8766 Age(title=_("Critical if older than"), default_value=172800)
8767 ]))]),
8768 TextAscii(title=_("Job name")),
8769 match_type="dict",
8772 register_check_parameters(
8773 RulespecGroupCheckParametersApplications,
8774 "backup_timemachine",
8775 _("Age of timemachine backup"),
8776 Dictionary(elements=[("age",
8777 Tuple(
8778 title=_("Maximum age of latest timemachine backup"),
8779 elements=[
8780 Age(title=_("Warning if older than"), default_value=86400),
8781 Age(title=_("Critical if older than"), default_value=172800)
8782 ]))]),
8783 None,
8784 match_type="dict",
8787 register_check_parameters(
8788 RulespecGroupCheckParametersApplications,
8789 "job",
8790 _("Age of jobs controlled by mk-job"),
8791 Dictionary(elements=[
8792 ("age",
8793 Tuple(
8794 title=_("Maximum time since last start of job execution"),
8795 elements=[
8796 Age(title=_("Warning at"), default_value=0),
8797 Age(title=_("Critical at"), default_value=0)
8798 ])),
8799 ("outcome_on_cluster",
8800 DropdownChoice(
8801 title=_("Clusters: Prefered check result of local checks"),
8802 help=_("If you're running local checks on clusters via clustered services rule "
8803 "you can influence the check result with this rule. You can choose between "
8804 "best or worst state. Default setting is worst state."),
8805 choices=[
8806 ("worst", _("Worst state")),
8807 ("best", _("Best state")),
8809 default_value="worst")),
8811 TextAscii(title=_("Job name"),),
8812 match_type="dict",
8815 register_check_parameters(
8816 RulespecGroupCheckParametersApplications,
8817 "mssql_counters_locks",
8818 _("MSSQL Locks"),
8819 Dictionary(
8820 help=_("This check monitors locking related information of MSSQL tablespaces."),
8821 elements=[
8823 "lock_requests/sec",
8824 Tuple(
8825 title=_("Lock Requests / sec"),
8826 help=
8827 _("Number of new locks and lock conversions per second requested from the lock manager."
8829 elements=[
8830 Float(title=_("Warning at"), unit=_("requests/sec")),
8831 Float(title=_("Critical at"), unit=_("requests/sec")),
8836 "lock_timeouts/sec",
8837 Tuple(
8838 title=_("Lock Timeouts / sec"),
8839 help=
8840 _("Number of lock requests per second that timed out, including requests for NOWAIT locks."
8842 elements=[
8843 Float(title=_("Warning at"), unit=_("timeouts/sec")),
8844 Float(title=_("Critical at"), unit=_("timeouts/sec")),
8849 "number_of_deadlocks/sec",
8850 Tuple(
8851 title=_("Number of Deadlocks / sec"),
8852 help=_("Number of lock requests per second that resulted in a deadlock."),
8853 elements=[
8854 Float(title=_("Warning at"), unit=_("deadlocks/sec")),
8855 Float(title=_("Critical at"), unit=_("deadlocks/sec")),
8860 "lock_waits/sec",
8861 Tuple(
8862 title=_("Lock Waits / sec"),
8863 help=_("Number of lock requests per second that required the caller to wait."),
8864 elements=[
8865 Float(title=_("Warning at"), unit=_("waits/sec")),
8866 Float(title=_("Critical at"), unit=_("waits/sec")),
8871 TextAscii(title=_("Service descriptions"), allow_empty=False),
8872 match_type="dict",
8875 mssql_waittypes = [
8876 "ABR",
8877 "ASSEMBLY_LOAD",
8878 "ASYNC_DISKPOOL_LOCK",
8879 "ASYNC_IO_COMPLETION",
8880 "ASYNC_NETWORK_IO",
8881 "AUDIT_GROUPCACHE_LOCK",
8882 "AUDIT_LOGINCACHE_LOCK",
8883 "AUDIT_ON_DEMAND_TARGET_LOCK",
8884 "AUDIT_XE_SESSION_MGR",
8885 "BACKUP",
8886 "BACKUP_OPERATOR",
8887 "BACKUPBUFFER",
8888 "BACKUPIO",
8889 "BACKUPTHREAD",
8890 "BAD_PAGE_PROCESS",
8891 "BROKER_CONNECTION_RECEIVE_TASK",
8892 "BROKER_ENDPOINT_STATE_MUTEX",
8893 "BROKER_EVENTHANDLER",
8894 "BROKER_INIT",
8895 "BROKER_MASTERSTART",
8896 "BROKER_RECEIVE_WAITFOR",
8897 "BROKER_REGISTERALLENDPOINTS",
8898 "BROKER_SERVICE",
8899 "BROKER_SHUTDOWN",
8900 "BROKER_TASK_STOP",
8901 "BROKER_TO_FLUSH",
8902 "BROKER_TRANSMITTER",
8903 "BUILTIN_HASHKEY_MUTEX",
8904 "CHECK_PRINT_RECORD",
8905 "CHECKPOINT_QUEUE",
8906 "CHKPT",
8907 "CLEAR_DB",
8908 "CLR_AUTO_EVENT",
8909 "CLR_CRST",
8910 "CLR_JOIN",
8911 "CLR_MANUAL_EVENT",
8912 "CLR_MEMORY_SPY",
8913 "CLR_MONITOR",
8914 "CLR_RWLOCK_READER",
8915 "CLR_RWLOCK_WRITER",
8916 "CLR_SEMAPHORE",
8917 "CLR_TASK_START",
8918 "CLRHOST_STATE_ACCESS",
8919 "CMEMTHREAD",
8920 "CXCONSUMER",
8921 "CXPACKET",
8922 "CXROWSET_SYNC",
8923 "DAC_INIT",
8924 "DBMIRROR_DBM_EVENT",
8925 "DBMIRROR_DBM_MUTEX",
8926 "DBMIRROR_EVENTS_QUEUE",
8927 "DBMIRROR_SEND",
8928 "DBMIRROR_WORKER_QUEUE",
8929 "DBMIRRORING_CMD",
8930 "DEADLOCK_ENUM_MUTEX",
8931 "DEADLOCK_TASK_SEARCH",
8932 "DEBUG",
8933 "DISABLE_VERSIONING",
8934 "DISKIO_SUSPEND",
8935 "DISPATCHER_QUEUE_SEMAPHORE",
8936 "DLL_LOADING_MUTEX",
8937 "DROPTEMP",
8938 "DTC",
8939 "DTC_ABORT_REQUEST",
8940 "DTC_RESOLVE",
8941 "DTC_STATE",
8942 "DTC_TMDOWN_REQUEST",
8943 "DTC_WAITFOR_OUTCOME",
8944 "DUMP_LOG_COORDINATOR",
8945 "DUMPTRIGGER",
8946 "EC",
8947 "EE_PMOLOCK",
8948 "EE_SPECPROC_MAP_INIT",
8949 "ENABLE_VERSIONING",
8950 "ERROR_REPORTING_MANAGER",
8951 "EXCHANGE",
8952 "EXECSYNC",
8953 "EXECUTION_PIPE_EVENT_INTERNAL",
8954 "FAILPOINT",
8955 "FCB_REPLICA_READ",
8956 "FCB_REPLICA_WRITE",
8957 "FS_FC_RWLOCK",
8958 "FS_GARBAGE_COLLECTOR_SHUTDOWN",
8959 "FS_HEADER_RWLOCK",
8960 "FS_LOGTRUNC_RWLOCK",
8961 "FSA_FORCE_OWN_XACT",
8962 "FSAGENT",
8963 "FSTR_CONFIG_MUTEX",
8964 "FSTR_CONFIG_RWLOCK",
8965 "FT_COMPROWSET_RWLOCK",
8966 "FT_IFTS_RWLOCK",
8967 "FT_IFTS_SCHEDULER_IDLE_WAIT",
8968 "FT_IFTSHC_MUTEX",
8969 "FT_IFTSISM_MUTEX",
8970 "FT_MASTER_MERGE",
8971 "FT_METADATA_MUTEX",
8972 "FT_RESTART_CRAWL",
8973 "FULLTEXT",
8974 "GUARDIAN",
8975 "HADR_AG_MUTEX",
8976 "HADR_AR_CRITICAL_SECTION_ENTRY",
8977 "HADR_AR_MANAGER_MUTEX",
8978 "HADR_ARCONTROLLER_NOTIFICATIONS_SUBSCRIBER_LIST",
8979 "HADR_BACKUP_BULK_LOCK",
8980 "HADR_BACKUP_QUEUE",
8981 "HADR_CLUSAPI_CALL",
8982 "HADR_COMPRESSED_CACHE_SYNC",
8983 "HADR_DATABASE_FLOW_CONTROL",
8984 "HADR_DATABASE_VERSIONING_STATE",
8985 "HADR_DATABASE_WAIT_FOR_RESTART",
8986 "HADR_DATABASE_WAIT_FOR_TRANSITION_TO_VERSIONING",
8987 "HADR_DB_COMMAND",
8988 "HADR_DB_OP_COMPLETION_SYNC",
8989 "HADR_DB_OP_START_SYNC",
8990 "HADR_DBR_SUBSCRIBER",
8991 "HADR_DBR_SUBSCRIBER_FILTER_LIST",
8992 "HADR_DBSTATECHANGE_SYNC",
8993 "HADR_FILESTREAM_BLOCK_FLUSH",
8994 "HADR_FILESTREAM_FILE_CLOSE",
8995 "HADR_FILESTREAM_FILE_REQUEST",
8996 "HADR_FILESTREAM_IOMGR",
8997 "HADR_FILESTREAM_IOMGR_IOCOMPLETION",
8998 "HADR_FILESTREAM_MANAGER",
8999 "HADR_GROUP_COMMIT",
9000 "HADR_LOGCAPTURE_SYNC",
9001 "HADR_LOGCAPTURE_WAIT",
9002 "HADR_LOGPROGRESS_SYNC",
9003 "HADR_NOTIFICATION_DEQUEUE",
9004 "HADR_NOTIFICATION_WORKER_EXCLUSIVE_ACCESS",
9005 "HADR_NOTIFICATION_WORKER_STARTUP_SYNC",
9006 "HADR_NOTIFICATION_WORKER_TERMINATION_SYNC",
9007 "HADR_PARTNER_SYNC",
9008 "HADR_READ_ALL_NETWORKS",
9009 "HADR_RECOVERY_WAIT_FOR_CONNECTION",
9010 "HADR_RECOVERY_WAIT_FOR_UNDO",
9011 "HADR_REPLICAINFO_SYNC",
9012 "HADR_SYNC_COMMIT",
9013 "HADR_SYNCHRONIZING_THROTTLE",
9014 "HADR_TDS_LISTENER_SYNC",
9015 "HADR_TDS_LISTENER_SYNC_PROCESSING",
9016 "HADR_TIMER_TASK",
9017 "HADR_TRANSPORT_DBRLIST",
9018 "HADR_TRANSPORT_FLOW_CONTROL",
9019 "HADR_TRANSPORT_SESSION",
9020 "HADR_WORK_POOL",
9021 "HADR_WORK_QUEUE",
9022 "HADR_XRF_STACK_ACCESS",
9023 "HTTP_ENUMERATION",
9024 "HTTP_START",
9025 "IMPPROV_IOWAIT",
9026 "INTERNAL_TESTING",
9027 "IO_AUDIT_MUTEX",
9028 "IO_COMPLETION",
9029 "IO_RETRY",
9030 "IOAFF_RANGE_QUEUE",
9031 "KSOURCE_WAKEUP",
9032 "KTM_ENLISTMENT",
9033 "KTM_RECOVERY_MANAGER",
9034 "KTM_RECOVERY_RESOLUTION",
9035 "LATCH_DT",
9036 "LATCH_EX",
9037 "LATCH_KP",
9038 "LATCH_NL",
9039 "LATCH_SH",
9040 "LATCH_UP",
9041 "LAZYWRITER_SLEEP",
9042 "LCK_M_BU",
9043 "LCK_M_BU_ABORT_BLOCKERS",
9044 "LCK_M_BU_LOW_PRIORITY",
9045 "LCK_M_IS",
9046 "LCK_M_IS_ABORT_BLOCKERS",
9047 "LCK_M_IS_LOW_PRIORITY",
9048 "LCK_M_IU",
9049 "LCK_M_IU_ABORT_BLOCKERS",
9050 "LCK_M_IU_LOW_PRIORITY",
9051 "LCK_M_IX",
9052 "LCK_M_IX_ABORT_BLOCKERS",
9053 "LCK_M_IX_LOW_PRIORITY",
9054 "LCK_M_RIn_NL",
9055 "LCK_M_RIn_NL_ABORT_BLOCKERS",
9056 "LCK_M_RIn_NL_LOW_PRIORITY",
9057 "LCK_M_RIn_S",
9058 "LCK_M_RIn_S_ABORT_BLOCKERS",
9059 "LCK_M_RIn_S_LOW_PRIORITY",
9060 "LCK_M_RIn_U",
9061 "LCK_M_RIn_U_ABORT_BLOCKERS",
9062 "LCK_M_RIn_U_LOW_PRIORITY",
9063 "LCK_M_RIn_X",
9064 "LCK_M_RIn_X_ABORT_BLOCKERS",
9065 "LCK_M_RIn_X_LOW_PRIORITY",
9066 "LCK_M_RS_S",
9067 "LCK_M_RS_S_ABORT_BLOCKERS",
9068 "LCK_M_RS_S_LOW_PRIORITY",
9069 "LCK_M_RS_U",
9070 "LCK_M_RS_U_ABORT_BLOCKERS",
9071 "LCK_M_RS_U_LOW_PRIORITY",
9072 "LCK_M_RX_S",
9073 "LCK_M_RX_S_ABORT_BLOCKERS",
9074 "LCK_M_RX_S_LOW_PRIORITY",
9075 "LCK_M_RX_U",
9076 "LCK_M_RX_U_ABORT_BLOCKERS",
9077 "LCK_M_RX_U_LOW_PRIORITY",
9078 "LCK_M_RX_X",
9079 "LCK_M_RX_X_ABORT_BLOCKERS",
9080 "LCK_M_RX_X_LOW_PRIORITY",
9081 "LCK_M_S",
9082 "LCK_M_S_ABORT_BLOCKERS",
9083 "LCK_M_S_LOW_PRIORITY",
9084 "LCK_M_SCH_M",
9085 "LCK_M_SCH_M_ABORT_BLOCKERS",
9086 "LCK_M_SCH_M_LOW_PRIORITY",
9087 "LCK_M_SCH_S",
9088 "LCK_M_SCH_S_ABORT_BLOCKERS",
9089 "LCK_M_SCH_S_LOW_PRIORITY",
9090 "LCK_M_SIU",
9091 "LCK_M_SIU_ABORT_BLOCKERS",
9092 "LCK_M_SIU_LOW_PRIORITY",
9093 "LCK_M_SIX",
9094 "LCK_M_SIX_ABORT_BLOCKERS",
9095 "LCK_M_SIX_LOW_PRIORITY",
9096 "LCK_M_U",
9097 "LCK_M_U_ABORT_BLOCKERS",
9098 "LCK_M_U_LOW_PRIORITY",
9099 "LCK_M_UIX",
9100 "LCK_M_UIX_ABORT_BLOCKERS",
9101 "LCK_M_UIX_LOW_PRIORITY",
9102 "LCK_M_X",
9103 "LCK_M_X_ABORT_BLOCKERS",
9104 "LCK_M_X_LOW_PRIORITY",
9105 "LOGBUFFER",
9106 "LOGGENERATION",
9107 "LOGMGR",
9108 "LOGMGR_FLUSH",
9109 "LOGMGR_QUEUE",
9110 "LOGMGR_RESERVE_APPEND",
9111 "LOWFAIL_MEMMGR_QUEUE",
9112 "MEMORY_ALLOCATION_EXT",
9113 "MISCELLANEOUS",
9114 "MSQL_DQ",
9115 "MSQL_XACT_MGR_MUTEX",
9116 "MSQL_XACT_MUTEX",
9117 "MSQL_XP",
9118 "MSSEARCH",
9119 "NET_WAITFOR_PACKET",
9120 "OLEDB",
9121 "ONDEMAND_TASK_QUEUE",
9122 "PAGEIOLATCH_DT",
9123 "PAGEIOLATCH_EX",
9124 "PAGEIOLATCH_KP",
9125 "PAGEIOLATCH_NL",
9126 "PAGEIOLATCH_SH",
9127 "PAGEIOLATCH_UP",
9128 "PAGELATCH_DT",
9129 "PAGELATCH_EX",
9130 "PAGELATCH_KP",
9131 "PAGELATCH_NL",
9132 "PAGELATCH_SH",
9133 "PAGELATCH_UP",
9134 "PARALLEL_BACKUP_QUEUE",
9135 "PREEMPTIVE_ABR",
9136 "PREEMPTIVE_AUDIT_ACCESS_EVENTLOG",
9137 "PREEMPTIVE_AUDIT_ACCESS_SECLOG",
9138 "PREEMPTIVE_CLOSEBACKUPMEDIA",
9139 "PREEMPTIVE_CLOSEBACKUPTAPE",
9140 "PREEMPTIVE_CLOSEBACKUPVDIDEVICE",
9141 "PREEMPTIVE_CLUSAPI_CLUSTERRESOURCECONTROL",
9142 "PREEMPTIVE_COM_COCREATEINSTANCE",
9143 "PREEMPTIVE_HADR_LEASE_MECHANISM",
9144 "PREEMPTIVE_SOSTESTING",
9145 "PREEMPTIVE_STRESSDRIVER",
9146 "PREEMPTIVE_TESTING",
9147 "PREEMPTIVE_XETESTING",
9148 "PRINT_ROLLBACK_PROGRESS",
9149 "PWAIT_HADR_CHANGE_NOTIFIER_TERMINATION_SYNC",
9150 "PWAIT_HADR_CLUSTER_INTEGRATION",
9151 "PWAIT_HADR_OFFLINE_COMPLETED",
9152 "PWAIT_HADR_ONLINE_COMPLETED",
9153 "PWAIT_HADR_POST_ONLINE_COMPLETED",
9154 "PWAIT_HADR_WORKITEM_COMPLETED",
9155 "PWAIT_MD_LOGIN_STATS",
9156 "PWAIT_MD_RELATION_CACHE",
9157 "PWAIT_MD_SERVER_CACHE",
9158 "PWAIT_MD_UPGRADE_CONFIG",
9159 "PWAIT_METADATA_LAZYCACHE_RWLOCk",
9160 "QPJOB_KILL",
9161 "QPJOB_WAITFOR_ABORT",
9162 "QRY_MEM_GRANT_INFO_MUTEX",
9163 "QUERY_ERRHDL_SERVICE_DONE",
9164 "QUERY_EXECUTION_INDEX_SORT_EVENT_OPEN",
9165 "QUERY_NOTIFICATION_MGR_MUTEX",
9166 "QUERY_NOTIFICATION_SUBSCRIPTION_MUTEX",
9167 "QUERY_NOTIFICATION_TABLE_MGR_MUTEX",
9168 "QUERY_NOTIFICATION_UNITTEST_MUTEX",
9169 "QUERY_OPTIMIZER_PRINT_MUTEX",
9170 "QUERY_TRACEOUT",
9171 "QUERY_WAIT_ERRHDL_SERVICE",
9172 "RECOVER_CHANGEDB",
9173 "REPL_CACHE_ACCESS",
9174 "REPL_SCHEMA_ACCESS",
9175 "REPLICA_WRITES",
9176 "REQUEST_DISPENSER_PAUSE",
9177 "REQUEST_FOR_DEADLOCK_SEARCH",
9178 "RESMGR_THROTTLED",
9179 "RESOURCE_QUEUE",
9180 "RESOURCE_SEMAPHORE",
9181 "RESOURCE_SEMAPHORE_MUTEX",
9182 "RESOURCE_SEMAPHORE_QUERY_COMPILE",
9183 "RESOURCE_SEMAPHORE_SMALL_QUERY",
9184 "SEC_DROP_TEMP_KEY",
9185 "SECURITY_MUTEX",
9186 "SEQUENTIAL_GUID",
9187 "SERVER_IDLE_CHECK",
9188 "SHUTDOWN",
9189 "SLEEP_BPOOL_FLUSH",
9190 "SLEEP_DBSTARTUP",
9191 "SLEEP_DCOMSTARTUP",
9192 "SLEEP_MSDBSTARTUP",
9193 "SLEEP_SYSTEMTASK",
9194 "SLEEP_TASK",
9195 "SLEEP_TEMPDBSTARTUP",
9196 "SNI_CRITICAL_SECTION",
9197 "SNI_HTTP_WAITFOR_",
9198 "SNI_LISTENER_ACCESS",
9199 "SNI_TASK_COMPLETION",
9200 "SOAP_READ",
9201 "SOAP_WRITE",
9202 "SOS_CALLBACK_REMOVAL",
9203 "SOS_DISPATCHER_MUTEX",
9204 "SOS_LOCALALLOCATORLIST",
9205 "SOS_MEMORY_USAGE_ADJUSTMENT",
9206 "SOS_OBJECT_STORE_DESTROY_MUTEX",
9207 "SOS_PHYS_PAGE_CACHE",
9208 "SOS_PROCESS_AFFINITY_MUTEX",
9209 "SOS_RESERVEDMEMBLOCKLIST",
9210 "SOS_SCHEDULER_YIELD",
9211 "SOS_SMALL_PAGE_ALLOC",
9212 "SOS_STACKSTORE_INIT_MUTEX",
9213 "SOS_SYNC_TASK_ENQUEUE_EVENT",
9214 "SOS_VIRTUALMEMORY_LOW",
9215 "SOSHOST_EVENT",
9216 "SOSHOST_INTERNAL",
9217 "SOSHOST_MUTEX",
9218 "SOSHOST_RWLOCK",
9219 "SOSHOST_SEMAPHORE",
9220 "SOSHOST_SLEEP",
9221 "SOSHOST_TRACELOCK",
9222 "SOSHOST_WAITFORDONE",
9223 "SQLCLR_APPDOMAIN",
9224 "SQLCLR_ASSEMBLY",
9225 "SQLCLR_DEADLOCK_DETECTION",
9226 "SQLCLR_QUANTUM_PUNISHMENT",
9227 "SQLSORT_NORMMUTEX",
9228 "SQLSORT_SORTMUTEX",
9229 "SQLTRACE_BUFFER_FLUSH",
9230 "SQLTRACE_FILE_BUFFER",
9231 "SQLTRACE_SHUTDOWN",
9232 "SQLTRACE_WAIT_ENTRIES",
9233 "SRVPROC_SHUTDOWN",
9234 "TEMPOBJ",
9235 "THREADPOOL",
9236 "TIMEPRIV_TIMEPERIOD",
9237 "TRACEWRITE",
9238 "TRAN_MARKLATCH_DT",
9239 "TRAN_MARKLATCH_EX",
9240 "TRAN_MARKLATCH_KP",
9241 "TRAN_MARKLATCH_NL",
9242 "TRAN_MARKLATCH_SH",
9243 "TRAN_MARKLATCH_UP",
9244 "TRANSACTION_MUTEX",
9245 "UTIL_PAGE_ALLOC",
9246 "VIA_ACCEPT",
9247 "VIEW_DEFINITION_MUTEX",
9248 "WAIT_FOR_RESULTS",
9249 "WAIT_XTP_CKPT_CLOSE",
9250 "WAIT_XTP_CKPT_ENABLED",
9251 "WAIT_XTP_CKPT_STATE_LOCK",
9252 "WAIT_XTP_GUEST",
9253 "WAIT_XTP_HOST_WAIT",
9254 "WAIT_XTP_OFFLINE_CKPT_LOG_IO",
9255 "WAIT_XTP_OFFLINE_CKPT_NEW_LOG",
9256 "WAIT_XTP_PROCEDURE_ENTRY",
9257 "WAIT_XTP_RECOVERY",
9258 "WAIT_XTP_TASK_SHUTDOWN",
9259 "WAIT_XTP_TRAN_COMMIT",
9260 "WAIT_XTP_TRAN_DEPENDENCY",
9261 "WAITFOR",
9262 "WAITFOR_TASKSHUTDOWN",
9263 "WAITSTAT_MUTEX",
9264 "WCC",
9265 "WORKTBL_DROP",
9266 "WRITE_COMPLETION",
9267 "WRITELOG",
9268 "XACT_OWN_TRANSACTION",
9269 "XACT_RECLAIM_SESSION",
9270 "XACTLOCKINFO",
9271 "XACTWORKSPACE_MUTEX",
9272 "XE_BUFFERMGR_ALLPROCESSED_EVENT",
9273 "XE_BUFFERMGR_FREEBUF_EVENT",
9274 "XE_DISPATCHER_CONFIG_SESSION_LIST",
9275 "XE_DISPATCHER_JOIN",
9276 "XE_DISPATCHER_WAIT",
9277 "XE_MODULEMGR_SYNC",
9278 "XE_OLS_LOCK",
9279 "XE_PACKAGE_LOCK_BACKOFF",
9280 "XTPPROC_CACHE_ACCESS",
9281 "XTPPROC_PARTITIONED_STACK_CREATE",
9284 register_check_parameters(
9285 RulespecGroupCheckParametersApplications,
9286 "mssql_blocked_sessions",
9287 _("MSSQL Blocked Sessions"),
9288 Dictionary(
9289 elements=[
9290 ("state",
9291 MonitoringState(
9292 title=_("State of MSSQL Blocked Sessions is treated as"),
9293 help=_("The default state if there is at least one "
9294 "blocked session."),
9295 default_value=2,
9297 ("waittime",
9298 Tuple(
9299 title=_("Levels for wait"),
9300 help=_("The threshholds for wait_duration_ms. Will "
9301 "overwrite the default state set above."),
9302 default_value=(0, 0),
9303 elements=[
9304 Float(title=_("Warning at"), unit=_("seconds"), display_format="%.3f"),
9305 Float(title=_("Critical at"), unit=_("seconds"), display_format="%.3f"),
9306 ])),
9307 ("ignore_waittypes",
9308 DualListChoice(
9309 title=_("Ignore wait types"),
9310 rows=40,
9311 choices=[(entry, entry) for entry in mssql_waittypes],
9313 ],),
9314 None,
9315 "dict",
9316 deprecated=True,
9319 register_check_parameters(
9320 RulespecGroupCheckParametersApplications,
9321 "mssql_instance_blocked_sessions",
9322 _("MSSQL Blocked Sessions"),
9323 Dictionary(
9324 elements=[
9325 ("state",
9326 MonitoringState(
9327 title=_("State of MSSQL Blocked Sessions is treated as"),
9328 help=_("The default state if there is at least one "
9329 "blocked session."),
9330 default_value=2,
9332 ("waittime",
9333 Tuple(
9334 title=_("Levels for wait"),
9335 help=_("The threshholds for wait_duration_ms. Will "
9336 "overwrite the default state set above."),
9337 default_value=(0, 0),
9338 elements=[
9339 Float(title=_("Warning at"), unit=_("seconds"), display_format="%.3f"),
9340 Float(title=_("Critical at"), unit=_("seconds"), display_format="%.3f"),
9341 ])),
9342 ("ignore_waittypes",
9343 DualListChoice(
9344 title=_("Ignore wait types"),
9345 rows=40,
9346 choices=[(entry, entry) for entry in mssql_waittypes],
9348 ],),
9349 TextAscii(title=_("Instance identifier")),
9350 "dict",
9353 register_check_parameters(
9354 RulespecGroupCheckParametersApplications,
9355 "mysql_sessions",
9356 _("MySQL Sessions & Connections"),
9357 Dictionary(
9358 help=_("This check monitors the current number of active sessions to the MySQL "
9359 "database server as well as the connection rate."),
9360 elements=[
9362 "total",
9363 Tuple(
9364 title=_("Number of current sessions"),
9365 elements=[
9366 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
9367 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
9372 "running",
9373 Tuple(
9374 title=_("Number of currently running sessions"),
9375 help=_("Levels for the number of sessions that are currently active"),
9376 elements=[
9377 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
9378 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
9383 "connections",
9384 Tuple(
9385 title=_("Number of new connections per second"),
9386 elements=[
9387 Integer(title=_("Warning at"), unit=_("connection/sec"), default_value=20),
9388 Integer(title=_("Critical at"), unit=_("connection/sec"), default_value=40),
9393 TextAscii(
9394 title=_("Instance"),
9395 help=_("Only needed if you have multiple MySQL Instances on one server"),
9397 "dict",
9400 register_check_parameters(
9401 RulespecGroupCheckParametersApplications,
9402 "mysql_innodb_io",
9403 _("MySQL InnoDB Throughput"),
9404 Dictionary(
9405 elements=[("read",
9406 Tuple(
9407 title=_("Read throughput"),
9408 elements=[
9409 Float(title=_("warning at"), unit=_("MB/s")),
9410 Float(title=_("critical at"), unit=_("MB/s"))
9411 ])),
9412 ("write",
9413 Tuple(
9414 title=_("Write throughput"),
9415 elements=[
9416 Float(title=_("warning at"), unit=_("MB/s")),
9417 Float(title=_("critical at"), unit=_("MB/s"))
9418 ])),
9419 ("average",
9420 Integer(
9421 title=_("Average"),
9422 help=_("When averaging is set, a floating average value "
9423 "of the disk throughput is computed and the levels for read "
9424 "and write will be applied to the average instead of the current "
9425 "value."),
9426 minvalue=1,
9427 default_value=5,
9428 unit=_("minutes")))]),
9429 TextAscii(
9430 title=_("Instance"),
9431 help=_("Only needed if you have multiple MySQL Instances on one server"),
9433 "dict",
9436 register_check_parameters(
9437 RulespecGroupCheckParametersApplications,
9438 "mysql_connections",
9439 _("MySQL Connections"),
9440 Dictionary(elements=[
9441 ("perc_used",
9442 Tuple(
9443 title=_("Max. parallel connections"),
9444 help=_("Compares the maximum number of connections that have been "
9445 "in use simultaneously since the server started with the maximum simultaneous "
9446 "connections allowed by the configuration of the server. This threshold "
9447 "makes the check raise warning/critical states if the percentage is equal to "
9448 "or above the configured levels."),
9449 elements=[
9450 Percentage(title=_("Warning at")),
9451 Percentage(title=_("Critical at")),
9452 ])),
9454 TextAscii(
9455 title=_("Instance"),
9456 help=_("Only needed if you have multiple MySQL Instances on one server"),
9458 "dict",
9461 register_check_parameters(
9462 RulespecGroupCheckParametersApplications,
9463 "mysql_slave",
9464 _("MySQL Slave"),
9465 Dictionary(
9466 elements=[
9467 ("seconds_behind_master",
9468 Tuple(
9469 title=_("Max. time behind the master"),
9470 help=_(
9471 "Compares the time which the slave can be behind the master. "
9472 "This rule makes the check raise warning/critical states if the time is equal to "
9473 "or above the configured levels."),
9474 elements=[
9475 Age(title=_("Warning at")),
9476 Age(title=_("Critical at")),
9477 ])),
9479 optional_keys=None),
9480 TextAscii(
9481 title=_("Instance"),
9482 help=_("Only needed if you have multiple MySQL Instances on one server"),
9484 "dict",
9487 register_check_parameters(
9488 RulespecGroupCheckParametersApplications, "db_bloat", _("Database Bloat (PostgreSQL)"),
9489 Dictionary(
9490 help=_("This rule allows you to configure bloat levels for a databases tablespace and "
9491 "indexspace."),
9492 elements=[
9493 ("table_bloat_abs",
9494 Tuple(
9495 title=_("Table absolute bloat levels"),
9496 elements=[
9497 Filesize(title=_("Warning at")),
9498 Filesize(title=_("Critical at")),
9499 ])),
9500 ("table_bloat_perc",
9501 Tuple(
9502 title=_("Table percentage bloat levels"),
9503 help=_("Percentage in respect to the optimal utilization. "
9504 "For example if an alarm should raise at 50% wasted space, you need "
9505 "to configure 150%"),
9506 elements=[
9507 Percentage(title=_("Warning at"), maxvalue=None),
9508 Percentage(title=_("Critical at"), maxvalue=None),
9509 ])),
9510 ("index_bloat_abs",
9511 Tuple(
9512 title=_("Index absolute levels"),
9513 elements=[
9514 Filesize(title=_("Warning at")),
9515 Filesize(title=_("Critical at")),
9516 ])),
9517 ("index_bloat_perc",
9518 Tuple(
9519 title=_("Index percentage bloat levels"),
9520 help=_("Percentage in respect to the optimal utilization. "
9521 "For example if an alarm should raise at 50% wasted space, you need "
9522 "to configure 150%"),
9523 elements=[
9524 Percentage(title=_("Warning at"), maxvalue=None),
9525 Percentage(title=_("Critical at"), maxvalue=None),
9526 ])),
9527 ]), TextAscii(title=_("Name of the database"),), "dict")
9529 register_check_parameters(
9530 RulespecGroupCheckParametersApplications, "db_connections",
9531 _("Database Connections (PostgreSQL/MongoDB)"),
9532 Dictionary(
9533 help=_("This rule allows you to configure the number of maximum concurrent "
9534 "connections for a given database."),
9535 elements=[
9536 ("levels_perc",
9537 Tuple(
9538 title=_("Percentage of maximum available connections"),
9539 elements=[
9540 Percentage(title=_("Warning at"), unit=_("% of maximum connections")),
9541 Percentage(title=_("Critical at"), unit=_("% of maximum connections")),
9542 ])),
9543 ("levels_abs",
9544 Tuple(
9545 title=_("Absolute number of connections"),
9546 elements=[
9547 Integer(title=_("Warning at"), minvalue=0, unit=_("connections")),
9548 Integer(title=_("Critical at"), minvalue=0, unit=_("connections")),
9549 ])),
9550 ]), TextAscii(title=_("Name of the database"),), "dict")
9552 register_check_parameters(
9553 RulespecGroupCheckParametersApplications, "postgres_locks", _("PostgreSQL Locks"),
9554 Dictionary(
9555 help=_(
9556 "This rule allows you to configure the limits for the SharedAccess and Exclusive Locks "
9557 "for a PostgreSQL database."),
9558 elements=[
9559 ("levels_shared",
9560 Tuple(
9561 title=_("Shared Access Locks"),
9562 elements=[
9563 Integer(title=_("Warning at"), minvalue=0),
9564 Integer(title=_("Critical at"), minvalue=0),
9565 ])),
9566 ("levels_exclusive",
9567 Tuple(
9568 title=_("Exclusive Locks"),
9569 elements=[
9570 Integer(title=_("Warning at"), minvalue=0),
9571 Integer(title=_("Critical at"), minvalue=0),
9572 ])),
9573 ]), TextAscii(title=_("Name of the database"),), "dict")
9575 register_check_parameters(
9576 RulespecGroupCheckParametersApplications, "postgres_maintenance",
9577 _("PostgreSQL VACUUM and ANALYZE"),
9578 Dictionary(
9579 help=_("With this rule you can set limits for the VACUUM and ANALYZE operation of "
9580 "a PostgreSQL database. Keep in mind that each table within a database is checked "
9581 "with this limits."),
9582 elements=[
9583 ("last_vacuum",
9584 Tuple(
9585 title=_("Time since the last VACUUM"),
9586 elements=[
9587 Age(title=_("Warning if older than"), default_value=86400 * 7),
9588 Age(title=_("Critical if older than"), default_value=86400 * 14)
9589 ])),
9590 ("last_analyze",
9591 Tuple(
9592 title=_("Time since the last ANALYZE"),
9593 elements=[
9594 Age(title=_("Warning if older than"), default_value=86400 * 7),
9595 Age(title=_("Critical if older than"), default_value=86400 * 14)
9596 ])),
9597 ("never_analyze_vacuum",
9598 Tuple(
9599 title=_("Age of never analyzed/vacuumed tables"),
9600 elements=[
9601 Age(title=_("Warning if older than"), default_value=86400 * 7),
9602 Age(title=_("Critical if older than"), default_value=86400 * 14)
9603 ])),
9604 ]), TextAscii(title=_("Name of the database"),), "dict")
9606 register_check_parameters(
9607 RulespecGroupCheckParametersApplications, "f5_connections", _("F5 Loadbalancer Connections"),
9608 Dictionary(elements=[
9609 ("conns",
9610 Levels(
9611 title=_("Max. number of connections"),
9612 default_value=None,
9613 default_levels=(25000, 30000))),
9614 ("ssl_conns",
9615 Levels(
9616 title=_("Max. number of SSL connections"),
9617 default_value=None,
9618 default_levels=(25000, 30000))),
9619 ("connections_rate",
9620 Levels(
9621 title=_("Maximum connections per second"),
9622 default_value=None,
9623 default_levels=(500, 1000))),
9624 ("connections_rate_lower",
9625 Tuple(
9626 title=_("Minimum connections per second"),
9627 elements=[
9628 Integer(title=_("Warning at")),
9629 Integer(title=_("Critical at")),
9632 ("http_req_rate",
9633 Levels(
9634 title=_("HTTP requests per second"), default_value=None, default_levels=(500, 1000))),
9635 ]), None, "dict")
9637 register_check_parameters(
9638 RulespecGroupCheckParametersApplications,
9639 "cisco_fw_connections",
9640 _("Cisco ASA Firewall Connections"),
9641 Dictionary(elements=[
9642 ("connections",
9643 Tuple(
9644 help=_("This rule sets limits to the current number of connections through "
9645 "a Cisco ASA firewall."),
9646 title=_("Maximum number of firewall connections"),
9647 elements=[
9648 Integer(title=_("Warning at")),
9649 Integer(title=_("Critical at")),
9653 None,
9654 "dict",
9657 register_check_parameters(
9658 RulespecGroupCheckParametersApplications,
9659 "checkpoint_connections",
9660 _("Checkpoint Firewall Connections"),
9661 Tuple(
9662 help=_("This rule sets limits to the current number of connections through "
9663 "a Checkpoint firewall."),
9664 title=_("Maximum number of firewall connections"),
9665 elements=[
9666 Integer(title=_("Warning at"), default_value=40000),
9667 Integer(title=_("Critical at"), default_value=50000),
9670 None,
9671 match_type="first",
9674 register_check_parameters(
9675 RulespecGroupCheckParametersApplications, "checkpoint_packets",
9676 _("Checkpoint Firewall Packet Rates"),
9677 Dictionary(elements=[
9678 ("accepted",
9679 Levels(
9680 title=_("Maximum Rate of Accepted Packets"),
9681 default_value=None,
9682 default_levels=(100000, 200000),
9683 unit="pkts/sec")),
9684 ("rejected",
9685 Levels(
9686 title=_("Maximum Rate of Rejected Packets"),
9687 default_value=None,
9688 default_levels=(100000, 200000),
9689 unit="pkts/sec")),
9690 ("dropped",
9691 Levels(
9692 title=_("Maximum Rate of Dropped Packets"),
9693 default_value=None,
9694 default_levels=(100000, 200000),
9695 unit="pkts/sec")),
9696 ("logged",
9697 Levels(
9698 title=_("Maximum Rate of Logged Packets"),
9699 default_value=None,
9700 default_levels=(100000, 200000),
9701 unit="pkts/sec")),
9702 ]), None, "dict")
9704 register_check_parameters(
9705 RulespecGroupCheckParametersApplications, "f5_pools", _("F5 Loadbalancer Pools"),
9706 Tuple(
9707 title=_("Minimum number of pool members"),
9708 elements=[
9709 Integer(title=_("Warning if below"), unit=_("Members ")),
9710 Integer(title=_("Critical if below"), unit=_("Members")),
9712 ), TextAscii(title=_("Name of pool")), "first")
9714 register_check_parameters(
9715 RulespecGroupCheckParametersApplications, "mysql_db_size", _("Size of MySQL databases"),
9716 Optional(
9717 Tuple(elements=[
9718 Filesize(title=_("warning at")),
9719 Filesize(title=_("critical at")),
9721 help=_("The check will trigger a warning or critical state if the size of the "
9722 "database exceeds these levels."),
9723 title=_("Impose limits on the size of the database"),
9725 TextAscii(
9726 title=_("Name of the database"),
9727 help=_("Don't forget the instance: instance:dbname"),
9728 ), "first")
9730 register_check_parameters(
9731 RulespecGroupCheckParametersApplications,
9732 "postgres_sessions",
9733 _("PostgreSQL Sessions"),
9734 Dictionary(
9735 help=_("This check monitors the current number of active and idle sessions on PostgreSQL"),
9736 elements=[
9738 "total",
9739 Tuple(
9740 title=_("Number of current sessions"),
9741 elements=[
9742 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
9743 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
9748 "running",
9749 Tuple(
9750 title=_("Number of currently running sessions"),
9751 help=_("Levels for the number of sessions that are currently active"),
9752 elements=[
9753 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
9754 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
9759 None,
9760 match_type="dict",
9761 deprecated=True,
9764 register_check_parameters(
9765 RulespecGroupCheckParametersApplications,
9766 "postgres_instance_sessions",
9767 _("PostgreSQL Sessions"),
9768 Dictionary(
9769 help=_("This check monitors the current number of active and idle sessions on PostgreSQL"),
9770 elements=[
9772 "total",
9773 Tuple(
9774 title=_("Number of current sessions"),
9775 elements=[
9776 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
9777 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
9782 "running",
9783 Tuple(
9784 title=_("Number of currently running sessions"),
9785 help=_("Levels for the number of sessions that are currently active"),
9786 elements=[
9787 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
9788 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
9793 TextAscii(title=_("Instance")),
9794 match_type="dict",
9797 register_check_parameters(
9798 RulespecGroupCheckParametersApplications,
9799 "asa_svc_sessions",
9800 _("Cisco SSl VPN Client Sessions"),
9801 Tuple(
9802 title=_("Number of active sessions"),
9803 help=_("This check monitors the current number of active sessions"),
9804 elements=[
9805 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
9806 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
9809 None,
9810 match_type="first",
9814 def convert_oracle_sessions(value):
9815 if isinstance(value, tuple):
9816 return {'sessions_abs': value}
9817 if 'sessions_abs' not in value:
9818 value['sessions_abs'] = (100, 200)
9819 return value
9822 register_check_parameters(
9823 RulespecGroupCheckParametersApplications,
9824 "oracle_sessions",
9825 _("Oracle Sessions"),
9826 Transform(
9827 Dictionary(
9828 elements=[
9829 ("sessions_abs",
9830 Alternative(
9831 title=_("Absolute levels of active sessions"),
9832 style="dropdown",
9833 help=_("This check monitors the current number of active sessions on Oracle"),
9834 elements=[
9835 FixedValue(None, title=_("Do not use absolute levels"), totext=""),
9836 Tuple(
9837 title=_("Number of active sessions"),
9838 elements=[
9839 Integer(
9840 title=_("Warning at"), unit=_("sessions"), default_value=100),
9841 Integer(
9842 title=_("Critical at"), unit=_("sessions"), default_value=200),
9848 "sessions_perc",
9849 Tuple(
9850 title=_("Relative levels of active sessions."),
9851 help=
9852 _("Set upper levels of active sessions relative to max. number of sessions. This is optional."
9854 elements=[
9855 Percentage(title=_("Warning at")),
9856 Percentage(title=_("Critical at")),
9861 optional_keys=["sessions_perc"],
9863 forth=convert_oracle_sessions),
9864 TextAscii(title=_("Database name"), allow_empty=False),
9865 match_type="first",
9868 register_check_parameters(
9869 RulespecGroupCheckParametersApplications,
9870 "oracle_locks",
9871 _("Oracle Locks"),
9872 Dictionary(elements=[("levels",
9873 Tuple(
9874 title=_("Levels for minimum wait time for a lock"),
9875 elements=[
9876 Age(title=_("warning if higher then"), default_value=1800),
9877 Age(title=_("critical if higher then"), default_value=3600),
9878 ]))]),
9879 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
9880 "dict",
9883 register_check_parameters(
9884 RulespecGroupCheckParametersApplications,
9885 "oracle_longactivesessions",
9886 _("Oracle Long Active Sessions"),
9887 Dictionary(elements=[("levels",
9888 Tuple(
9889 title=_("Levels of active sessions"),
9890 elements=[
9891 Integer(title=_("Warning if more than"), unit=_("sessions")),
9892 Integer(title=_("Critical if more than"), unit=_("sessions")),
9893 ]))]),
9894 TextAscii(title=_("Database SID"), size=12, allow_empty=False),
9895 "dict",
9898 register_check_parameters(
9899 RulespecGroupCheckParametersApplications,
9900 "postgres_stat_database",
9901 _("PostgreSQL Database Statistics"),
9902 Dictionary(
9903 help=_(
9904 "This check monitors how often database objects in a PostgreSQL Database are accessed"),
9905 elements=[
9907 "blocks_read",
9908 Tuple(
9909 title=_("Blocks read"),
9910 elements=[
9911 Float(title=_("Warning at"), unit=_("blocks/s")),
9912 Float(title=_("Critical at"), unit=_("blocks/s")),
9917 "xact_commit",
9918 Tuple(
9919 title=_("Commits"),
9920 elements=[
9921 Float(title=_("Warning at"), unit=_("/s")),
9922 Float(title=_("Critical at"), unit=_("/s")),
9927 "tup_fetched",
9928 Tuple(
9929 title=_("Fetches"),
9930 elements=[
9931 Float(title=_("Warning at"), unit=_("/s")),
9932 Float(title=_("Critical at"), unit=_("/s")),
9937 "tup_deleted",
9938 Tuple(
9939 title=_("Deletes"),
9940 elements=[
9941 Float(title=_("Warning at"), unit=_("/s")),
9942 Float(title=_("Critical at"), unit=_("/s")),
9947 "tup_updated",
9948 Tuple(
9949 title=_("Updates"),
9950 elements=[
9951 Float(title=_("Warning at"), unit=_("/s")),
9952 Float(title=_("Critical at"), unit=_("/s")),
9957 "tup_inserted",
9958 Tuple(
9959 title=_("Inserts"),
9960 elements=[
9961 Float(title=_("Warning at"), unit=_("/s")),
9962 Float(title=_("Critical at"), unit=_("/s")),
9968 TextAscii(title=_("Database name"), allow_empty=False),
9969 match_type="dict",
9972 register_check_parameters(
9973 RulespecGroupCheckParametersApplications,
9974 "win_dhcp_pools",
9975 _("DHCP Pools for Windows and Linux"),
9976 Transform(
9977 Dictionary(
9978 elements = [
9979 ("free_leases",
9980 Alternative(
9981 title = _("Free leases levels"),
9982 elements = [
9983 Tuple(
9984 title = _("Free leases levels in percent"),
9985 elements = [
9986 Percentage(title = _("Warning if below"), default_value = 10.0),
9987 Percentage(title = _("Critical if below"), default_value = 5.0)
9990 Tuple(
9991 title = _("Absolute free leases levels"),
9992 elements = [
9993 Integer(title = _("Warning if below"), unit = _("free leases")),
9994 Integer(title = _("Critical if below"), unit = _("free leases"))
10000 ("used_leases",
10001 Alternative(
10002 title = _("Used leases levels"),
10003 elements = [
10004 Tuple(
10005 title = _("Used leases levels in percent"),
10006 elements = [
10007 Percentage(title = _("Warning if below")),
10008 Percentage(title = _("Critical if below"))
10011 Tuple(
10012 title = _("Absolute used leases levels"),
10013 elements = [
10014 Integer(title = _("Warning if below"), unit = _("used leases")),
10015 Integer(title = _("Critical if below"), unit = _("used leases"))
10023 forth = lambda params: isinstance(params, tuple) and {"free_leases" : (float(params[0]), float(params[1]))} or params,
10025 TextAscii(
10026 title = _("Pool name"),
10027 allow_empty = False,
10029 match_type = "first",
10032 register_check_parameters(
10033 RulespecGroupCheckParametersOperatingSystem,
10034 "threads",
10035 _("Number of threads"),
10036 Tuple(
10037 help=_(
10038 "These levels check the number of currently existing threads on the system. Each process has at "
10039 "least one thread."),
10040 elements=[
10041 Integer(title=_("Warning at"), unit=_("threads"), default_value=1000),
10042 Integer(title=_("Critical at"), unit=_("threads"), default_value=2000)
10044 None,
10045 match_type="first",
10048 register_check_parameters(
10049 RulespecGroupCheckParametersOperatingSystem,
10050 "logins",
10051 _("Number of Logins on System"),
10052 Tuple(
10053 help=_("This rule defines upper limits for the number of logins on a system."),
10054 elements=[
10055 Integer(title=_("Warning at"), unit=_("users"), default_value=20),
10056 Integer(title=_("Critical at"), unit=_("users"), default_value=30)
10058 None,
10059 match_type="first",
10062 register_check_parameters(
10063 RulespecGroupCheckParametersApplications,
10064 "vms_procs",
10065 _("Number of processes on OpenVMS"),
10066 Optional(
10067 Tuple(elements=[
10068 Integer(title=_("Warning at"), unit=_("processes"), default_value=100),
10069 Integer(title=_("Critical at"), unit=_("processes"), default_value=200)
10071 title=_("Impose levels on number of processes"),
10073 None,
10074 match_type="first",
10077 register_check_parameters(
10078 RulespecGroupCheckParametersOperatingSystem, "vm_counter",
10079 _("Number of kernel events per second"),
10080 Levels(
10081 help=_("This ruleset applies to several similar checks measing various kernel "
10082 "events like context switches, process creations and major page faults. "
10083 "Please create separate rules for each type of kernel counter you "
10084 "want to set levels for."),
10085 unit=_("events per second"),
10086 default_levels=(1000, 5000),
10087 default_difference=(500.0, 1000.0),
10088 default_value=None,
10090 DropdownChoice(
10091 title=_("kernel counter"),
10092 choices=[("Context Switches", _("Context Switches")),
10093 ("Process Creations", _("Process Creations")),
10094 ("Major Page Faults", _("Major Page Faults"))]), "first")
10096 register_check_parameters(
10097 RulespecGroupCheckParametersStorage,
10098 "ibm_svc_total_latency",
10099 _("IBM SVC: Levels for total disk latency"),
10100 Dictionary(elements=[
10101 ("read",
10102 Levels(
10103 title=_("Read latency"),
10104 unit=_("ms"),
10105 default_value=None,
10106 default_levels=(50.0, 100.0))),
10107 ("write",
10108 Levels(
10109 title=_("Write latency"),
10110 unit=_("ms"),
10111 default_value=None,
10112 default_levels=(50.0, 100.0))),
10114 DropdownChoice(
10115 choices=[
10116 ("Drives", _("Total latency for all drives")),
10117 ("MDisks", _("Total latency for all MDisks")),
10118 ("VDisks", _("Total latency for all VDisks")),
10120 title=_("Disk/Drive type"),
10121 help=_("Please enter <tt>Drives</tt>, <tt>Mdisks</tt> or <tt>VDisks</tt> here.")),
10122 match_type="dict",
10126 def transform_ibm_svc_host(params):
10127 if params is None:
10128 # Old inventory rule until version 1.2.7
10129 # params were None instead of emtpy dictionary
10130 params = {'always_ok': False}
10132 if 'always_ok' in params:
10133 if params['always_ok'] is False:
10134 params = {'degraded_hosts': (1, 1), 'offline_hosts': (1, 1), 'other_hosts': (1, 1)}
10135 else:
10136 params = {}
10137 return params
10140 register_check_parameters(
10141 RulespecGroupCheckParametersStorage,
10142 "ibm_svc_host",
10143 _("IBM SVC: Options for SVC Hosts Check"),
10144 Transform(
10145 Dictionary(elements=[
10147 "active_hosts",
10148 Tuple(
10149 title=_("Count of active hosts"),
10150 elements=[
10151 Integer(title=_("Warning at or below"), minvalue=0, unit=_("active hosts")),
10152 Integer(
10153 title=_("Critical at or below"), minvalue=0, unit=_("active hosts")),
10157 "inactive_hosts",
10158 Tuple(
10159 title=_("Count of inactive hosts"),
10160 elements=[
10161 Integer(
10162 title=_("Warning at or above"), minvalue=0, unit=_("inactive hosts")),
10163 Integer(
10164 title=_("Critical at or above"), minvalue=0, unit=_("inactive hosts")),
10168 "degraded_hosts",
10169 Tuple(
10170 title=_("Count of degraded hosts"),
10171 elements=[
10172 Integer(
10173 title=_("Warning at or above"), minvalue=0, unit=_("degraded hosts")),
10174 Integer(
10175 title=_("Critical at or above"), minvalue=0, unit=_("degraded hosts")),
10179 "offline_hosts",
10180 Tuple(
10181 title=_("Count of offline hosts"),
10182 elements=[
10183 Integer(
10184 title=_("Warning at or above"), minvalue=0, unit=_("offline hosts")),
10185 Integer(
10186 title=_("Critical at or above"), minvalue=0, unit=_("offline hosts")),
10190 "other_hosts",
10191 Tuple(
10192 title=_("Count of other hosts"),
10193 elements=[
10194 Integer(title=_("Warning at or above"), minvalue=0, unit=_("other hosts")),
10195 Integer(title=_("Critical at or above"), minvalue=0, unit=_("other hosts")),
10199 forth=transform_ibm_svc_host,
10201 None,
10202 "dict",
10205 register_check_parameters(
10206 RulespecGroupCheckParametersStorage,
10207 "ibm_svc_mdisk",
10208 _("IBM SVC: Options for SVC Disk Check"),
10209 Dictionary(
10210 optional_keys=False,
10211 elements=[
10213 "online_state",
10214 MonitoringState(
10215 title=_("Resulting state if disk is online"),
10216 default_value=0,
10220 "degraded_state",
10221 MonitoringState(
10222 title=_("Resulting state if disk is degraded"),
10223 default_value=1,
10227 "offline_state",
10228 MonitoringState(
10229 title=_("Resulting state if disk is offline"),
10230 default_value=2,
10234 "excluded_state",
10235 MonitoringState(
10236 title=_("Resulting state if disk is excluded"),
10237 default_value=2,
10241 "managed_mode",
10242 MonitoringState(
10243 title=_("Resulting state if disk is in managed mode"),
10244 default_value=0,
10248 "array_mode",
10249 MonitoringState(
10250 title=_("Resulting state if disk is in array mode"),
10251 default_value=0,
10255 "image_mode",
10256 MonitoringState(
10257 title=_("Resulting state if disk is in image mode"),
10258 default_value=0,
10262 "unmanaged_mode",
10263 MonitoringState(
10264 title=_("Resulting state if disk is in unmanaged mode"),
10265 default_value=1,
10269 TextAscii(
10270 title=_("IBM SVC disk"),
10271 help=_("Name of the disk, e.g. mdisk0"),
10273 "dict",
10276 register_check_parameters(
10277 RulespecGroupCheckParametersStorage,
10278 "diskstat",
10279 _("Levels for disk IO"),
10280 Dictionary(
10281 help=_(
10282 "With this rule you can set limits for various disk IO statistics. "
10283 "Keep in mind that not all of these settings may be applicable for the actual "
10284 "check. For example, if the check doesn't provide a <i>Read wait</i> information in its "
10285 "output, any configuration setting referring to <i>Read wait</i> will have no effect."),
10286 elements=[
10287 ("read",
10288 Levels(
10289 title=_("Read throughput"),
10290 unit=_("MB/s"),
10291 default_levels=(50.0, 100.0),
10293 ("write",
10294 Levels(
10295 title=_("Write throughput"),
10296 unit=_("MB/s"),
10297 default_levels=(50.0, 100.0),
10299 ("utilization",
10300 Levels(
10301 title=_("Disk Utilization"),
10302 unit=_("%"),
10303 default_levels=(80.0, 90.0),
10305 ("latency", Levels(
10306 title=_("Disk Latency"),
10307 unit=_("ms"),
10308 default_levels=(80.0, 160.0),
10310 ("read_wait", Levels(title=_("Read wait"), unit=_("ms"), default_levels=(30.0, 50.0))),
10311 ("write_wait", Levels(title=_("Write wait"), unit=_("ms"), default_levels=(30.0,
10312 50.0))),
10313 ("average",
10314 Age(
10315 title=_("Averaging"),
10316 help=_(
10317 "When averaging is set, then all of the disk's metrics are averaged "
10318 "over the selected interval - rather then the check interval. This allows "
10319 "you to make your monitoring less reactive to short peaks. But it will also "
10320 "introduce a loss of accuracy in your graphs. "),
10321 default_value=300,
10323 ("read_ios",
10324 Levels(title=_("Read operations"), unit=_("1/s"), default_levels=(400.0, 600.0))),
10325 ("write_ios",
10326 Levels(title=_("Write operations"), unit=_("1/s"), default_levels=(300.0, 400.0))),
10328 TextAscii(
10329 title=_("Device"),
10330 help=_(
10331 "For a summarized throughput of all disks, specify <tt>SUMMARY</tt>, "
10332 "a per-disk IO is specified by the drive letter, a colon and a slash on Windows "
10333 "(e.g. <tt>C:/</tt>) or by the device name on Linux/UNIX (e.g. <tt>/dev/sda</tt>).")),
10334 "dict",
10337 register_check_parameters(
10338 RulespecGroupCheckParametersStorage, "disk_io", _("Levels on disk IO (old style checks)"),
10339 Dictionary(elements=[
10340 ("read",
10341 Levels(
10342 title=_("Read throughput"),
10343 unit=_("MB/s"),
10344 default_value=None,
10345 default_levels=(50.0, 100.0))),
10346 ("write",
10347 Levels(
10348 title=_("Write throughput"),
10349 unit=_("MB/s"),
10350 default_value=None,
10351 default_levels=(50.0, 100.0))),
10352 ("average",
10353 Integer(
10354 title=_("Average"),
10355 help=_("When averaging is set, a floating average value "
10356 "of the disk throughput is computed and the levels for read "
10357 "and write will be applied to the average instead of the current "
10358 "value."),
10359 default_value=5,
10360 minvalue=1,
10361 unit=_("minutes"))),
10362 ("latency",
10363 Tuple(
10364 title=_("IO Latency"),
10365 elements=[
10366 Float(title=_("warning at"), unit=_("ms"), default_value=80.0),
10367 Float(title=_("critical at"), unit=_("ms"), default_value=160.0),
10368 ])),
10370 "latency_perfdata",
10371 Checkbox(
10372 title=_("Performance Data for Latency"),
10373 label=_("Collect performance data for disk latency"),
10374 help=_("Note: enabling performance data for the latency might "
10375 "cause incompatibilities with existing historical data "
10376 "if you are running PNP4Nagios in SINGLE mode.")),
10378 ("read_ql",
10379 Tuple(
10380 title=_("Read Queue-Length"),
10381 elements=[
10382 Float(title=_("warning at"), default_value=80.0),
10383 Float(title=_("critical at"), default_value=90.0),
10384 ])),
10385 ("write_ql",
10386 Tuple(
10387 title=_("Write Queue-Length"),
10388 elements=[
10389 Float(title=_("warning at"), default_value=80.0),
10390 Float(title=_("critical at"), default_value=90.0),
10391 ])),
10393 "ql_perfdata",
10394 Checkbox(
10395 title=_("Performance Data for Queue Length"),
10396 label=_("Collect performance data for disk latency"),
10397 help=_("Note: enabling performance data for the latency might "
10398 "cause incompatibilities with existing historical data "
10399 "if you are running PNP4Nagios in SINGLE mode.")),
10402 TextAscii(
10403 title=_("Device"),
10404 help=_(
10405 "For a summarized throughput of all disks, specify <tt>SUMMARY</tt>, for a "
10406 "sum of read or write throughput write <tt>read</tt> or <tt>write</tt> resp. "
10407 "A per-disk IO is specified by the drive letter, a colon and a slash on Windows "
10408 "(e.g. <tt>C:/</tt>) or by the device name on Linux/UNIX (e.g. <tt>/dev/sda</tt>).")),
10409 "dict")
10411 register_rule(
10412 RulespecGroupCheckParametersStorage,
10413 "diskstat_inventory",
10414 ListChoice(
10415 title=_("Discovery mode for Disk IO check"),
10416 help=_("This rule controls which and how many checks will be created "
10417 "for monitoring individual physical and logical disks. "
10418 "Note: the option <i>Create a summary for all read, one for "
10419 "write</i> has been removed. Some checks will still support "
10420 "this settings, but it will be removed there soon."),
10421 choices=[
10422 ("summary", _("Create a summary over all physical disks")),
10423 # This option is still supported by some checks, but is deprecated and
10424 # we fade it out...
10425 # ( "legacy", _("Create a summary for all read, one for write") ),
10426 ("physical", _("Create a separate check for each physical disk")),
10427 ("lvm", _("Create a separate check for each LVM volume (Linux)")),
10428 ("vxvm", _("Creata a separate check for each VxVM volume (Linux)")),
10429 ("diskless", _("Creata a separate check for each partition (XEN)")),
10431 default_value=['summary'],
10433 match="first")
10436 def transform_if_groups_forth(params):
10437 for param in params:
10438 if param.get("name"):
10439 param["group_name"] = param["name"]
10440 del param["name"]
10441 if param.get("include_items"):
10442 param["items"] = param["include_items"]
10443 del param["include_items"]
10444 if param.get("single") is not None:
10445 if param["single"]:
10446 param["group_presence"] = "instead"
10447 else:
10448 param["group_presence"] = "separate"
10449 del param["single"]
10450 return params
10453 vs_elements_if_groups_matches = [
10454 ("iftype",
10455 Transform(
10456 DropdownChoice(
10457 title=_("Select interface port type"),
10458 choices=defines.interface_port_types(),
10459 help=_("Only interfaces with the given port type are put into this group. "
10460 "For example 53 (propVirtual)."),
10462 forth=str,
10463 back=int,
10465 ("items",
10466 ListOfStrings(
10467 title=_("Restrict interface items"),
10468 help=_("Only interface with these item names are put into this group."),
10472 vs_elements_if_groups_group = [
10473 ("group_name",
10474 TextAscii(
10475 title=_("Group name"),
10476 help=_("Name of group in service description"),
10477 allow_empty=False,
10479 ("group_presence",
10480 DropdownChoice(
10481 title=_("Group interface presence"),
10482 help=_("Determine whether the group interface is created as an "
10483 "separate service or not. In second case the choosen interface "
10484 "services disapear."),
10485 choices=[
10486 ("separate", _("List grouped interfaces separately")),
10487 ("instead", _("List grouped interfaces instead")),
10489 default_value="instead",
10493 register_rule(
10494 RulespecGroupCheckParametersNetworking,
10495 varname="if_groups",
10496 title=_('Network interface groups'),
10497 help=_(
10498 'Normally the Interface checks create a single service for interface. '
10499 'By defining if-group patterns multiple interfaces can be combined together. '
10500 'A single service is created for this interface group showing the total traffic amount '
10501 'of its members. You can configure if interfaces which are identified as group interfaces '
10502 'should not show up as single service. You can restrict grouped interfaces by iftype and the '
10503 'item name of the single interface.'),
10504 valuespec=Transform(
10505 Alternative(
10506 style="dropdown",
10507 elements=[
10508 ListOf(
10509 title=_("Groups on single host"),
10510 add_label=_("Add pattern"),
10511 valuespec=Dictionary(
10512 elements=vs_elements_if_groups_group + vs_elements_if_groups_matches,
10513 required_keys=["group_name", "group_presence"]),
10515 ListOf(
10516 magic="@!!",
10517 title=_("Groups on cluster"),
10518 add_label=_("Add pattern"),
10519 valuespec=Dictionary(
10520 elements=vs_elements_if_groups_group +
10521 [("node_patterns",
10522 ListOf(
10523 title=_("Patterns for each node"),
10524 add_label=_("Add pattern"),
10525 valuespec=Dictionary(
10526 elements=[("node_name", TextAscii(title=_("Node name")))] +
10527 vs_elements_if_groups_matches,
10528 required_keys=["node_name"]),
10529 allow_empty=False,
10530 ))],
10531 optional_keys=[])),
10534 forth=transform_if_groups_forth),
10535 match='all',
10538 register_rule(
10539 RulespecGroupCheckParametersDiscovery,
10540 varname="winperf_msx_queues_inventory",
10541 title=_('MS Exchange Message Queues Discovery'),
10542 help=_(
10543 'Per default the offsets of all Windows performance counters are preconfigured in the check. '
10544 'If the format of your counters object is not compatible then you can adapt the counter '
10545 'offsets manually.'),
10546 valuespec=ListOf(
10547 Tuple(
10548 orientation="horizontal",
10549 elements=[
10550 TextAscii(
10551 title=_("Name of Counter"),
10552 help=_("Name of the Counter to be monitored."),
10553 size=50,
10554 allow_empty=False,
10556 Integer(
10557 title=_("Offset"),
10558 help=_("The offset of the information relative to counter base"),
10559 allow_empty=False,
10562 movable=False,
10563 add_label=_("Add Counter")),
10564 match='all',
10567 mailqueue_params = Dictionary(
10568 elements=[
10570 "deferred",
10571 Tuple(
10572 title=_("Mails in outgoing mail queue/deferred mails"),
10573 help=_("This rule is applied to the number of E-Mails currently "
10574 "in the deferred mail queue, or in the general outgoing mail "
10575 "queue, if such a distinction is not available."),
10576 elements=[
10577 Integer(title=_("Warning at"), unit=_("mails"), default_value=10),
10578 Integer(title=_("Critical at"), unit=_("mails"), default_value=20),
10583 "active",
10584 Tuple(
10585 title=_("Mails in active mail queue"),
10586 help=_("This rule is applied to the number of E-Mails currently "
10587 "in the active mail queue"),
10588 elements=[
10589 Integer(title=_("Warning at"), unit=_("mails"), default_value=800),
10590 Integer(title=_("Critical at"), unit=_("mails"), default_value=1000),
10595 optional_keys=["active"],
10598 register_check_parameters(
10599 RulespecGroupCheckParametersApplications,
10600 "mailqueue_length",
10601 _("Number of mails in outgoing mail queue"),
10602 Transform(
10603 mailqueue_params,
10604 forth=lambda old: not isinstance(old, dict) and {"deferred": old} or old,
10606 None,
10607 match_type="dict",
10608 deprecated=True,
10611 register_check_parameters(
10612 RulespecGroupCheckParametersApplications,
10613 "mail_queue_length",
10614 _("Number of mails in outgoing mail queue"),
10615 Transform(
10616 mailqueue_params,
10617 forth=lambda old: not isinstance(old, dict) and {"deferred": old} or old,
10619 TextAscii(title=_("Mail queue name")),
10620 match_type="dict",
10623 register_check_parameters(
10624 RulespecGroupCheckParametersApplications, "mail_latency", _("Mail Latency"),
10625 Tuple(
10626 title=_("Upper levels for Mail Latency"),
10627 elements=[
10628 Age(title=_("Warning at"), default_value=40),
10629 Age(title=_("Critical at"), default_value=60),
10630 ]), None, "first")
10632 register_check_parameters(
10633 RulespecGroupCheckParametersStorage,
10634 "zpool_status",
10635 _("ZFS storage pool status"),
10636 None,
10637 None,
10638 match_type="first",
10641 register_check_parameters(
10642 RulespecGroupCheckParametersVirtualization,
10643 "vm_state",
10644 _("Overall state of a virtual machine (for example ESX VMs)"),
10645 None,
10646 None,
10647 match_type="first",
10650 register_check_parameters(
10651 RulespecGroupCheckParametersHardware,
10652 "hw_errors",
10653 _("Simple checks for BIOS/Hardware errors"),
10654 None,
10655 None,
10656 match_type="first",
10659 register_check_parameters(
10660 RulespecGroupCheckParametersApplications, "omd_status", _("OMD site status"), None,
10661 TextAscii(
10662 title=_("Name of the OMD site"),
10663 help=_("The name of the OMD site to check the status for")), "first")
10665 register_check_parameters(
10666 RulespecGroupCheckParametersStorage, "network_fs",
10667 _("Network filesystem - overall status (e.g. NFS)"),
10668 Dictionary(
10669 elements=[
10671 "has_perfdata",
10672 DropdownChoice(
10673 title=_("Performance data settings"),
10674 choices=[
10675 (True, _("Enable performance data")),
10676 (False, _("Disable performance data")),
10678 default_value=False),
10680 ],),
10681 TextAscii(
10682 title=_("Name of the mount point"), help=_("For NFS enter the name of the mount point.")),
10683 "dict")
10685 register_check_parameters(
10686 RulespecGroupCheckParametersStorage,
10687 "windows_multipath",
10688 _("Windows Multipath Count"),
10689 Alternative(
10690 help=_("This rules sets the expected number of active paths for a multipath LUN."),
10691 title=_("Expected number of active paths"),
10692 elements=[
10693 Integer(title=_("Expected number of active paths")),
10694 Tuple(
10695 title=_("Expected percentage of active paths"),
10696 elements=[
10697 Integer(title=_("Expected number of active paths")),
10698 Percentage(title=_("Warning if less then")),
10699 Percentage(title=_("Critical if less then")),
10702 None,
10703 "first",
10706 register_check_parameters(
10707 RulespecGroupCheckParametersStorage, "multipath", _("Linux and Solaris Multipath Count"),
10708 Alternative(
10709 help=_("This rules sets the expected number of active paths for a multipath LUN "
10710 "on Linux and Solaris hosts"),
10711 title=_("Expected number of active paths"),
10712 elements=[
10713 Integer(title=_("Expected number of active paths")),
10714 Tuple(
10715 title=_("Expected percentage of active paths"),
10716 elements=[
10717 Percentage(title=_("Warning if less then")),
10718 Percentage(title=_("Critical if less then")),
10721 TextAscii(
10722 title=_("Name of the MP LUN"),
10723 help=_("For Linux multipathing this is either the UUID (e.g. "
10724 "60a9800043346937686f456f59386741), or the configured "
10725 "alias.")), "first")
10727 register_rule(
10728 RulespecGroupCheckParametersStorage,
10729 varname="inventory_multipath_rules",
10730 title=_("Linux Multipath Inventory"),
10731 valuespec=Dictionary(
10732 elements=[
10733 ("use_alias",
10734 Checkbox(
10735 title=_("Use the multipath alias as service name, if one is set"),
10736 label=_("use alias"),
10737 help=_(
10738 "If a multipath device has an alias then you can use it for specifying "
10739 "the device instead of the UUID. The alias will then be part of the service "
10740 "description. The UUID will be displayed in the plugin output."))),
10742 help=_(
10743 "This rule controls whether the UUID or the alias is used in the service description during "
10744 "discovery of Multipath devices on Linux."),
10746 match='dict',
10749 register_check_parameters(
10750 RulespecGroupCheckParametersStorage, "multipath_count", _("ESX Multipath Count"),
10751 Alternative(
10752 help=_("This rules sets the expected number of active paths for a multipath LUN "
10753 "on ESX servers"),
10754 title=_("Match type"),
10755 elements=[
10756 FixedValue(
10757 None,
10758 title=_("OK if standby count is zero or equals active paths."),
10759 totext="",
10761 Dictionary(
10762 title=_("Custom settings"),
10763 elements=[
10764 (element,
10765 Transform(
10766 Tuple(
10767 title=description,
10768 elements=[
10769 Integer(title=_("Critical if less than")),
10770 Integer(title=_("Warning if less than")),
10771 Integer(title=_("Warning if more than")),
10772 Integer(title=_("Critical if more than")),
10774 forth=lambda x: len(x) == 2 and (0, 0, x[0], x[1]) or x))
10775 for (element,
10776 description) in [("active", _("Active paths")), (
10777 "dead", _("Dead paths")), (
10778 "disabled", _("Disabled paths")), (
10779 "standby", _("Standby paths")), ("unknown",
10780 _("Unknown paths"))]
10782 ]), TextAscii(title=_("Path ID")), "first")
10784 register_check_parameters(
10785 RulespecGroupCheckParametersStorage, "hpux_multipath", _("HP-UX Multipath Count"),
10786 Tuple(
10787 title=_("Expected path situation"),
10788 help=_("This rules sets the expected number of various paths for a multipath LUN "
10789 "on HPUX servers"),
10790 elements=[
10791 Integer(title=_("Number of active paths")),
10792 Integer(title=_("Number of standby paths")),
10793 Integer(title=_("Number of failed paths")),
10794 Integer(title=_("Number of unopen paths")),
10795 ]), TextAscii(title=_("WWID of the LUN")), "first")
10797 register_check_parameters(
10798 RulespecGroupCheckParametersStorage,
10799 "drbd",
10800 _("DR:BD roles and diskstates"),
10801 Dictionary(elements=[(
10802 "roles",
10803 Alternative(
10804 title=_("Roles"),
10805 elements=[
10806 FixedValue(None, totext="", title=_("Do not monitor")),
10807 ListOf(
10808 Tuple(
10809 orientation="horizontal",
10810 elements=[
10811 DropdownChoice(
10812 title=_("DRBD shows up as"),
10813 default_value="running",
10814 choices=[("primary_secondary", _("Primary / Secondary")
10815 ), ("primary_primary", _("Primary / Primary")
10816 ), ("secondary_primary", _("Secondary / Primary")
10817 ), ("secondary_secondary",
10818 _("Secondary / Secondary"))]),
10819 MonitoringState(title=_("Resulting state"),),
10821 default_value=("ignore", 0)),
10822 title=_("Set roles"),
10823 add_label=_("Add role rule"))
10824 ])),
10826 "diskstates",
10827 Alternative(
10828 title=_("Diskstates"),
10829 elements=[
10830 FixedValue(None, totext="", title=_("Do not monitor")),
10831 ListOf(
10832 Tuple(
10833 elements=[
10834 DropdownChoice(
10835 title=_("Diskstate"),
10836 choices=[
10837 ("primary_Diskless",
10838 _("Primary - Diskless")),
10839 ("primary_Attaching",
10840 _("Primary - Attaching")),
10841 ("primary_Failed", _("Primary - Failed")),
10842 ("primary_Negotiating",
10843 _("Primary - Negotiating")),
10844 ("primary_Inconsistent",
10845 _("Primary - Inconsistent")),
10846 ("primary_Outdated",
10847 _("Primary - Outdated")),
10848 ("primary_DUnknown",
10849 _("Primary - DUnknown")),
10850 ("primary_Consistent",
10851 _("Primary - Consistent")),
10852 ("primary_UpToDate",
10853 _("Primary - UpToDate")),
10854 ("secondary_Diskless",
10855 _("Secondary - Diskless")),
10856 ("secondary_Attaching",
10857 _("Secondary - Attaching")),
10858 ("secondary_Failed",
10859 _("Secondary - Failed")),
10860 ("secondary_Negotiating",
10861 _("Secondary - Negotiating")),
10862 ("secondary_Inconsistent",
10863 _("Secondary - Inconsistent")),
10864 ("secondary_Outdated",
10865 _("Secondary - Outdated")),
10866 ("secondary_DUnknown",
10867 _("Secondary - DUnknown")),
10868 ("secondary_Consistent",
10869 _("Secondary - Consistent")),
10870 ("secondary_UpToDate",
10871 _("Secondary - UpToDate")),
10873 MonitoringState(title=_("Resulting state"))
10875 orientation="horizontal",
10877 title=_("Set diskstates"),
10878 add_label=_("Add diskstate rule"))
10880 )]),
10881 TextAscii(title=_("DRBD device")),
10882 match_type="dict",
10885 register_check_parameters(
10886 RulespecGroupCheckParametersStorage,
10887 "snapvault",
10888 _("NetApp Snapvaults / Snapmirror Lag Time"),
10889 Dictionary(
10890 elements=
10892 "lag_time",
10893 Tuple(
10894 title=_("Default levels"),
10895 elements=[
10896 Age(title=_("Warning at")),
10897 Age(title=_("Critical at")),
10901 ("policy_lag_time",
10902 ListOf(
10903 Tuple(
10904 orientation="horizontal",
10905 elements=[
10906 TextAscii(title=_("Policy name")),
10907 Tuple(
10908 title=_("Maximum age"),
10909 elements=[
10910 Age(title=_("Warning at")),
10911 Age(title=_("Critical at")),
10915 title=_('Policy specific levels (Clustermode only)'),
10916 help=_(
10917 "Here you can specify levels for different policies which overrule the levels "
10918 "from the <i>Default levels</i> parameter. This setting only works in NetApp Clustermode setups."
10920 allow_empty=False,
10921 ))],),
10922 TextAscii(title=_("Source Path"), allow_empty=False),
10923 "dict",
10926 register_check_parameters(
10927 RulespecGroupCheckParametersStorage,
10928 "netapp_snapshots",
10929 _("NetApp Snapshot Reserve"),
10930 Dictionary(
10931 elements=[
10932 ("levels",
10933 Tuple(
10934 title=_("Levels for used configured reserve"),
10935 elements=[
10936 Percentage(title=_("Warning at or above"), unit="%", default_value=85.0),
10937 Percentage(title=_("Critical at or above"), unit="%", default_value=90.0),
10938 ])),
10939 ("state_noreserve", MonitoringState(title=_("State if no reserve is configured"),)),
10940 ],),
10941 TextAscii(title=_("Volume name")),
10942 match_type="dict",
10945 register_check_parameters(
10946 RulespecGroupCheckParametersStorage,
10947 "netapp_disks",
10948 _("Filer Disk Levels (NetApp, IBM SVC)"),
10949 Transform(
10950 Dictionary(
10951 elements=[
10952 ("failed_spare_ratio",
10953 Tuple(
10954 title=_("Failed to spare ratio"),
10955 help=_("You can set a limit to the failed to spare disk ratio. "
10956 "The ratio is calculated with <i>spare / (failed + spare)</i>."),
10957 elements=[
10958 Percentage(title=_("Warning at or above"), default_value=1.0),
10959 Percentage(title=_("Critical at or above"), default_value=50.0),
10960 ])),
10961 ("offline_spare_ratio",
10962 Tuple(
10963 title=_("Offline to spare ratio"),
10964 help=_("You can set a limit to the offline to spare disk ratio. "
10965 "The ratio is calculated with <i>spare / (offline + spare)</i>."),
10966 elements=[
10967 Percentage(title=_("Warning at or above"), default_value=1.0),
10968 Percentage(title=_("Critical at or above"), default_value=50.0),
10969 ])),
10970 ("number_of_spare_disks",
10971 Tuple(
10972 title=_("Number of spare disks"),
10973 help=_("You can set a lower limit to the absolute number of spare disks."),
10974 elements=[
10975 Integer(title=_("Warning below"), default_value=2, min_value=0),
10976 Integer(title=_("Critical below"), default_value=1, min_value=0),
10977 ])),
10978 ],),
10979 forth=
10980 lambda a: "broken_spare_ratio" in a and {"failed_spare_ratio": a["broken_spare_ratio"]} or a
10982 None,
10983 match_type="dict",
10986 register_check_parameters(
10987 RulespecGroupCheckParametersStorage,
10988 "netapp_volumes",
10989 _("NetApp Volumes"),
10990 Dictionary(elements=[
10991 ("levels",
10992 Alternative(
10993 title=_("Levels for volume"),
10994 show_alternative_title=True,
10995 default_value=(80.0, 90.0),
10996 match=match_dual_level_type,
10997 elements=[
10998 get_free_used_dynamic_valuespec("used", "volume"),
10999 Transform(
11000 get_free_used_dynamic_valuespec("free", "volume", default_value=(20.0, 10.0)),
11001 allow_empty=False,
11002 forth=transform_filesystem_free,
11003 back=transform_filesystem_free)
11004 ])),
11005 ("perfdata",
11006 ListChoice(
11007 title=_("Performance data for protocols"),
11008 help=_("Specify for which protocol performance data should get recorded."),
11009 choices=[
11010 ("", _("Summarized data of all protocols")),
11011 ("nfs", _("NFS")),
11012 ("cifs", _("CIFS")),
11013 ("san", _("SAN")),
11014 ("fcp", _("FCP")),
11015 ("iscsi", _("iSCSI")),
11018 ("magic",
11019 Float(
11020 title=_("Magic factor (automatic level adaptation for large volumes)"),
11021 default_value=0.8,
11022 minvalue=0.1,
11023 maxvalue=1.0)),
11024 ("magic_normsize",
11025 Integer(
11026 title=_("Reference size for magic factor"), default_value=20, minvalue=1, unit=_("GB"))
11028 ("levels_low",
11029 Tuple(
11030 title=_("Minimum levels if using magic factor"),
11031 help=_("The volume levels will never fall below these values, when using "
11032 "the magic factor and the volume is very small."),
11033 elements=[
11034 Percentage(
11035 title=_("Warning if above"),
11036 unit=_("% usage"),
11037 allow_int=True,
11038 default_value=50),
11039 Percentage(
11040 title=_("Critical if above"),
11041 unit=_("% usage"),
11042 allow_int=True,
11043 default_value=60)
11044 ])),
11045 ("inodes_levels",
11046 Alternative(
11047 title=_("Levels for Inodes"),
11048 help=_("The number of remaining inodes on the filesystem. "
11049 "Please note that this setting has no effect on some filesystem checks."),
11050 elements=[
11051 Tuple(
11052 title=_("Percentage free"),
11053 elements=[
11054 Percentage(title=_("Warning if less than")),
11055 Percentage(title=_("Critical if less than")),
11057 Tuple(
11058 title=_("Absolute free"),
11059 elements=[
11060 Integer(
11061 title=_("Warning if less than"),
11062 size=10,
11063 unit=_("inodes"),
11064 minvalue=0,
11065 default_value=10000),
11066 Integer(
11067 title=_("Critical if less than"),
11068 size=10,
11069 unit=_("inodes"),
11070 minvalue=0,
11071 default_value=5000),
11074 default_value=(10.0, 5.0),
11076 ("show_inodes",
11077 DropdownChoice(
11078 title=_("Display inode usage in check output..."),
11079 choices=[
11080 ("onproblem", _("Only in case of a problem")),
11081 ("onlow", _("Only in case of a problem or if inodes are below 50%")),
11082 ("always", _("Always")),
11084 default_value="onlow",
11086 ("trend_range",
11087 Optional(
11088 Integer(
11089 title=_("Time Range for filesystem trend computation"),
11090 default_value=24,
11091 minvalue=1,
11092 unit=_("hours")),
11093 title=_("Trend computation"),
11094 label=_("Enable trend computation"))),
11095 ("trend_mb",
11096 Tuple(
11097 title=_("Levels on trends in MB per time range"),
11098 elements=[
11099 Integer(title=_("Warning at"), unit=_("MB / range"), default_value=100),
11100 Integer(title=_("Critical at"), unit=_("MB / range"), default_value=200)
11101 ])),
11102 ("trend_perc",
11103 Tuple(
11104 title=_("Levels for the percentual growth per time range"),
11105 elements=[
11106 Percentage(
11107 title=_("Warning at"),
11108 unit=_("% / range"),
11109 default_value=5,
11111 Percentage(
11112 title=_("Critical at"),
11113 unit=_("% / range"),
11114 default_value=10,
11116 ])),
11117 ("trend_timeleft",
11118 Tuple(
11119 title=_("Levels on the time left until the filesystem gets full"),
11120 elements=[
11121 Integer(
11122 title=_("Warning if below"),
11123 unit=_("hours"),
11124 default_value=12,
11126 Integer(
11127 title=_("Critical if below"),
11128 unit=_("hours"),
11129 default_value=6,
11131 ])),
11132 ("trend_showtimeleft",
11133 Checkbox(
11134 title=_("Display time left in check output"),
11135 label=_("Enable"),
11136 help=_("Normally, the time left until the disk is full is only displayed when "
11137 "the configured levels have been breached. If you set this option "
11138 "the check always reports this information"))),
11139 ("trend_perfdata",
11140 Checkbox(
11141 title=_("Trend performance data"),
11142 label=_("Enable generation of performance data from trends"))),
11144 TextAscii(title=_("Volume name")),
11145 match_type="dict",
11148 register_check_parameters(
11149 RulespecGroupCheckParametersStorage,
11150 "netapp_luns",
11151 _("NetApp LUNs"),
11152 Dictionary(
11153 title=_("Configure levels for used space"),
11154 elements=[
11155 ("ignore_levels",
11156 FixedValue(
11157 title=_("Ignore used space (this option disables any other options)"),
11158 help=_(
11159 "Some luns, e.g. jfs formatted, tend to report incorrect used space values"),
11160 label=_("Ignore used space"),
11161 value=True,
11162 totext="",
11164 ("levels",
11165 Alternative(
11166 title=_("Levels for LUN"),
11167 show_alternative_title=True,
11168 default_value=(80.0, 90.0),
11169 match=match_dual_level_type,
11170 elements=[
11171 get_free_used_dynamic_valuespec("used", "LUN"),
11172 Transform(
11173 get_free_used_dynamic_valuespec("free", "LUN", default_value=(20.0, 10.0)),
11174 allow_empty=False,
11175 forth=transform_filesystem_free,
11176 back=transform_filesystem_free,
11178 ])),
11179 ("trend_range",
11180 Optional(
11181 Integer(
11182 title=_("Time Range for lun filesystem trend computation"),
11183 default_value=24,
11184 minvalue=1,
11185 unit=_("hours")),
11186 title=_("Trend computation"),
11187 label=_("Enable trend computation"))),
11188 ("trend_mb",
11189 Tuple(
11190 title=_("Levels on trends in MB per time range"),
11191 elements=[
11192 Integer(title=_("Warning at"), unit=_("MB / range"), default_value=100),
11193 Integer(title=_("Critical at"), unit=_("MB / range"), default_value=200)
11194 ])),
11195 ("trend_perc",
11196 Tuple(
11197 title=_("Levels for the percentual growth per time range"),
11198 elements=[
11199 Percentage(
11200 title=_("Warning at"),
11201 unit=_("% / range"),
11202 default_value=5,
11204 Percentage(
11205 title=_("Critical at"),
11206 unit=_("% / range"),
11207 default_value=10,
11209 ])),
11210 ("trend_timeleft",
11211 Tuple(
11212 title=_("Levels on the time left until the lun filesystem gets full"),
11213 elements=[
11214 Integer(
11215 title=_("Warning if below"),
11216 unit=_("hours"),
11217 default_value=12,
11219 Integer(
11220 title=_("Critical if below"),
11221 unit=_("hours"),
11222 default_value=6,
11224 ])),
11225 ("trend_showtimeleft",
11226 Checkbox(
11227 title=_("Display time left in check output"),
11228 label=_("Enable"),
11229 help=_(
11230 "Normally, the time left until the lun filesystem is full is only displayed when "
11231 "the configured levels have been breached. If you set this option "
11232 "the check always reports this information"))),
11233 ("trend_perfdata",
11234 Checkbox(
11235 title=_("Trend performance data"),
11236 label=_("Enable generation of performance data from trends"))),
11237 ("read_only",
11238 Checkbox(
11239 title=_("LUN is read-only"),
11240 help=_("Display a warning if a LUN is not read-only. Without "
11241 "this setting a warning will be displayed if a LUN is "
11242 "read-only."),
11243 label=_("Enable"))),
11245 TextAscii(title=_("LUN name")),
11246 match_type="dict",
11249 register_check_parameters(
11250 RulespecGroupCheckParametersApplications,
11251 "services",
11252 _("Windows Services"),
11253 Dictionary(elements=[
11254 ("additional_servicenames",
11255 ListOfStrings(
11256 title=_("Alternative names for the service"),
11257 help=_("Here you can specify alternative names that the service might have. "
11258 "This helps when the exact spelling of the services can changed from "
11259 "one version to another."),
11261 ("states",
11262 ListOf(
11263 Tuple(
11264 orientation="horizontal",
11265 elements=[
11266 DropdownChoice(
11267 title=_("Expected state"),
11268 default_value="running",
11269 choices=[(None,
11270 _("ignore the state")), ("running",
11271 _("running")), ("stopped",
11272 _("stopped"))]),
11273 DropdownChoice(
11274 title=_("Start type"),
11275 default_value="auto",
11276 choices=[
11277 (None, _("ignore the start type")),
11278 ("demand",
11279 _("demand")),
11280 ("disabled", _("disabled")),
11281 ("auto", _("auto")),
11282 ("unknown", _("unknown (old agent)")),
11284 MonitoringState(title=_("Resulting state"),),
11286 default_value=("running", "auto", 0)),
11287 title=_("Services states"),
11288 help=_("You can specify a separate monitoring state for each possible "
11289 "combination of service state and start type. If you do not use "
11290 "this parameter, then only running/auto will be assumed to be OK."),
11291 )), (
11292 "else",
11293 MonitoringState(
11294 title=_("State if no entry matches"),
11295 default_value=2,
11298 ('icon',
11299 UserIconOrAction(
11300 title=_("Add custom icon or action"),
11301 help=_("You can assign icons or actions to the found services in the status GUI."),
11304 TextAscii(
11305 title=_("Name of the service"),
11306 help=_("Please Please note, that the agent replaces spaces in "
11307 "the service names with underscores. If you are unsure about the "
11308 "correct spelling of the name then please look at the output of "
11309 "the agent (cmk -d HOSTNAME). The service names are in the first "
11310 "column of the section &lt;&lt;&lt;services&gt;&gt;&gt;. Please "
11311 "do not mix up the service name with the display name of the service."
11312 "The latter one is just being displayed as a further information."),
11313 allow_empty=False),
11314 match_type="dict",
11317 register_check_parameters(
11318 RulespecGroupCheckParametersApplications,
11319 "solaris_services",
11320 _("Solaris Services"),
11321 Dictionary(
11322 elements=[
11323 ("additional_servicenames",
11324 ListOfStrings(
11325 title=_("Alternative names for the service"),
11326 help=_("Here you can specify alternative names that the service might have. "
11327 "This helps when the exact spelling of the services can changed from "
11328 "one version to another."),
11330 ("states",
11331 ListOf(
11332 Tuple(
11333 orientation="horizontal",
11334 elements=[
11335 DropdownChoice(
11336 title=_("Expected state"),
11337 choices=[
11338 (None, _("Ignore the state")),
11339 ("online", _("Online")),
11340 ("disabled", _("Disabled")),
11341 ("maintenance", _("Maintenance")),
11342 ("legacy_run", _("Legacy run")),
11344 DropdownChoice(
11345 title=_("STIME"),
11346 choices=[
11347 (None, _("Ignore")),
11348 (True, _("Has changed")),
11349 (False, _("Did not changed")),
11351 MonitoringState(title=_("Resulting state"),),
11354 title=_("Services states"),
11355 help=_("You can specify a separate monitoring state for each possible "
11356 "combination of service state. If you do not use this parameter, "
11357 "then only online/legacy_run will be assumed to be OK."),
11359 ("else", MonitoringState(
11360 title=_("State if no entry matches"),
11361 default_value=2,
11363 ],),
11364 TextAscii(title=_("Name of the service"), allow_empty=False),
11365 match_type="dict",
11368 register_check_parameters(
11369 RulespecGroupCheckParametersApplications,
11370 "winperf_ts_sessions",
11371 _("Windows Terminal Server Sessions"),
11372 Dictionary(
11373 help=_("This check monitors number of active and inactive terminal "
11374 "server sessions."),
11375 elements=[
11377 "active",
11378 Tuple(
11379 title=_("Number of active sessions"),
11380 elements=[
11381 Integer(title=_("Warning at"), unit=_("sessions"), default_value=100),
11382 Integer(title=_("Critical at"), unit=_("sessions"), default_value=200),
11387 "inactive",
11388 Tuple(
11389 title=_("Number of inactive sessions"),
11390 help=_("Levels for the number of sessions that are currently inactive"),
11391 elements=[
11392 Integer(title=_("Warning at"), unit=_("sessions"), default_value=10),
11393 Integer(title=_("Critical at"), unit=_("sessions"), default_value=20),
11398 None,
11399 match_type="dict",
11402 register_check_parameters(
11403 RulespecGroupCheckParametersStorage, "raid", _("RAID: overall state"), None,
11404 TextAscii(
11405 title=_("Name of the device"),
11406 help=_("For Linux MD specify the device name without the "
11407 "<tt>/dev/</tt>, e.g. <tt>md0</tt>, for hardware raids "
11408 "please refer to the manual of the actual check being used.")), "first")
11410 register_check_parameters(
11411 RulespecGroupCheckParametersStorage, "raid_summary", _("RAID: summary state"),
11412 Dictionary(elements=[
11413 ("use_device_states",
11414 DropdownChoice(
11415 title=_("Use device states and overwrite expected status"),
11416 choices=[
11417 (False, _("Ignore")),
11418 (True, _("Use device states")),
11420 default_value=True,
11422 ]), None, "dict")
11424 register_check_parameters(
11425 RulespecGroupCheckParametersStorage, "raid_disk", _("RAID: state of a single disk"),
11426 Transform(
11427 Dictionary(elements=[
11429 "expected_state",
11430 TextAscii(
11431 title=_("Expected state"),
11432 help=_("State the disk is expected to be in. Typical good states "
11433 "are online, host spare, OK and the like. The exact way of how "
11434 "to specify a state depends on the check and hard type being used. "
11435 "Please take examples from discovered checks for reference.")),
11437 ("use_device_states",
11438 DropdownChoice(
11439 title=_("Use device states and overwrite expected status"),
11440 choices=[
11441 (False, _("Ignore")),
11442 (True, _("Use device states")),
11444 default_value=True,
11447 forth=lambda x: isinstance(x, str) and {"expected_state": x} or x,
11449 TextAscii(
11450 title=_("Number or ID of the disk"),
11451 help=_("How the disks are named depends on the type of hardware being "
11452 "used. Please look at already discovered checks for examples.")), "first")
11454 register_check_parameters(
11455 RulespecGroupCheckParametersStorage, "pfm_health", _("PCIe flash module"),
11456 Dictionary(
11457 elements=[
11459 "health_lifetime_perc",
11460 Tuple(
11461 title=_("Lower levels for health lifetime"),
11462 elements=[
11463 Percentage(title=_("Warning if below"), default_value=10),
11464 Percentage(title=_("Critical if below"), default_value=5)
11468 ],),
11469 TextAscii(
11470 title=_("Number or ID of the disk"),
11471 help=_("How the disks are named depends on the type of hardware being "
11472 "used. Please look at already discovered checks for examples.")), "dict")
11474 register_check_parameters(
11475 RulespecGroupCheckParametersEnvironment,
11476 "switch_contact",
11477 _("Switch contact state"),
11478 DropdownChoice(
11479 help=_("This rule sets the required state of a switch contact"),
11480 label=_("Required switch contact state"),
11481 choices=[
11482 ("open", "Switch contact is <b>open</b>"),
11483 ("closed", "Switch contact is <b>closed</b>"),
11484 ("ignore", "Ignore switch contact state"),
11487 TextAscii(title=_("Sensor"), allow_empty=False),
11488 match_type="first",
11491 register_check_parameters(
11492 RulespecGroupCheckParametersEnvironment,
11493 "plugs",
11494 _("State of PDU Plugs"),
11495 DropdownChoice(
11496 help=_("This rule sets the required state of a PDU plug. It is meant to "
11497 "be independent of the hardware manufacturer."),
11498 title=_("Required plug state"),
11499 choices=[
11500 ("on", _("Plug is ON")),
11501 ("off", _("Plug is OFF")),
11503 default_value="on"),
11504 TextAscii(
11505 title=_("Plug item number or name"),
11506 help=
11507 _("Whether you need the number or the name depends on the check. Just take a look to the service description."
11509 allow_empty=True),
11510 match_type="first",
11513 # New temperature rule for modern temperature checks that have the
11514 # sensor type (e.g. "CPU", "Chassis", etc.) as the beginning of their
11515 # item (e.g. "CPU 1", "Chassis 17/11"). This will replace all other
11516 # temperature rulesets in future. Note: those few temperature checks
11517 # that do *not* use an item, need to be converted to use one single
11518 # item (other than None).
11519 register_check_parameters(
11520 RulespecGroupCheckParametersEnvironment,
11521 "temperature",
11522 _("Temperature"),
11523 Transform(
11524 Dictionary(elements=[
11525 ("levels",
11526 Tuple(
11527 title=_("Upper Temperature Levels"),
11528 elements=[
11529 Float(title=_("Warning at"), unit=u"°C", default_value=26),
11530 Float(title=_("Critical at"), unit=u"°C", default_value=30),
11531 ])),
11532 ("levels_lower",
11533 Tuple(
11534 title=_("Lower Temperature Levels"),
11535 elements=[
11536 Float(title=_("Warning below"), unit=u"°C", default_value=0),
11537 Float(title=_("Critical below"), unit=u"°C", default_value=-10),
11538 ])),
11539 ("output_unit",
11540 DropdownChoice(
11541 title=_("Display values in "),
11542 choices=[
11543 ("c", _("Celsius")),
11544 ("f", _("Fahrenheit")),
11545 ("k", _("Kelvin")),
11546 ])),
11547 ("input_unit",
11548 DropdownChoice(
11549 title=_("Override unit of sensor"),
11550 help=_("In some rare cases the unit that is signalled by the sensor "
11551 "is wrong and e.g. the sensor sends values in Fahrenheit while "
11552 "they are misinterpreted as Celsius. With this setting you can "
11553 "force the reading of the sensor to be interpreted as customized. "),
11554 choices=[
11555 ("c", _("Celsius")),
11556 ("f", _("Fahrenheit")),
11557 ("k", _("Kelvin")),
11558 ])),
11559 ("device_levels_handling",
11560 DropdownChoice(
11561 title=_("Interpretation of the device's own temperature status"),
11562 choices=[
11563 ("usr", _("Ignore device's own levels")),
11564 ("dev", _("Only use device's levels, ignore yours")),
11565 ("best", _("Use least critical of your and device's levels")),
11566 ("worst", _("Use most critical of your and device's levels")),
11567 ("devdefault", _("Use device's levels if present, otherwise yours")),
11568 ("usrdefault", _("Use your own levels if present, otherwise the device's")),
11570 default_value="usrdefault",
11573 "trend_compute",
11574 Dictionary(
11575 title=_("Trend computation"),
11576 label=_("Enable trend computation"),
11577 elements=[
11578 ("period",
11579 Integer(
11580 title=_("Observation period for temperature trend computation"),
11581 default_value=30,
11582 minvalue=5,
11583 unit=_("minutes"))),
11584 ("trend_levels",
11585 Tuple(
11586 title=_("Levels on temperature increase per period"),
11587 elements=[
11588 Integer(
11589 title=_("Warning at"),
11590 unit=u"°C / " + _("period"),
11591 default_value=5),
11592 Integer(
11593 title=_("Critical at"),
11594 unit=u"°C / " + _("period"),
11595 default_value=10)
11596 ])),
11597 ("trend_levels_lower",
11598 Tuple(
11599 title=_("Levels on temperature decrease per period"),
11600 elements=[
11601 Integer(
11602 title=_("Warning at"),
11603 unit=u"°C / " + _("period"),
11604 default_value=5),
11605 Integer(
11606 title=_("Critical at"),
11607 unit=u"°C / " + _("period"),
11608 default_value=10)
11609 ])),
11610 ("trend_timeleft",
11611 Tuple(
11612 title=
11613 _("Levels on the time left until a critical temperature (upper or lower) is reached"
11615 elements=[
11616 Integer(
11617 title=_("Warning if below"),
11618 unit=_("minutes"),
11619 default_value=240,
11621 Integer(
11622 title=_("Critical if below"),
11623 unit=_("minutes"),
11624 default_value=120,
11628 optional_keys=["trend_levels", "trend_levels_lower", "trend_timeleft"],
11632 forth=lambda v: isinstance(v, tuple) and {"levels": v} or v,
11634 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
11635 "dict",
11638 register_check_parameters(
11639 RulespecGroupCheckParametersEnvironment,
11640 "room_temperature",
11641 _("Room temperature (external thermal sensors)"),
11642 Tuple(
11643 help=_("Temperature levels for external thermometers that are used "
11644 "for monitoring the temperature of a datacenter. An example "
11645 "is the webthem from W&T."),
11646 elements=[
11647 Integer(title=_("warning at"), unit=u"°C", default_value=26),
11648 Integer(title=_("critical at"), unit=u"°C", default_value=30),
11650 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
11651 "first",
11652 deprecated=True,
11655 register_check_parameters(
11656 RulespecGroupCheckParametersEnvironment,
11657 "hw_single_temperature",
11658 _("Host/Device temperature"),
11659 Tuple(
11660 help=_("Temperature levels for hardware devices with "
11661 "a single temperature sensor."),
11662 elements=[
11663 Integer(title=_("warning at"), unit=u"°C", default_value=35),
11664 Integer(title=_("critical at"), unit=u"°C", default_value=40),
11666 None,
11667 "first",
11668 deprecated=True,
11671 register_check_parameters(
11672 RulespecGroupCheckParametersEnvironment, "evolt",
11673 _("Voltage levels (UPS / PDU / Other Devices)"),
11674 Tuple(
11675 help=_("Voltage Levels for devices like UPS or PDUs. "
11676 "Several phases may be addressed independently."),
11677 elements=[
11678 Integer(title=_("warning if below"), unit="V", default_value=210),
11679 Integer(title=_("critical if below"), unit="V", default_value=180),
11681 TextAscii(title=_("Phase"),
11682 help=_("The identifier of the phase the power is related to.")), "first")
11684 register_check_parameters(
11685 RulespecGroupCheckParametersEnvironment, "efreq", _("Nominal Frequencies"),
11686 Tuple(
11687 help=_("Levels for the nominal frequencies of AC devices "
11688 "like UPSs or PDUs. Several phases may be addressed independently."),
11689 elements=[
11690 Integer(title=_("warning if below"), unit="Hz", default_value=40),
11691 Integer(title=_("critical if below"), unit="Hz", default_value=45),
11693 TextAscii(title=_("Phase"), help=_("The identifier of the phase the power is related to.")),
11694 "first")
11696 register_check_parameters(
11697 RulespecGroupCheckParametersEnvironment, "epower", _("Electrical Power"),
11698 Tuple(
11699 help=_("Levels for the electrical power consumption of a device "
11700 "like a UPS or a PDU. Several phases may be addressed independently."),
11701 elements=[
11702 Integer(title=_("warning if below"), unit="Watt", default_value=20),
11703 Integer(title=_("critical if below"), unit="Watt", default_value=1),
11705 TextAscii(title=_("Phase"), help=_("The identifier of the phase the power is related to.")),
11706 "first")
11708 register_check_parameters(
11709 RulespecGroupCheckParametersEnvironment, "ups_out_load",
11710 _("Parameters for output loads of UPSs and PDUs"),
11711 Tuple(elements=[
11712 Integer(title=_("warning at"), unit=u"%", default_value=85),
11713 Integer(title=_("critical at"), unit=u"%", default_value=90),
11714 ]), TextAscii(title=_("Phase"), help=_("The identifier of the phase the power is related to.")),
11715 "first")
11717 register_check_parameters(
11718 RulespecGroupCheckParametersEnvironment, "epower_single",
11719 _("Electrical Power for Devices with only one phase"),
11720 Tuple(
11721 help=_("Levels for the electrical power consumption of a device "),
11722 elements=[
11723 Integer(title=_("warning if at"), unit="Watt", default_value=300),
11724 Integer(title=_("critical if at"), unit="Watt", default_value=400),
11725 ]), None, "first")
11727 register_check_parameters(
11728 RulespecGroupCheckParametersEnvironment,
11729 "hw_temperature",
11730 _("Hardware temperature, multiple sensors"),
11731 Tuple(
11732 help=_("Temperature levels for hardware devices like "
11733 "Brocade switches with (potentially) several "
11734 "temperature sensors. Sensor IDs can be selected "
11735 "in the rule."),
11736 elements=[
11737 Integer(title=_("warning at"), unit=u"°C", default_value=35),
11738 Integer(title=_("critical at"), unit=u"°C", default_value=40),
11740 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
11741 "first",
11742 deprecated=True,
11745 register_check_parameters(
11746 RulespecGroupCheckParametersEnvironment,
11747 "hw_temperature_single",
11748 _("Hardware temperature, single sensor"),
11749 Tuple(
11750 help=_("Temperature levels for hardware devices like "
11751 "DELL Powerconnect that have just one temperature sensor. "),
11752 elements=[
11753 Integer(title=_("warning at"), unit=u"°C", default_value=35),
11754 Integer(title=_("critical at"), unit=u"°C", default_value=40),
11756 None,
11757 "first",
11758 deprecated=True,
11761 register_check_parameters(
11762 RulespecGroupCheckParametersEnvironment,
11763 "disk_temperature",
11764 _("Harddisk temperature (e.g. via SMART)"),
11765 Tuple(
11766 help=_("Temperature levels for hard disks, that is determined e.g. via SMART"),
11767 elements=[
11768 Integer(title=_("warning at"), unit=u"°C", default_value=35),
11769 Integer(title=_("critical at"), unit=u"°C", default_value=40),
11771 TextAscii(
11772 title=_("Hard disk device"),
11773 help=_("The identificator of the hard disk device, e.g. <tt>/dev/sda</tt>.")),
11774 "first",
11775 deprecated=True,
11778 register_check_parameters(
11779 RulespecGroupCheckParametersEnvironment, "eaton_enviroment",
11780 _("Temperature and Humidity for Eaton UPS"),
11781 Dictionary(elements=[
11782 ("temp",
11783 Tuple(
11784 title=_("Temperature"),
11785 elements=[
11786 Integer(title=_("warning at"), unit=u"°C", default_value=26),
11787 Integer(title=_("critical at"), unit=u"°C", default_value=30),
11788 ])),
11789 ("remote_temp",
11790 Tuple(
11791 title=_("Remote Temperature"),
11792 elements=[
11793 Integer(title=_("warning at"), unit=u"°C", default_value=26),
11794 Integer(title=_("critical at"), unit=u"°C", default_value=30),
11795 ])),
11796 ("humidity",
11797 Tuple(
11798 title=_("Humidity"),
11799 elements=[
11800 Integer(title=_("warning at"), unit=u"%", default_value=60),
11801 Integer(title=_("critical at"), unit=u"%", default_value=75),
11802 ])),
11803 ]), None, "dict")
11805 phase_elements = [
11806 ("voltage",
11807 Tuple(
11808 title=_("Voltage"),
11809 elements=[
11810 Integer(title=_("warning if below"), unit=u"V", default_value=210),
11811 Integer(title=_("critical if below"), unit=u"V", default_value=200),
11814 ("power",
11815 Tuple(
11816 title=_("Power"),
11817 elements=[
11818 Integer(title=_("warning at"), unit=u"W", default_value=1000),
11819 Integer(title=_("critical at"), unit=u"W", default_value=1200),
11822 ("appower",
11823 Tuple(
11824 title=_("Apparent Power"),
11825 elements=[
11826 Integer(title=_("warning at"), unit=u"VA", default_value=1100),
11827 Integer(title=_("critical at"), unit=u"VA", default_value=1300),
11830 ("current",
11831 Tuple(
11832 title=_("Current"),
11833 elements=[
11834 Integer(title=_("warning at"), unit=u"A", default_value=5),
11835 Integer(title=_("critical at"), unit=u"A", default_value=10),
11838 ("frequency",
11839 Tuple(
11840 title=_("Frequency"),
11841 elements=[
11842 Integer(title=_("warning if below"), unit=u"Hz", default_value=45),
11843 Integer(title=_("critical if below"), unit=u"Hz", default_value=40),
11844 Integer(title=_("warning if above"), unit=u"Hz", default_value=55),
11845 Integer(title=_("critical if above"), unit=u"Hz", default_value=60),
11848 ("differential_current_ac",
11849 Tuple(
11850 title=_("Differential current AC"),
11851 elements=[
11852 Float(title=_("warning at"), unit=u"mA", default_value=3.5),
11853 Float(title=_("critical at"), unit=u"mA", default_value=30),
11856 ("differential_current_dc",
11857 Tuple(
11858 title=_("Differential current DC"),
11859 elements=[
11860 Float(title=_("warning at"), unit=u"mA", default_value=70),
11861 Float(title=_("critical at"), unit=u"mA", default_value=100),
11866 register_check_parameters(
11867 RulespecGroupCheckParametersEnvironment, "ups_outphase",
11868 _("Parameters for output phases of UPSs and PDUs"),
11869 Dictionary(
11870 help=_("This rule allows you to specify levels for the voltage, current, load, power "
11871 "and apparent power of your device. The levels will only be applied if the device "
11872 "actually supplies values for these parameters."),
11873 elements=phase_elements + [
11874 ("load",
11875 Tuple(
11876 title=_("Load"),
11877 elements=[
11878 Integer(title=_("warning at"), unit=u"%", default_value=80),
11879 Integer(title=_("critical at"), unit=u"%", default_value=90),
11880 ])),
11881 ("map_device_states",
11882 ListOf(
11883 Tuple(elements=[TextAscii(size=10), MonitoringState()]),
11884 title=_("Map device state"),
11885 help=_("Here you can enter either device state number (eg. from SNMP devices) "
11886 "or exact device state name and the related monitoring state."),
11889 TextAscii(
11890 title=_("Output Name"),
11891 help=_("The name of the output, e.g. <tt>Phase 1</tt>/<tt>PDU 1</tt>")), "dict")
11893 register_check_parameters(
11894 RulespecGroupCheckParametersEnvironment, "el_inphase",
11895 _("Parameters for input phases of UPSs and PDUs"),
11896 Dictionary(
11897 help=_("This rule allows you to specify levels for the voltage, current, power "
11898 "and apparent power of your device. The levels will only be applied if the device "
11899 "actually supplies values for these parameters."),
11900 elements=phase_elements + [
11901 ("map_device_states",
11902 ListOf(
11903 Tuple(elements=[TextAscii(size=10), MonitoringState()]),
11904 title=_("Map device state"),
11905 help=_("Here you can enter either device state number (eg. from SNMP devices) "
11906 "or exact device state name and the related monitoring state."),
11909 ), TextAscii(title=_("Input Name"), help=_("The name of the input, e.g. <tt>Phase 1</tt>")),
11910 "dict")
11912 register_check_parameters(
11913 RulespecGroupCheckParametersEnvironment,
11914 "hw_fans",
11915 _("FAN speed of Hardware devices"),
11916 Dictionary(
11917 elements=[
11919 "lower",
11920 Tuple(
11921 help=_("Lower levels for the fan speed of a hardware device"),
11922 title=_("Lower levels"),
11923 elements=[
11924 Integer(title=_("warning if below"), unit=u"rpm"),
11925 Integer(title=_("critical if below"), unit=u"rpm"),
11929 "upper",
11930 Tuple(
11931 help=_("Upper levels for the fan speed of a hardware device"),
11932 title=_("Upper levels"),
11933 elements=[
11934 Integer(title=_("warning at"), unit=u"rpm", default_value=8000),
11935 Integer(title=_("critical at"), unit=u"rpm", default_value=8400),
11938 ("output_metrics",
11939 Checkbox(title=_("Performance data"), label=_("Enable performance data"))),
11941 optional_keys=["upper"],
11943 TextAscii(title=_("Fan Name"), help=_("The identificator of the fan.")),
11944 match_type="dict",
11947 register_check_parameters(
11948 RulespecGroupCheckParametersEnvironment,
11949 "hw_fans_perc",
11950 _("Fan speed of hardware devices (in percent)"),
11951 Dictionary(elements=[
11952 ("levels",
11953 Tuple(
11954 title=_("Upper fan speed levels"),
11955 elements=[
11956 Percentage(title=_("warning if at")),
11957 Percentage(title=_("critical if at")),
11958 ])),
11959 ("levels_lower",
11960 Tuple(
11961 title=_("Lower fan speed levels"),
11962 elements=[
11963 Percentage(title=_("warning if below")),
11964 Percentage(title=_("critical if below")),
11965 ])),
11967 TextAscii(title=_("Fan Name"), help=_("The identifier of the fan.")),
11968 "dict",
11971 register_check_parameters(
11972 RulespecGroupCheckParametersOperatingSystem,
11973 "pf_used_states",
11974 _("Number of used states of OpenBSD PF engine"),
11975 Dictionary(
11976 elements=[
11978 "used",
11979 Tuple(
11980 title=_("Limits for the number of used states"),
11981 elements=[
11982 Integer(title=_("warning at")),
11983 Integer(title=_("critical at")),
11987 optional_keys=[None],
11989 None,
11990 match_type="dict",
11993 register_check_parameters(
11994 RulespecGroupCheckParametersEnvironment,
11995 "pdu_gude",
11996 _("Levels for Gude PDU Devices"),
11997 Dictionary(elements=[
11998 ("kWh",
11999 Tuple(
12000 title=_("Total accumulated Active Energy of Power Channel"),
12001 elements=[
12002 Integer(title=_("warning at"), unit=_("kW")),
12003 Integer(title=_("critical at"), unit=_("kW")),
12004 ])),
12005 ("W",
12006 Tuple(
12007 title=_("Active Power"),
12008 elements=[
12009 Integer(title=_("warning at"), unit=_("W")),
12010 Integer(title=_("critical at"), unit=_("W")),
12011 ])),
12012 ("A",
12013 Tuple(
12014 title=_("Current on Power Channel"),
12015 elements=[
12016 Integer(title=_("warning at"), unit=_("A")),
12017 Integer(title=_("critical at"), unit=_("A")),
12018 ])),
12019 ("V",
12020 Tuple(
12021 title=_("Voltage on Power Channel"),
12022 elements=[
12023 Integer(title=_("warning if below"), unit=_("V")),
12024 Integer(title=_("critical if below"), unit=_("V")),
12025 ])),
12026 ("VA",
12027 Tuple(
12028 title=_("Line Mean Apparent Power"),
12029 elements=[
12030 Integer(title=_("warning at"), unit=_("VA")),
12031 Integer(title=_("critical at"), unit=_("VA")),
12032 ])),
12034 TextAscii(title=_("Phase Number"), help=_("The Number of the power Phase.")),
12035 match_type="dict",
12038 register_check_parameters(
12039 RulespecGroupCheckParametersEnvironment, "hostsystem_sensors", _("Hostsystem sensor alerts"),
12040 ListOf(
12041 Dictionary(
12042 help=_("This rule allows to override alert levels for the given sensor names."),
12043 elements=[
12044 ("name", TextAscii(title=_("Sensor name"))),
12045 ("states",
12046 Dictionary(
12047 title=_("Custom states"),
12048 elements=[(element,
12049 MonitoringState(
12050 title="Sensor %s" % description,
12051 label=_("Set state to"),
12052 default_value=int(element)))
12053 for (element, description) in [("0", _("OK")), (
12054 "1", _("WARNING")), ("2", _("CRITICAL")), ("3", _("UNKNOWN"))]],
12057 optional_keys=False),
12058 add_label=_("Add sensor name")), None, "first")
12060 register_check_parameters(
12061 RulespecGroupCheckParametersEnvironment, "netapp_instance", _("Netapp Instance State"),
12062 ListOf(
12063 Dictionary(
12064 help=_("This rule allows you to override netapp warnings"),
12065 elements=[("name", TextAscii(title=_("Warning starts with"))),
12066 ("state", MonitoringState(title="Set state to", default_value=1))],
12067 optional_keys=False),
12068 add_label=_("Add warning")), None, "first")
12070 register_check_parameters(
12071 RulespecGroupCheckParametersEnvironment,
12072 "temperature_auto",
12073 _("Temperature sensors with builtin levels"),
12074 None,
12075 TextAscii(title=_("Sensor ID"), help=_("The identificator of the thermal sensor.")),
12076 "first",
12077 deprecated=True,
12080 register_check_parameters(
12081 RulespecGroupCheckParametersEnvironment,
12082 "temperature_trends",
12083 _("Temperature trends for devices with builtin levels"),
12084 Dictionary(
12085 title=_("Temperature Trend Analysis"),
12086 help=_(
12087 "This rule enables and configures a trend analysis and corresponding limits for devices, "
12088 "which have their own limits configured on the device. It will only work for supported "
12089 "checks, right now the <tt>adva_fsp_temp</tt> check."),
12090 elements=[
12091 ("trend_range",
12092 Optional(
12093 Integer(
12094 title=_("Time range for temperature trend computation"),
12095 default_value=30,
12096 minvalue=5,
12097 unit=_("minutes")),
12098 title=_("Trend computation"),
12099 label=_("Enable trend computation"))),
12100 ("trend_c",
12101 Tuple(
12102 title=_("Levels on trends in degrees Celsius per time range"),
12103 elements=[
12104 Integer(title=_("Warning at"), unit=u"°C / " + _("range"), default_value=5),
12105 Integer(title=_("Critical at"), unit=u"°C / " + _("range"), default_value=10)
12106 ])),
12107 ("trend_timeleft",
12108 Tuple(
12109 title=_("Levels on the time left until limit is reached"),
12110 elements=[
12111 Integer(
12112 title=_("Warning if below"),
12113 unit=_("minutes"),
12114 default_value=240,
12116 Integer(
12117 title=_("Critical if below"),
12118 unit=_("minutes"),
12119 default_value=120,
12121 ])),
12123 TextAscii(title=_("Sensor ID"), help=_("The identifier of the thermal sensor.")),
12124 "dict",
12125 deprecated=True,
12127 ntp_params = Tuple(
12128 title=_("Thresholds for quality of time"),
12129 elements=[
12130 Integer(
12131 title=_("Critical at stratum"),
12132 default_value=10,
12133 help=_(
12134 "The stratum (\"distance\" to the reference clock) at which the check gets critical."
12137 Float(
12138 title=_("Warning at"),
12139 unit=_("ms"),
12140 default_value=200.0,
12141 help=_("The offset in ms at which a warning state is triggered."),
12143 Float(
12144 title=_("Critical at"),
12145 unit=_("ms"),
12146 default_value=500.0,
12147 help=_("The offset in ms at which a critical state is triggered."),
12151 register_check_parameters(
12152 RulespecGroupCheckParametersOperatingSystem, "ntp_time", _("State of NTP time synchronisation"),
12153 Transform(
12154 Dictionary(elements=[
12156 "ntp_levels",
12157 ntp_params,
12159 ("alert_delay",
12160 Tuple(
12161 title=_("Phases without synchronization"),
12162 elements=[
12163 Age(
12164 title=_("Warning at"),
12165 display=["hours", "minutes"],
12166 default_value=300,
12168 Age(
12169 title=_("Critical at"),
12170 display=["hours", "minutes"],
12171 default_value=3600,
12173 ])),
12175 forth=lambda params: isinstance(params, tuple) and {"ntp_levels": params} or params), None,
12176 "dict")
12178 register_check_parameters(RulespecGroupCheckParametersOperatingSystem, "ntp_peer",
12179 _("State of NTP peer"), ntp_params,
12180 TextAscii(title=_("Name of the peer")), "first")
12182 register_check_parameters(
12183 RulespecGroupCheckParametersEnvironment,
12184 "smoke",
12185 _("Smoke Detection"),
12186 Tuple(
12187 help=_("For devices which measure smoke in percent"),
12188 elements=[
12189 Percentage(title=_("Warning at"), allow_int=True, default_value=1),
12190 Percentage(title=_("Critical at"), allow_int=True, default_value=5),
12192 TextAscii(title=_("Sensor ID"), help=_("The identifier of the sensor.")),
12193 "first",
12196 register_check_parameters(
12197 RulespecGroupCheckParametersEnvironment,
12198 "apc_ats_output",
12199 _("APC Automatic Transfer Switch Output"),
12200 Dictionary(
12201 title=_("Levels for ATS Output parameters"),
12202 optional_keys=True,
12203 elements=[
12204 ("output_voltage_max",
12205 Tuple(
12206 title=_("Maximum Levels for Voltage"),
12207 elements=[
12208 Integer(title=_("Warning at"), unit="Volt"),
12209 Integer(title=_("Critical at"), unit="Volt"),
12210 ])),
12211 ("output_voltage_min",
12212 Tuple(
12213 title=_("Minimum Levels for Voltage"),
12214 elements=[
12215 Integer(title=_("Warning if below"), unit="Volt"),
12216 Integer(title=_("Critical if below"), unit="Volt"),
12217 ])),
12218 ("load_perc_max",
12219 Tuple(
12220 title=_("Maximum Levels for load in percent"),
12221 elements=[
12222 Percentage(title=_("Warning at")),
12223 Percentage(title=_("Critical at")),
12224 ])),
12225 ("load_perc_min",
12226 Tuple(
12227 title=_("Minimum Levels for load in percent"),
12228 elements=[
12229 Percentage(title=_("Warning if below")),
12230 Percentage(title=_("Critical if below")),
12231 ])),
12234 TextAscii(title=_("ID of phase")),
12235 "dict",
12238 register_check_parameters(
12239 RulespecGroupCheckParametersEnvironment,
12240 "airflow",
12241 _("Airflow levels"),
12242 Dictionary(
12243 title=_("Levels for airflow"),
12244 elements=[
12245 ("level_low",
12246 Tuple(
12247 title=_("Lower levels"),
12248 elements=[
12249 Float(
12250 title=_("Warning if below"),
12251 unit=_("l/s"),
12252 default_value=5.0,
12253 allow_int=True),
12254 Float(
12255 title=_("Critical if below"),
12256 unit=_("l/s"),
12257 default_value=2.0,
12258 allow_int=True)
12259 ])),
12260 ("level_high",
12261 Tuple(
12262 title=_("Upper levels"),
12263 elements=[
12264 Float(
12265 title=_("Warning at"), unit=_("l/s"), default_value=10.0, allow_int=True),
12266 Float(
12267 title=_("Critical at"), unit=_("l/s"), default_value=11.0, allow_int=True)
12268 ])),
12270 None,
12271 match_type="dict",
12274 register_check_parameters(
12275 RulespecGroupCheckParametersEnvironment,
12276 "ups_capacity",
12277 _("UPS Capacity"),
12278 Dictionary(
12279 title=_("Levels for battery parameters"),
12280 optional_keys=False,
12281 elements=[(
12282 "capacity",
12283 Tuple(
12284 title=_("Battery capacity"),
12285 elements=[
12286 Integer(
12287 title=_("Warning at"),
12288 help=
12289 _("The battery capacity in percent at and below which a warning state is triggered"
12291 unit="%",
12292 default_value=95,
12294 Integer(
12295 title=_("Critical at"),
12296 help=
12297 _("The battery capacity in percent at and below which a critical state is triggered"
12299 unit="%",
12300 default_value=90,
12306 "battime",
12307 Tuple(
12308 title=_("Time left on battery"),
12309 elements=[
12310 Integer(
12311 title=_("Warning at"),
12312 help=
12313 _("Time left on Battery at and below which a warning state is triggered"
12315 unit=_("min"),
12316 default_value=0,
12318 Integer(
12319 title=_("Critical at"),
12320 help=
12321 _("Time Left on Battery at and below which a critical state is triggered"
12323 unit=_("min"),
12324 default_value=0,
12330 None,
12331 match_type="dict",
12334 register_check_parameters(
12335 RulespecGroupCheckParametersApplications,
12336 "mbg_lantime_state",
12337 _("Meinberg Lantime State"),
12338 Dictionary(
12339 title=_("Meinberg Lantime State"),
12340 elements=[
12341 ("stratum",
12342 Tuple(
12343 title=_("Warning levels for Stratum"),
12344 elements=[
12345 Integer(
12346 title=_("Warning at"),
12347 default_value=2,
12349 Integer(
12350 title=_("Critical at"),
12351 default_value=3,
12353 ])),
12354 ("offset",
12355 Tuple(
12356 title=_("Warning levels for Time Offset"),
12357 elements=[
12358 Integer(
12359 title=_("Warning at"),
12360 unit=_("microseconds"),
12361 default_value=10,
12363 Integer(
12364 title=_("Critical at"),
12365 unit=_("microseconds"),
12366 default_value=20,
12368 ])),
12370 None,
12371 match_type="dict",
12374 register_check_parameters(
12375 RulespecGroupCheckParametersApplications, "sansymphony_pool", _("Sansymphony: pool allocation"),
12376 Tuple(
12377 help=_("This rule sets the warn and crit levels for the percentage of allocated pools"),
12378 elements=[
12379 Integer(
12380 title=_("Warning at"),
12381 unit=_("percent"),
12382 default_value=80,
12384 Integer(
12385 title=_("Critical at"),
12386 unit=_("percent"),
12387 default_value=90,
12389 ]), TextAscii(title=_("Name of the pool"),), "first")
12391 register_check_parameters(
12392 RulespecGroupCheckParametersApplications, "sansymphony_alerts",
12393 _("Sansymphony: Number of unacknowlegded alerts"),
12394 Tuple(
12395 help=_("This rule sets the warn and crit levels for the number of unacknowlegded alerts"),
12396 elements=[
12397 Integer(
12398 title=_("Warning at"),
12399 unit=_("alerts"),
12400 default_value=1,
12402 Integer(
12403 title=_("Critical at"),
12404 unit=_("alerts"),
12405 default_value=2,
12407 ]), None, "first")
12409 register_check_parameters(
12410 RulespecGroupCheckParametersApplications, "jvm_threads", _("JVM threads"),
12411 Tuple(
12412 help=_("This rule sets the warn and crit levels for the number of threads "
12413 "running in a JVM."),
12414 elements=[
12415 Integer(
12416 title=_("Warning at"),
12417 unit=_("threads"),
12418 default_value=80,
12420 Integer(
12421 title=_("Critical at"),
12422 unit=_("threads"),
12423 default_value=100,
12426 TextAscii(
12427 title=_("Name of the virtual machine"),
12428 help=_("The name of the application server"),
12429 allow_empty=False,
12430 ), "first")
12432 register_check_parameters(
12433 RulespecGroupCheckParametersApplications,
12434 "sym_brightmail_queues",
12435 "Symantec Brightmail Queues",
12436 Dictionary(
12437 help=_("This check is used to monitor successful email delivery through "
12438 "Symantec Brightmail Scanner appliances."),
12439 elements=[
12440 ("connections",
12441 Tuple(
12442 title=_("Number of connections"),
12443 elements=[
12444 Integer(title=_("Warning at")),
12445 Integer(title=_("Critical at")),
12446 ])),
12447 ("messageRate",
12448 Tuple(
12449 title=_("Number of messages delivered"),
12450 elements=[
12451 Integer(title=_("Warning at")),
12452 Integer(title=_("Critical at")),
12453 ])),
12454 ("dataRate",
12455 Tuple(
12456 title=_("Amount of data processed"),
12457 elements=[
12458 Integer(title=_("Warning at")),
12459 Integer(title=_("Cricital at")),
12460 ])),
12461 ("queuedMessages",
12462 Tuple(
12463 title=_("Number of messages currently queued"),
12464 elements=[
12465 Integer(title=_("Warning at")),
12466 Integer(title=_("Critical at")),
12467 ])),
12468 ("queueSize",
12469 Tuple(
12470 title=_("Size of the queue"),
12471 elements=[
12472 Integer(title=_("Warning at")),
12473 Integer(title=_("Critical at")),
12474 ])),
12475 ("deferredMessages",
12476 Tuple(
12477 title=_("Number of messages in deferred state"),
12478 elements=[
12479 Integer(title=_("Warning at")),
12480 Integer(title=_("Critical at")),
12481 ])),
12484 TextAscii(title=_("Instance name"), allow_empty=True),
12485 "dict",
12488 register_check_parameters(
12489 RulespecGroupCheckParametersApplications, "db2_logsize", _("DB2 logfile usage"),
12490 Dictionary(elements=[(
12491 "levels",
12492 Transform(
12493 get_free_used_dynamic_valuespec("free", "logfile", default_value=(20.0, 10.0)),
12494 title=_("Logfile levels"),
12495 allow_empty=False,
12496 forth=transform_filesystem_free,
12497 back=transform_filesystem_free))]),
12498 TextAscii(
12499 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
12500 "dict")
12502 register_check_parameters(
12503 RulespecGroupCheckParametersApplications,
12504 "db2_sortoverflow",
12505 _("DB2 Sort Overflow"),
12506 Dictionary(
12507 help=_("This rule allows you to set percentual limits for sort overflows."),
12508 elements=[
12510 "levels_perc",
12511 Tuple(
12512 title=_("Overflows"),
12513 elements=[
12514 Percentage(title=_("Warning at"), unit=_("%"), default_value=2.0),
12515 Percentage(title=_("Critical at"), unit=_("%"), default_value=4.0),
12520 TextAscii(
12521 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
12522 "dict",
12525 register_check_parameters(
12526 RulespecGroupCheckParametersApplications, "db2_tablespaces", _("DB2 Tablespaces"),
12527 Dictionary(
12528 help=_("A tablespace is a container for segments (tables, indexes, etc). A "
12529 "database consists of one or more tablespaces, each made up of one or "
12530 "more data files. Tables and indexes are created within a particular "
12531 "tablespace. "
12532 "This rule allows you to define checks on the size of tablespaces."),
12533 elements=db_levels_common,
12535 TextAscii(
12536 title=_("Instance"),
12537 help=_("The instance name, the database name and the tablespace name combined "
12538 "like this db2wps8:WPSCOMT8.USERSPACE1")), "dict")
12540 register_check_parameters(
12541 RulespecGroupCheckParametersApplications, "db2_connections", _("DB2 Connections"),
12542 Dictionary(
12543 help=_("This rule allows you to set limits for the maximum number of DB2 connections"),
12544 elements=[
12546 "levels_total",
12547 Tuple(
12548 title=_("Number of current connections"),
12549 elements=[
12550 Integer(title=_("Warning at"), unit=_("connections"), default_value=150),
12551 Integer(title=_("Critical at"), unit=_("connections"), default_value=200),
12556 TextAscii(
12557 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
12558 "dict")
12560 register_check_parameters(
12561 RulespecGroupCheckParametersApplications,
12562 "db2_counters",
12563 _("DB2 Counters"),
12564 Dictionary(
12565 help=_("This rule allows you to configure limits for the deadlocks and lockwaits "
12566 "counters of a DB2."),
12567 elements=[
12569 "deadlocks",
12570 Tuple(
12571 title=_("Deadlocks"),
12572 elements=[
12573 Float(title=_("Warning at"), unit=_("deadlocks/sec")),
12574 Float(title=_("Critical at"), unit=_("deadlocks/sec")),
12579 "lockwaits",
12580 Tuple(
12581 title=_("Lockwaits"),
12582 elements=[
12583 Float(title=_("Warning at"), unit=_("lockwaits/sec")),
12584 Float(title=_("Critical at"), unit=_("lockwaits/sec")),
12589 TextAscii(
12590 title=_("Instance"), help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")),
12591 "dict",
12594 register_check_parameters(
12595 RulespecGroupCheckParametersApplications, "db2_backup",
12596 _("DB2 Time since last database Backup"),
12597 Optional(
12598 Tuple(elements=[
12599 Age(title=_("Warning at"),
12600 display=["days", "hours", "minutes"],
12601 default_value=86400 * 14),
12602 Age(title=_("Critical at"),
12603 display=["days", "hours", "minutes"],
12604 default_value=86400 * 28)
12606 title=_("Specify time since last successful backup"),
12608 TextAscii(
12609 title=_("Instance"),
12610 help=_("DB2 instance followed by database name, e.g db2taddm:CMDBS1")), "first")
12612 register_check_parameters(
12613 RulespecGroupCheckParametersApplications, "db2_mem", _("Memory levels for DB2 memory usage"),
12614 Tuple(
12615 elements=[
12616 Percentage(title=_("Warning if less than"), unit=_("% memory left")),
12617 Percentage(title=_("Critical if less than"), unit=_("% memory left")),
12618 ],), TextAscii(title=_("Instance name"), allow_empty=True), "first")
12620 register_check_parameters(
12621 RulespecGroupCheckParametersApplications, "windows_updates", _("WSUS (Windows Updates)"),
12622 Tuple(
12623 title=_("Parameters for the Windows Update Check with WSUS"),
12624 help=_("Set the according numbers to 0 if you want to disable alerting."),
12625 elements=[
12626 Integer(title=_("Warning if at least this number of important updates are pending")),
12627 Integer(title=_("Critical if at least this number of important updates are pending")),
12628 Integer(title=_("Warning if at least this number of optional updates are pending")),
12629 Integer(title=_("Critical if at least this number of optional updates are pending")),
12630 Age(title=_("Warning if time until forced reboot is less then"), default_value=604800),
12631 Age(title=_("Critical if time time until forced reboot is less then"),
12632 default_value=172800),
12633 Checkbox(title=_("display all important updates verbosely"), default_value=True),
12635 ), None, "first")
12637 synology_update_states = [
12638 (1, "Available"),
12639 (2, "Unavailable"),
12640 (4, "Disconnected"),
12641 (5, "Others"),
12644 register_check_parameters(
12645 RulespecGroupCheckParametersApplications,
12646 "synology_update",
12647 _("Synology Updates"),
12648 Dictionary(
12649 title=_("Update State"),
12650 elements=[
12651 ("ok_states",
12652 ListChoice(
12653 title=_("States which result in OK"),
12654 choices=synology_update_states,
12655 default_value=[2])),
12656 ("warn_states",
12657 ListChoice(
12658 title=_("States which result in Warning"),
12659 choices=synology_update_states,
12660 default_value=[5])),
12661 ("crit_states",
12662 ListChoice(
12663 title=_("States which result in Critical"),
12664 choices=synology_update_states,
12665 default_value=[1, 4])),
12667 optional_keys=None,
12669 None,
12670 match_type="dict",
12673 register_check_parameters(
12674 RulespecGroupCheckParametersApplications, "antivir_update_age",
12675 _("Age of last AntiVirus update"),
12676 Tuple(
12677 title=_("Age of last AntiVirus update"),
12678 elements=[
12679 Age(title=_("Warning level for time since last update")),
12680 Age(title=_("Critical level for time since last update")),
12681 ]), None, "first")
12683 register_check_parameters(RulespecGroupCheckParametersApplications,
12684 "logwatch_ec",
12685 _('Logwatch Event Console Forwarding'),
12686 Alternative(
12687 title = _("Forwarding"),
12688 help = _("Instead of using the regular logwatch check all lines received by logwatch can "
12689 "be forwarded to a Check_MK event console daemon to be processed. The target event "
12690 "console can be configured for each host in a separate rule."),
12691 style = "dropdown",
12692 elements = [
12693 FixedValue(
12695 totext = _("Messages are handled by logwatch."),
12696 title = _("No forwarding"),
12698 Dictionary(
12699 title = _('Forward Messages to Event Console'),
12700 elements = [
12701 ('method', Transform(
12702 # TODO: Clean this up to some CascadingDropdown()
12703 Alternative(
12704 style = "dropdown",
12705 title = _("Forwarding Method"),
12706 elements = [
12707 FixedValue(
12709 title = _("Local: Send events to local Event Console in same OMD site"),
12710 totext = _("Directly forward to Event Console"),
12712 TextAscii(
12713 title = _("Local: Send events to local Event Console into unix socket"),
12714 allow_empty = False,
12717 FixedValue(
12718 "spool:",
12719 title = _("Local: Spooling - Send events to local event console in same OMD site"),
12720 totext = _("Spool to Event Console"),
12722 Transform(
12723 TextAscii(),
12724 title = _("Local: Spooling - Send events to local Event Console into given spool directory"),
12725 allow_empty = False,
12726 forth = lambda x: x[6:], # remove prefix
12727 back = lambda x: "spool:" + x, # add prefix
12729 CascadingDropdown(
12730 title = _("Remote: Send events to remote syslog host"),
12731 choices = [
12732 ("tcp", _("Send via TCP"), Dictionary(
12733 elements = [
12734 ("address", TextAscii(
12735 title = _("Address"),
12736 allow_empty = False,
12738 ("port", Integer(
12739 title = _("Port"),
12740 allow_empty = False,
12741 default_value = 514,
12742 minvalue = 1,
12743 maxvalue = 65535,
12744 size = 6,
12746 ("spool", Dictionary(
12747 title = _("Spool messages that could not be sent"),
12748 help = _("Messages that can not be forwarded, e.g. when the target Event Console is "
12749 "not running, can temporarily be stored locally. Forwarding is tried again "
12750 "on next execution. When messages are spooled, the check will go into WARNING "
12751 "state. In case messages are dropped by the rules below, the check will shortly "
12752 "go into CRITICAL state for this execution."),
12753 elements = [
12754 ("max_age", Age(
12755 title = _("Maximum spool duration"),
12756 help = _("Messages that are spooled longer than this time will be thrown away."),
12757 default_value = 60*60*24*7, # 1 week should be fine (if size is not exceeded)
12759 ("max_size", Filesize(
12760 title = _("Maximum spool size"),
12761 help = _("When the total size of spooled messages exceeds this number, the oldest "
12762 "messages of the currently spooled messages is thrown away until the left "
12763 "messages have the half of the maximum size."),
12764 default_value = 500000, # do not save more than 500k of message
12767 optional_keys = [],
12770 optional_keys = [ "spool" ],
12772 ("udp", _("Send via UDP"), Dictionary(
12773 elements = [
12774 ("address", TextAscii(
12775 title = _("Address"),
12776 allow_empty = False,
12778 ("port", Integer(
12779 title = _("Port"),
12780 allow_empty = False,
12781 default_value = 514,
12782 minvalue = 1,
12783 maxvalue = 65535,
12784 size = 6,
12787 optional_keys = [],
12792 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)))
12794 # migrate old (tcp, address, port) tuple to new dict
12795 forth = lambda v: (v[0], {"address": v[1], "port": v[2]}) if (isinstance(v, tuple) and not isinstance(v[1], dict)) else v,
12797 ('facility', DropdownChoice(
12798 title = _("Syslog facility for forwarded messages"),
12799 help = _("When forwarding messages and no facility can be extracted from the "
12800 "message this facility is used."),
12801 choices = mkeventd.syslog_facilities,
12802 default_value = 17, # local1
12804 ('restrict_logfiles',
12805 ListOfStrings(
12806 title = _('Restrict Logfiles (Prefix matching regular expressions)'),
12807 help = _("Put the item names of the logfiles here. For example \"System$\" "
12808 "to select the service \"LOG System\". You can use regular expressions "
12809 "which must match the beginning of the logfile name."),
12812 ('monitor_logfilelist',
12813 Checkbox(
12814 title = _("Monitoring of forwarded logfiles"),
12815 label = _("Warn if list of forwarded logfiles changes"),
12816 help = _("If this option is enabled, the check monitors the list of forwarded "
12817 "logfiles and will warn you if at any time a logfile is missing or exceeding "
12818 "when compared to the initial list that was snapshotted during service detection. "
12819 "Reinventorize this check in order to make it OK again."),
12822 ('expected_logfiles',
12823 ListOfStrings(
12824 title = _("List of expected logfiles"),
12825 help = _("When the monitoring of forwarded logfiles is enabled, the check verifies that "
12826 "all of the logfiles listed here are reported by the monitored system."),
12829 ('logwatch_reclassify',
12830 Checkbox(
12831 title = _("Reclassify messages before forwarding them to the EC"),
12832 label = _("Apply logwatch patterns"),
12833 help = _("If this option is enabled, the logwatch lines are first reclassified by the logwatch "
12834 "patterns before they are sent to the event console. If you reclassify specific lines to "
12835 "IGNORE they are not forwarded to the event console. This takes the burden from the "
12836 "event console to process the message itself through all of its rulesets. The reclassifcation "
12837 "of each line takes into account from which logfile the message originates. So you can create "
12838 "logwatch reclassification rules specifically designed for a logfile <i>access.log</i>, "
12839 "which do not apply to other logfiles."),
12842 ('separate_checks',
12843 Checkbox(
12844 title = _("Create a separate check for each logfile"),
12845 label = _("Separate check"),
12846 help = _("If this option is enabled, there will be one separate check for each logfile found during "
12847 "the service discovery. This option also changes the behaviour for unknown logfiles. "
12848 "The default logwatch check forwards all logfiles to the event console, even logfiles "
12849 "which were not known during the service discovery. Creating one check per logfile changes "
12850 "this behaviour so that any data from unknown logfiles is discarded."),
12854 optional_keys = ['restrict_logfiles', 'expected_logfiles', 'logwatch_reclassify', 'separate_checks'],
12857 default_value = '',
12859 None,
12860 'first',
12863 register_rule(
12864 RulespecGroupCheckParametersApplications,
12865 varname="logwatch_groups",
12866 title=_('Logfile Grouping Patterns'),
12867 help=_('The check <tt>logwatch</tt> normally creates one service for each logfile. '
12868 'By defining grouping patterns you can switch to the check <tt>logwatch.groups</tt>. '
12869 'If the pattern begins with a tilde then this pattern is interpreted as a regular '
12870 'expression instead of as a filename globbing pattern and <tt>*</tt> and <tt>?</tt> '
12871 'are treated differently. '
12872 'That check monitors a list of logfiles at once. This is useful if you have '
12873 'e.g. a folder with rotated logfiles where the name of the current logfile'
12874 'also changes with each rotation'),
12875 valuespec=ListOf(
12876 Tuple(
12877 help=_("This defines one logfile grouping pattern"),
12878 show_titles=True,
12879 orientation="horizontal",
12880 elements=[
12881 TextAscii(title=_("Name of group"),),
12882 Tuple(
12883 show_titles=True,
12884 orientation="vertical",
12885 elements=[
12886 TextAscii(title=_("Include Pattern")),
12887 TextAscii(title=_("Exclude Pattern"))
12892 add_label=_("Add pattern group"),
12894 match='all',
12897 register_rule(
12898 RulespecGroupCheckParametersNetworking,
12899 "if_disable_if64_hosts",
12900 title=_("Hosts forced to use <tt>if</tt> instead of <tt>if64</tt>"),
12901 help=_("A couple of switches with broken firmware report that they "
12902 "support 64 bit counters but do not output any actual data "
12903 "in those counters. Listing those hosts in this rule forces "
12904 "them to use the interface check with 32 bit counters instead."))
12906 # wmic_process does not support inventory at the moment
12907 register_check_parameters(
12908 RulespecGroupCheckParametersApplications, "wmic_process",
12909 _("Memory and CPU of processes on Windows"),
12910 Tuple(
12911 elements=[
12912 TextAscii(
12913 title=_("Name of the process"),
12914 allow_empty=False,
12916 Integer(title=_("Memory warning at"), unit="MB"),
12917 Integer(title=_("Memory critical at"), unit="MB"),
12918 Integer(title=_("Pagefile warning at"), unit="MB"),
12919 Integer(title=_("Pagefile critical at"), unit="MB"),
12920 Percentage(title=_("CPU usage warning at")),
12921 Percentage(title=_("CPU usage critical at")),
12922 ],),
12923 TextAscii(
12924 title=_("Process name for usage in the Nagios service description"), allow_empty=False),
12925 "first", False)
12928 # Add checks that have parameters but are only configured as manual checks
12929 def ps_convert_from_tuple(params):
12930 if isinstance(params, (list, tuple)):
12931 if len(params) == 5:
12932 procname, warnmin, okmin, okmax, warnmax = params
12933 user = None
12934 elif len(params) == 6:
12935 procname, user, warnmin, okmin, okmax, warnmax = params
12936 params = {
12937 "process": procname,
12938 "warnmin": warnmin,
12939 "okmin": okmin,
12940 "okmax": okmax,
12941 "warnmax": warnmax,
12943 if user is not None:
12944 params["user"] = user
12945 return params
12948 register_check_parameters(
12949 RulespecGroupCheckParametersOperatingSystem,
12950 "zypper",
12951 _("Zypper Updates"),
12952 None,
12953 None,
12954 match_type="first",
12957 register_check_parameters(
12958 RulespecGroupCheckParametersOperatingSystem,
12959 "apt",
12960 _("APT Updates"),
12961 Dictionary(elements=[
12962 ("normal",
12963 MonitoringState(
12964 title=_("State when normal updates are pending"),
12965 default_value=1,
12967 ("security",
12968 MonitoringState(
12969 title=_("State when security updates are pending"),
12970 default_value=2,
12973 None,
12974 match_type="dict",
12977 register_check_parameters(
12978 RulespecGroupCheckParametersEnvironment, "airflow_deviation", _("Airflow Deviation in Percent"),
12979 Tuple(
12980 help=_("Levels for Airflow Deviation measured at airflow sensors "),
12981 elements=[
12982 Float(title=_("critical if below or equal"), unit=u"%", default_value=-20),
12983 Float(title=_("warning if below or equal"), unit=u"%", default_value=-20),
12984 Float(title=_("warning if above or equal"), unit=u"%", default_value=20),
12985 Float(title=_("critical if above or equal"), unit=u"%", default_value=20),
12986 ]), TextAscii(title=_("Detector ID"), help=_("The identifier of the detector.")), "first")
12988 register_check_parameters(
12989 RulespecGroupCheckParametersApplications,
12990 "citrix_load",
12991 _("Load of Citrix Server"),
12992 Transform(
12993 Tuple(
12994 title=_("Citrix Server load"),
12995 elements=[
12996 Percentage(title=_("Warning at"), default_value=85.0, unit="percent"),
12997 Percentage(title=_("Critical at"), default_value=95.0, unit="percent"),
12999 forth=lambda x: (x[0] / 100.0, x[1] / 100.0),
13000 back=lambda x: (int(x[0] * 100), int(x[1] * 100))),
13001 None,
13002 match_type="first",
13005 register_check_parameters(
13006 RulespecGroupCheckParametersNetworking, "adva_ifs", _("Adva Optical Transport Laser Power"),
13007 Dictionary(elements=[
13008 ("limits_output_power",
13009 Tuple(
13010 title=_("Sending Power"),
13011 elements=[
13012 Float(title=_("lower limit"), unit="dBm"),
13013 Float(title=_("upper limit"), unit="dBm"),
13014 ])),
13015 ("limits_input_power",
13016 Tuple(
13017 title=_("Received Power"),
13018 elements=[
13019 Float(title=_("lower limit"), unit="dBm"),
13020 Float(title=_("upper limit"), unit="dBm"),
13021 ])),
13022 ]), TextAscii(
13023 title=_("Interface"),
13024 allow_empty=False,
13025 ), "dict")
13027 bluecat_operstates = [
13028 (1, "running normally"),
13029 (2, "not running"),
13030 (3, "currently starting"),
13031 (4, "currently stopping"),
13032 (5, "fault"),
13035 register_check_parameters(
13036 RulespecGroupCheckParametersNetworking,
13037 "bluecat_ntp",
13038 _("Bluecat NTP Settings"),
13039 Dictionary(elements=[
13040 ("oper_states",
13041 Dictionary(
13042 title=_("Operations States"),
13043 elements=[
13044 ("warning",
13045 ListChoice(
13046 title=_("States treated as warning"),
13047 choices=bluecat_operstates,
13048 default_value=[2, 3, 4],
13050 ("critical",
13051 ListChoice(
13052 title=_("States treated as critical"),
13053 choices=bluecat_operstates,
13054 default_value=[5],
13057 required_keys=['warning', 'critical'],
13059 ("stratum",
13060 Tuple(
13061 title=_("Levels for Stratum "),
13062 elements=[
13063 Integer(title=_("Warning at")),
13064 Integer(title=_("Critical at")),
13065 ])),
13067 None,
13068 match_type="dict",
13071 register_check_parameters(
13072 RulespecGroupCheckParametersNetworking,
13073 "bluecat_dhcp",
13074 _("Bluecat DHCP Settings"),
13075 Dictionary(
13076 elements=[
13077 ("oper_states",
13078 Dictionary(
13079 title=_("Operations States"),
13080 elements=[
13081 ("warning",
13082 ListChoice(
13083 title=_("States treated as warning"),
13084 choices=bluecat_operstates,
13085 default_value=[2, 3, 4],
13087 ("critical",
13088 ListChoice(
13089 title=_("States treated as critical"),
13090 choices=bluecat_operstates,
13091 default_value=[5],
13094 required_keys=['warning', 'critical'],
13097 required_keys=['oper_states'], # There is only one value, so its required
13099 None,
13100 match_type="dict",
13103 register_check_parameters(
13104 RulespecGroupCheckParametersNetworking,
13105 "bluecat_command_server",
13106 _("Bluecat Command Server Settings"),
13107 Dictionary(
13108 elements=[
13109 ("oper_states",
13110 Dictionary(
13111 title=_("Operations States"),
13112 elements=[
13113 ("warning",
13114 ListChoice(
13115 title=_("States treated as warning"),
13116 choices=bluecat_operstates,
13117 default_value=[2, 3, 4],
13119 ("critical",
13120 ListChoice(
13121 title=_("States treated as critical"),
13122 choices=bluecat_operstates,
13123 default_value=[5],
13126 required_keys=['warning', 'critical'],
13129 required_keys=['oper_states'], # There is only one value, so its required
13131 None,
13132 match_type="dict",
13135 register_check_parameters(
13136 RulespecGroupCheckParametersNetworking,
13137 "bluecat_dns",
13138 _("Bluecat DNS Settings"),
13139 Dictionary(
13140 elements=[
13141 ("oper_states",
13142 Dictionary(
13143 title=_("Operations States"),
13144 elements=[
13145 ("warning",
13146 ListChoice(
13147 title=_("States treated as warning"),
13148 choices=bluecat_operstates,
13149 default_value=[2, 3, 4],
13151 ("critical",
13152 ListChoice(
13153 title=_("States treated as critical"),
13154 choices=bluecat_operstates,
13155 default_value=[5],
13158 required_keys=['warning', 'critical'],
13161 required_keys=['oper_states'], # There is only one value, so its required
13163 None,
13164 match_type="dict",
13167 bluecat_ha_operstates = [
13168 (1, "standalone"),
13169 (2, "active"),
13170 (3, "passiv"),
13171 (4, "stopped"),
13172 (5, "stopping"),
13173 (6, "becoming active"),
13174 (7, "becomming passive"),
13175 (8, "fault"),
13178 register_check_parameters(
13179 RulespecGroupCheckParametersNetworking,
13180 "bluecat_ha",
13181 _("Bluecat HA Settings"),
13182 Dictionary(
13183 elements=[
13184 ("oper_states",
13185 Dictionary(
13186 title=_("Operations States"),
13187 elements=[
13189 "warning",
13190 ListChoice(
13191 title=_("States treated as warning"),
13192 choices=bluecat_ha_operstates,
13193 default_value=[5, 6, 7],
13197 "critical",
13198 ListChoice(
13199 title=_("States treated as critical"),
13200 choices=bluecat_ha_operstates,
13201 default_value=[8, 4],
13205 required_keys=['warning', 'critical'],
13208 required_keys=['oper_states'], # There is only one value, so its required
13210 None,
13211 match_type="dict",
13214 register_check_parameters(
13215 RulespecGroupCheckParametersNetworking,
13216 "steelhead_connections",
13217 _("Steelhead connections"),
13218 Dictionary(
13219 elements=[
13220 ("total",
13221 Tuple(
13222 title=_("Levels for total amount of connections"),
13223 elements=[
13224 Integer(title=_("Warning at")),
13225 Integer(title=_("Critical at")),
13228 ("optimized",
13229 Tuple(
13230 title=_("Levels for optimized connections"),
13231 elements=[
13232 Integer(title=_("Warning at")),
13233 Integer(title=_("Critical at")),
13236 ("passthrough",
13237 Tuple(
13238 title=_("Levels for passthrough connections"),
13239 elements=[
13240 Integer(title=_("Warning at")),
13241 Integer(title=_("Critical at")),
13244 ("halfOpened",
13245 Tuple(
13246 title=_("Levels for half opened connections"),
13247 elements=[
13248 Integer(title=_("Warning at")),
13249 Integer(title=_("Critical at")),
13252 ("halfClosed",
13253 Tuple(
13254 title=_("Levels for half closed connections"),
13255 elements=[
13256 Integer(title=_("Warning at")),
13257 Integer(title=_("Critical at")),
13260 ("established",
13261 Tuple(
13262 title=_("Levels for established connections"),
13263 elements=[
13264 Integer(title=_("Warning at")),
13265 Integer(title=_("Critical at")),
13268 ("active",
13269 Tuple(
13270 title=_("Levels for active connections"),
13271 elements=[
13272 Integer(title=_("Warning at")),
13273 Integer(title=_("Critical at")),
13276 ],),
13277 None,
13278 "dict",
13281 register_check_parameters(
13282 RulespecGroupCheckParametersStorage,
13283 "fc_port",
13284 _("FibreChannel Ports (FCMGMT MIB)"),
13285 Dictionary(elements=[
13286 ("bw",
13287 Alternative(
13288 title=_("Throughput levels"),
13289 help=_("Please note: in a few cases the automatic detection of the link speed "
13290 "does not work. In these cases you have to set the link speed manually "
13291 "below if you want to monitor percentage values"),
13292 elements=[
13293 Tuple(
13294 title=_("Used bandwidth of port relative to the link speed"),
13295 elements=[
13296 Percentage(title=_("Warning at"), unit=_("percent")),
13297 Percentage(title=_("Critical at"), unit=_("percent")),
13299 Tuple(
13300 title=_("Used Bandwidth of port in megabyte/s"),
13301 elements=[
13302 Integer(title=_("Warning at"), unit=_("MByte/s")),
13303 Integer(title=_("Critical at"), unit=_("MByte/s")),
13305 ])),
13306 ("assumed_speed",
13307 Float(
13308 title=_("Assumed link speed"),
13309 help=_("If the automatic detection of the link speed does "
13310 "not work you can set the link speed here."),
13311 unit=_("Gbit/s"))),
13312 ("rxcrcs",
13313 Tuple(
13314 title=_("CRC errors rate"),
13315 elements=[
13316 Percentage(title=_("Warning at"), unit=_("percent")),
13317 Percentage(title=_("Critical at"), unit=_("percent")),
13318 ])),
13319 ("rxencoutframes",
13320 Tuple(
13321 title=_("Enc-Out frames rate"),
13322 elements=[
13323 Percentage(title=_("Warning at"), unit=_("percent")),
13324 Percentage(title=_("Critical at"), unit=_("percent")),
13325 ])),
13326 ("notxcredits",
13327 Tuple(
13328 title=_("No-TxCredits errors"),
13329 elements=[
13330 Percentage(title=_("Warning at"), unit=_("percent")),
13331 Percentage(title=_("Critical at"), unit=_("percent")),
13332 ])),
13333 ("c3discards",
13334 Tuple(
13335 title=_("C3 discards"),
13336 elements=[
13337 Percentage(title=_("Warning at"), unit=_("percent")),
13338 Percentage(title=_("Critical at"), unit=_("percent")),
13339 ])),
13340 ("average",
13341 Integer(
13342 title=_("Averaging"),
13343 help=_("If this parameter is set, all throughputs will be averaged "
13344 "over the specified time interval before levels are being applied. Per "
13345 "default, averaging is turned off. "),
13346 unit=_("minutes"),
13347 minvalue=1,
13348 default_value=5,
13350 # ("phystate",
13351 # Optional(
13352 # ListChoice(
13353 # title = _("Allowed states (otherwise check will be critical)"),
13354 # choices = [ (1, _("unknown") ),
13355 # (2, _("failed") ),
13356 # (3, _("bypassed") ),
13357 # (4, _("active") ),
13358 # (5, _("loopback") ),
13359 # (6, _("txfault") ),
13360 # (7, _("nomedia") ),
13361 # (8, _("linkdown") ),
13363 # ),
13364 # title = _("Physical state of port") ,
13365 # negate = True,
13366 # label = _("ignore physical state"),
13368 # ),
13369 # ("opstate",
13370 # Optional(
13371 # ListChoice(
13372 # title = _("Allowed states (otherwise check will be critical)"),
13373 # choices = [ (1, _("unknown") ),
13374 # (2, _("unused") ),
13375 # (3, _("ready") ),
13376 # (4, _("warning") ),
13377 # (5, _("failure") ),
13378 # (6, _("not participating") ),
13379 # (7, _("initializing") ),
13380 # (8, _("bypass") ),
13381 # (9, _("ols") ),
13383 # ),
13384 # title = _("Operational state") ,
13385 # negate = True,
13386 # label = _("ignore operational state"),
13388 # ),
13389 # ("admstate",
13390 # Optional(
13391 # ListChoice(
13392 # title = _("Allowed states (otherwise check will be critical)"),
13393 # choices = [ (1, _("unknown") ),
13394 # (2, _("online") ),
13395 # (3, _("offline") ),
13396 # (4, _("bypassed") ),
13397 # (5, _("diagnostics") ),
13399 # ),
13400 # title = _("Administrative state") ,
13401 # negate = True,
13402 # label = _("ignore administrative state"),
13406 TextAscii(
13407 title=_("port name"),
13408 help=_("The name of the FC port"),
13410 match_type="dict",
13413 register_check_parameters(
13414 RulespecGroupCheckParametersEnvironment, "plug_count", _("Number of active Plugs"),
13415 Tuple(
13416 help=_("Levels for the number of active plugs in a device."),
13417 elements=[
13418 Integer(title=_("critical if below or equal"), default_value=30),
13419 Integer(title=_("warning if below or equal"), default_value=32),
13420 Integer(title=_("warning if above or equal"), default_value=38),
13421 Integer(title=_("critical if above or equal"), default_value=40),
13422 ]), None, "first")
13424 # Rules for configuring parameters of checks (services)
13425 register_check_parameters(
13426 RulespecGroupCheckParametersEnvironment, "ucs_bladecenter_chassis_voltage",
13427 _("UCS Bladecenter Chassis Voltage Levels"),
13428 Dictionary(
13429 help=_("Here you can configure the 3.3V and 12V voltage levels for each chassis."),
13430 elements=[
13431 ("levels_3v_lower",
13432 Tuple(
13433 title=_("3.3 Volt Output Lower Levels"),
13434 elements=[
13435 Float(title=_("warning if below or equal"), unit="V", default_value=3.25),
13436 Float(title=_("critical if below or equal"), unit="V", default_value=3.20),
13437 ])),
13438 ("levels_3v_upper",
13439 Tuple(
13440 title=_("3.3 Volt Output Upper Levels"),
13441 elements=[
13442 Float(title=_("warning if above or equal"), unit="V", default_value=3.4),
13443 Float(title=_("critical if above or equal"), unit="V", default_value=3.45),
13444 ])),
13445 ("levels_12v_lower",
13446 Tuple(
13447 title=_("12 Volt Output Lower Levels"),
13448 elements=[
13449 Float(title=_("warning if below or equal"), unit="V", default_value=11.9),
13450 Float(title=_("critical if below or equal"), unit="V", default_value=11.8),
13451 ])),
13452 ("levels_12v_upper",
13453 Tuple(
13454 title=_("12 Volt Output Upper Levels"),
13455 elements=[
13456 Float(title=_("warning if above or equal"), unit="V", default_value=12.1),
13457 Float(title=_("critical if above or equal"), unit="V", default_value=12.2),
13459 ]), TextAscii(title=_("Chassis"), help=_("The identifier of the chassis.")), "dict")
13461 register_check_parameters(
13462 RulespecGroupCheckParametersEnvironment, "hp_msa_psu_voltage",
13463 _("HP MSA Power Supply Voltage Levels"),
13464 Dictionary(
13465 help=_("Here you can configure the 3.3V and 12V voltage levels for each power supply."),
13466 elements=[
13467 ("levels_33v_lower",
13468 Tuple(
13469 title=_("3.3 Volt Output Lower Levels"),
13470 elements=[
13471 Float(title=_("warning if below or equal"), unit="V", default_value=3.25),
13472 Float(title=_("critical if below or equal"), unit="V", default_value=3.20),
13473 ])),
13474 ("levels_33v_upper",
13475 Tuple(
13476 title=_("3.3 Volt Output Upper Levels"),
13477 elements=[
13478 Float(title=_("warning if above or equal"), unit="V", default_value=3.4),
13479 Float(title=_("critical if above or equal"), unit="V", default_value=3.45),
13480 ])),
13481 ("levels_5v_lower",
13482 Tuple(
13483 title=_("5 Volt Output Lower Levels"),
13484 elements=[
13485 Float(title=_("warning if below or equal"), unit="V", default_value=3.25),
13486 Float(title=_("critical if below or equal"), unit="V", default_value=3.20),
13487 ])),
13488 ("levels_5v_upper",
13489 Tuple(
13490 title=_("5 Volt Output Upper Levels"),
13491 elements=[
13492 Float(title=_("warning if above or equal"), unit="V", default_value=3.4),
13493 Float(title=_("critical if above or equal"), unit="V", default_value=3.45),
13494 ])),
13495 ("levels_12v_lower",
13496 Tuple(
13497 title=_("12 Volt Output Lower Levels"),
13498 elements=[
13499 Float(title=_("warning if below or equal"), unit="V", default_value=11.9),
13500 Float(title=_("critical if below or equal"), unit="V", default_value=11.8),
13501 ])),
13502 ("levels_12v_upper",
13503 Tuple(
13504 title=_("12 Volt Output Upper Levels"),
13505 elements=[
13506 Float(title=_("warning if above or equal"), unit="V", default_value=12.1),
13507 Float(title=_("critical if above or equal"), unit="V", default_value=12.2),
13509 ]), TextAscii(title=_("Power Supply name"), help=_("The identifier of the power supply.")),
13510 "dict")
13512 register_check_parameters(
13513 RulespecGroupCheckParametersApplications, "jvm_gc", _("JVM garbage collection levels"),
13514 Dictionary(
13515 help=_("This ruleset also covers Tomcat, Jolokia and JMX. "),
13516 elements=[
13517 ("CollectionTime",
13518 Alternative(
13519 title=_("Collection time levels"),
13520 elements=[
13521 Tuple(
13522 title=_("Time of garbage collection in ms per minute"),
13523 elements=[
13524 Integer(title=_("Warning at"), unit=_("ms"), allow_empty=False),
13525 Integer(title=_("Critical at"), unit=_("ms"), allow_empty=False),
13527 ])),
13528 ("CollectionCount",
13529 Alternative(
13530 title=_("Collection count levels"),
13531 elements=[
13532 Tuple(
13533 title=_("Count of garbage collection per minute"),
13534 elements=[
13535 Integer(title=_("Warning at"), allow_empty=False),
13536 Integer(title=_("Critical at"), allow_empty=False),
13538 ])),
13540 TextAscii(
13541 title=_("Name of the virtual machine and/or<br>garbage collection type"),
13542 help=_("The name of the application server"),
13543 allow_empty=False,
13544 ), "dict")
13546 register_check_parameters(
13547 RulespecGroupCheckParametersApplications, "jvm_tp", _("JVM tomcat threadpool levels"),
13548 Dictionary(
13549 help=_("This ruleset also covers Tomcat, Jolokia and JMX. "),
13550 elements=[
13551 ("currentThreadCount",
13552 Alternative(
13553 title=_("Current thread count levels"),
13554 elements=[
13555 Tuple(
13556 title=_("Percentage levels of current thread count in threadpool"),
13557 elements=[
13558 Integer(title=_("Warning at"), unit=_(u"%"), allow_empty=False),
13559 Integer(title=_("Critical at"), unit=_(u"%"), allow_empty=False),
13561 ])),
13562 ("currentThreadsBusy",
13563 Alternative(
13564 title=_("Current threads busy levels"),
13565 elements=[
13566 Tuple(
13567 title=_("Percentage of current threads busy in threadpool"),
13568 elements=[
13569 Integer(title=_("Warning at"), unit=_(u"%"), allow_empty=False),
13570 Integer(title=_("Critical at"), unit=_(u"%"), allow_empty=False),
13572 ])),
13574 TextAscii(
13575 title=_("Name of the virtual machine and/or<br>threadpool"),
13576 help=_("The name of the application server"),
13577 allow_empty=False,
13578 ), "dict")
13580 register_check_parameters(
13581 RulespecGroupCheckParametersApplications, "docker_node_containers",
13582 _("Docker node container levels"),
13583 Dictionary(
13584 help=_(
13585 "Allows to define absolute levels for all, running, paused, and stopped containers."),
13586 elements=[
13587 ("upper_levels",
13588 Tuple(
13589 title=_("Containers upper levels"),
13590 elements=[
13591 Integer(title=_("Warning at"), allow_empty=False),
13592 Integer(title=_("Critical at"), allow_empty=False),
13593 ])),
13594 ("lower_levels",
13595 Tuple(
13596 title=_("Containers lower levels"),
13597 elements=[
13598 Integer(title=_("Warning at"), allow_empty=False),
13599 Integer(title=_("Critical at"), allow_empty=False),
13600 ])),
13601 ("running_upper_levels",
13602 Tuple(
13603 title=_("Running containers upper levels"),
13604 elements=[
13605 Integer(title=_("Warning at"), allow_empty=False),
13606 Integer(title=_("Critical at"), allow_empty=False),
13607 ])),
13608 ("running_lower_levels",
13609 Tuple(
13610 title=_("Running containers lower levels"),
13611 elements=[
13612 Integer(title=_("Warning at"), allow_empty=False),
13613 Integer(title=_("Critical at"), allow_empty=False),
13614 ])),
13615 ("paused_upper_levels",
13616 Tuple(
13617 title=_("Paused containers upper levels"),
13618 elements=[
13619 Integer(title=_("Warning at"), allow_empty=False),
13620 Integer(title=_("Critical at"), allow_empty=False),
13621 ])),
13622 ("paused_lower_levels",
13623 Tuple(
13624 title=_("Paused containers lower levels"),
13625 elements=[
13626 Integer(title=_("Warning at"), allow_empty=False),
13627 Integer(title=_("Critical at"), allow_empty=False),
13628 ])),
13629 ("stopped_upper_levels",
13630 Tuple(
13631 title=_("Stopped containers upper levels"),
13632 elements=[
13633 Integer(title=_("Warning at"), allow_empty=False),
13634 Integer(title=_("Critical at"), allow_empty=False),
13635 ])),
13636 ("stopped_lower_levels",
13637 Tuple(
13638 title=_("Stopped containers lower levels"),
13639 elements=[
13640 Integer(title=_("Warning at"), allow_empty=False),
13641 Integer(title=_("Critical at"), allow_empty=False),
13642 ])),
13643 ]), None, "dict")
13645 register_check_parameters(
13646 RulespecGroupCheckParametersApplications, "docker_node_disk_usage", _("Docker node disk usage"),
13647 Dictionary(
13648 help=
13649 _("Allows to define levels for the counts and size of Docker Containers, Images, Local Volumes, and the Build Cache."
13651 elements=[
13652 ("size",
13653 Tuple(
13654 title=_("Size"),
13655 elements=[
13656 Filesize(title=_("Warning at"), allow_empty=False),
13657 Filesize(title=_("Critical at"), allow_empty=False),
13658 ])),
13659 ("reclaimable",
13660 Tuple(
13661 title=_("Reclaimable"),
13662 elements=[
13663 Filesize(title=_("Warning at"), allow_empty=False),
13664 Filesize(title=_("Critical at"), allow_empty=False),
13665 ])),
13666 ("count",
13667 Tuple(
13668 title=_("Total count"),
13669 elements=[
13670 Integer(title=_("Warning at"), allow_empty=False),
13671 Integer(title=_("Critical at"), allow_empty=False),
13672 ])),
13673 ("active",
13674 Tuple(
13675 title=_("Active"),
13676 elements=[
13677 Integer(title=_("Warning at"), allow_empty=False),
13678 Integer(title=_("Critical at"), allow_empty=False),
13679 ])),
13681 TextAscii(
13682 title=_("Type"),
13683 help=_("Either Containers, Images, Local Volumes or Build Cache"),
13684 allow_empty=True,
13685 ), "dict")
13687 register_check_parameters(
13688 RulespecGroupCheckParametersStorage,
13689 "heartbeat_crm",
13690 _("Heartbeat CRM general status"),
13691 Tuple(elements=[
13692 Integer(
13693 title=_("Maximum age"),
13694 help=_("Maximum accepted age of the reported data in seconds"),
13695 unit=_("seconds"),
13696 default_value=60,
13698 Optional(
13699 TextAscii(allow_empty=False),
13700 title=_("Expected DC"),
13701 help=_("The hostname of the expected distinguished controller of the cluster"),
13703 Optional(
13704 Integer(min_value=2, default_value=2),
13705 title=_("Number of Nodes"),
13706 help=_("The expected number of nodes in the cluster"),
13708 Optional(
13709 Integer(min_value=0,),
13710 title=_("Number of Resources"),
13711 help=_("The expected number of resources in the cluster"),
13714 None,
13715 match_type="first",
13718 register_check_parameters(
13719 RulespecGroupCheckParametersStorage, "heartbeat_crm_resources",
13720 _("Heartbeat CRM resource status"),
13721 Optional(
13722 TextAscii(allow_empty=False),
13723 title=_("Expected node"),
13724 help=_("The hostname of the expected node to hold this resource."),
13725 none_label=_("Do not enforce the resource to be hold by a specific node."),
13727 TextAscii(
13728 title=_("Resource Name"),
13729 help=_("The name of the cluster resource as shown in the service description."),
13730 allow_empty=False,
13731 ), "first")
13733 register_check_parameters(
13734 RulespecGroupCheckParametersApplications,
13735 "domino_tasks",
13736 _("Lotus Domino Tasks"),
13737 Dictionary(
13738 elements=[
13740 "process",
13741 Alternative(
13742 title=_("Name of the task"),
13743 style="dropdown",
13744 elements=[
13745 TextAscii(
13746 title=_("Exact name of the task"),
13747 size=50,
13749 Transform(
13750 RegExp(
13751 size=50,
13752 mode=RegExp.prefix,
13754 title=_("Regular expression matching tasks"),
13755 help=_("This regex must match the <i>beginning</i> of the complete "
13756 "command line of the task including arguments"),
13757 forth=lambda x: x[1:], # remove ~
13758 back=lambda x: "~" + x, # prefix ~
13760 FixedValue(
13761 None,
13762 totext="",
13763 title=_("Match all tasks"),
13766 match=lambda x: (not x and 2) or (x[0] == '~' and 1 or 0))),
13767 ("warnmin",
13768 Integer(
13769 title=_("Minimum number of matched tasks for WARNING state"),
13770 default_value=1,
13772 ("okmin",
13773 Integer(
13774 title=_("Minimum number of matched tasks for OK state"),
13775 default_value=1,
13777 ("okmax",
13778 Integer(
13779 title=_("Maximum number of matched tasks for OK state"),
13780 default_value=99999,
13782 ("warnmax",
13783 Integer(
13784 title=_("Maximum number of matched tasks for WARNING state"),
13785 default_value=99999,
13788 required_keys=['warnmin', 'okmin', 'okmax', 'warnmax', 'process'],
13790 TextAscii(
13791 title=_("Name of service"),
13792 help=_("This name will be used in the description of the service"),
13793 allow_empty=False,
13794 regex="^[a-zA-Z_0-9 _.-]*$",
13795 regex_error=_("Please use only a-z, A-Z, 0-9, space, underscore, "
13796 "dot and hyphen for your service description"),
13798 match_type="dict",
13799 has_inventory=False)
13801 register_check_parameters(
13802 RulespecGroupCheckParametersApplications,
13803 "domino_mailqueues",
13804 _("Lotus Domino Mail Queues"),
13805 Dictionary(
13806 elements=[
13807 ("queue_length",
13808 Tuple(
13809 title=_("Number of Mails in Queue"),
13810 elements=[
13811 Integer(title=_("warning at"), default_value=300),
13812 Integer(title=_("critical at"), default_value=350),
13813 ])),
13815 required_keys=['queue_length'],
13817 DropdownChoice(
13818 choices=[
13819 ('lnDeadMail', _('Mails in Dead Queue')),
13820 ('lnWaitingMail', _('Mails in Waiting Queue')),
13821 ('lnMailHold', _('Mails in Hold Queue')),
13822 ('lnMailTotalPending', _('Total Pending Mails')),
13823 ('InMailWaitingforDNS', _('Mails Waiting for DNS Queue')),
13825 title=_("Domino Mail Queue Names"),
13827 match_type="dict",
13830 register_check_parameters(
13831 RulespecGroupCheckParametersApplications,
13832 "domino_users",
13833 _("Lotus Domino Users"),
13834 Tuple(
13835 title=_("Number of Lotus Domino Users"),
13836 elements=[
13837 Integer(title=_("warning at"), default_value=1000),
13838 Integer(title=_("critical at"), default_value=1500),
13840 None,
13841 match_type="first",
13844 register_check_parameters(
13845 RulespecGroupCheckParametersApplications,
13846 "domino_transactions",
13847 _("Lotus Domino Transactions"),
13848 Tuple(
13849 title=_("Number of Transactions per Minute on a Lotus Domino Server"),
13850 elements=[
13851 Integer(title=_("warning at"), default_value=30000),
13852 Integer(title=_("critical at"), default_value=35000),
13854 None,
13855 match_type="first",
13858 register_check_parameters(
13859 RulespecGroupCheckParametersApplications, "netscaler_dnsrates",
13860 _("Citrix Netscaler DNS counter rates"),
13861 Dictionary(
13862 help=_("Counter rates of DNS parameters for Citrix Netscaler Loadbalancer "
13863 "Appliances"),
13864 elements=[
13866 "query",
13867 Tuple(
13868 title=_("Upper Levels for Total Number of DNS queries"),
13869 elements=[
13870 Float(title=_("Warning at"), default_value=1500.0, unit="/sec"),
13871 Float(title=_("Critical at"), default_value=2000.0, unit="/sec")
13876 "answer",
13877 Tuple(
13878 title=_("Upper Levels for Total Number of DNS replies"),
13879 elements=[
13880 Float(title=_("Warning at"), default_value=1500.0, unit="/sec"),
13881 Float(title=_("Critical at"), default_value=2000.0, unit="/sec")
13885 ]), None, "dict")
13887 register_check_parameters(
13888 RulespecGroupCheckParametersApplications, "netscaler_tcp_conns",
13889 _("Citrix Netscaler Loadbalancer TCP Connections"),
13890 Dictionary(elements=[
13892 "client_conns",
13893 Tuple(
13894 title=_("Max. number of client connections"),
13895 elements=[
13896 Integer(
13897 title=_("Warning at"),
13898 default_value=25000,
13900 Integer(
13901 title=_("Critical at"),
13902 default_value=30000,
13907 "server_conns",
13908 Tuple(
13909 title=_("Max. number of server connections"),
13910 elements=[
13911 Integer(
13912 title=_("Warning at"),
13913 default_value=25000,
13915 Integer(
13916 title=_("Critical at"),
13917 default_value=30000,
13921 ]), None, "dict")
13923 register_check_parameters(
13924 RulespecGroupCheckParametersApplications,
13925 "netscaler_sslcerts",
13926 _("Citrix Netscaler SSL certificates"),
13927 Dictionary(
13928 elements=[
13930 'age_levels',
13931 Tuple(
13932 title=_("Remaining days of validity"),
13933 elements=[
13934 Integer(title=_("Warning below"), default_value=30, min_value=0),
13935 Integer(title=_("Critical below"), default_value=10, min_value=0),
13939 ],),
13940 TextAscii(title=_("Name of Certificate"),),
13941 match_type="dict")
13943 register_check_parameters(
13944 RulespecGroupCheckParametersEnvironment,
13945 "siemens_plc_flag",
13946 _("State of Siemens PLC Flags"),
13947 DropdownChoice(
13948 help=_("This rule sets the expected state, the one which should result in an OK state, "
13949 "of the monitored flags of Siemens PLC devices."),
13950 title=_("Expected flag state"),
13951 choices=[
13952 (True, _("Expect the flag to be: On")),
13953 (False, _("Expect the flag to be: Off")),
13955 default_value=True),
13956 TextAscii(
13957 title=_("Device Name and Value Ident"),
13958 help=_("You need to concatenate the device name which is configured in the special agent "
13959 "for the PLC device separated by a space with the ident of the value which is also "
13960 "configured in the special agent."),
13961 allow_empty=True),
13962 match_type="first",
13965 register_check_parameters(
13966 RulespecGroupCheckParametersEnvironment,
13967 "siemens_plc_duration",
13968 _("Siemens PLC Duration"),
13969 Dictionary(
13970 elements=[
13971 ('duration',
13972 Tuple(
13973 title=_("Duration"),
13974 elements=[
13975 Age(title=_("Warning at"),),
13976 Age(title=_("Critical at"),),
13977 ])),
13979 help=_("This rule is used to configure thresholds for duration values read from "
13980 "Siemens PLC devices."),
13981 title=_("Duration levels"),
13983 TextAscii(
13984 title=_("Device Name and Value Ident"),
13985 help=_("You need to concatenate the device name which is configured in the special agent "
13986 "for the PLC device separated by a space with the ident of the value which is also "
13987 "configured in the special agent."),
13989 match_type="dict",
13992 register_check_parameters(
13993 RulespecGroupCheckParametersEnvironment,
13994 "siemens_plc_counter",
13995 _("Siemens PLC Counter"),
13996 Dictionary(
13997 elements=[
13998 ('levels',
13999 Tuple(
14000 title=_("Counter level"),
14001 elements=[
14002 Integer(title=_("Warning at"),),
14003 Integer(title=_("Critical at"),),
14004 ])),
14006 help=_("This rule is used to configure thresholds for counter values read from "
14007 "Siemens PLC devices."),
14008 title=_("Counter levels"),
14010 TextAscii(
14011 title=_("Device Name and Value Ident"),
14012 help=_("You need to concatenate the device name which is configured in the special agent "
14013 "for the PLC device separated by a space with the ident of the value which is also "
14014 "configured in the special agent."),
14016 match_type="dict",
14019 register_check_parameters(
14020 RulespecGroupCheckParametersStorage, "bossock_fibers", _("Number of Running Bossock Fibers"),
14021 Tuple(
14022 title=_("Number of fibers"),
14023 elements=[
14024 Integer(title=_("Warning at"), unit=_("fibers")),
14025 Integer(title=_("Critical at"), unit=_("fibers")),
14026 ]), TextAscii(title=_("Node ID")), "first")
14028 register_check_parameters(
14029 RulespecGroupCheckParametersEnvironment, "carbon_monoxide", ("Carbon monoxide"),
14030 Dictionary(elements=[
14031 ("levels_ppm",
14032 Tuple(
14033 title="Levels in parts per million",
14034 elements=[
14035 Integer(title=_("Warning at"), unit=_("ppm"), default=10),
14036 Integer(title=_("Critical at"), unit=_("ppm"), default=25),
14037 ])),
14038 ]), None, "dict")