Beispiel #1
0
def _parameter_valuespec_mobileiron_versions():
    return Dictionary(
        title=_("Mobileiron versions parameters"),
        elements=[
            (
                "ios_version_regexp",
                RegExp(
                    title=_("iOS version regular expression"),
                    mode=RegExp.infix,
                    help=
                    _("iOS versions matching this pattern will be reported as OK, else CRIT."
                      ),
                ),
            ),
            (
                "android_version_regexp",
                RegExp(
                    title=_("Android version regular expression"),
                    mode=RegExp.infix,
                    help=
                    _("Android versions matching this pattern will be reported as OK, else CRIT."
                      ),
                ),
            ),
            (
                "os_version_other",
                MonitoringState(
                    default_value=0,
                    title=
                    _("State in case of the checked device is neither Android nor iOS (or cannot be read)"
                      ),
                ),
            ),
            (
                "patchlevel_unparsable",
                MonitoringState(
                    default_value=0,
                    title=_("State in case of unparsable patch level")),
            ),
            (
                "patchlevel_age",
                Age(
                    title=_("Acceptable patch level age"),
                    display=["days"],
                    # three months
                    default_value=int(60 * 60 * 24 * 30 * 3),
                    minvalue=1,
                ),
            ),
            (
                "os_build_unparsable",
                MonitoringState(
                    default_value=0,
                    title=_("State in case of unparsable OS build")),
            ),
            (
                "os_age",
                Age(
                    title=_("Acceptable OS build version age"),
                    display=["days"],
                    # three months
                    default_value=int(60 * 60 * 24 * 30 * 3),
                    minvalue=1,
                ),
            ),
        ],
        optional_keys=[],
    )
Beispiel #2
0
def _parameter_valuespec_drbd():
    return Dictionary(
        ignored_keys=[
            'roles_inventory',
            'diskstates_inventory',
        ],
        elements=[
            ("roles",
             Alternative(
                 title=_("Roles"),
                 elements=[
                     FixedValue(None, totext="", title=_("Do not monitor")),
                     ListOf(Tuple(
                         orientation="horizontal",
                         elements=[
                             DropdownChoice(
                                 title=_("DRBD shows up as"),
                                 default_value="running",
                                 choices=[("primary_secondary",
                                           _("Primary / Secondary")),
                                          ("primary_primary",
                                           _("Primary / Primary")),
                                          ("secondary_primary",
                                           _("Secondary / Primary")),
                                          ("secondary_secondary",
                                           _("Secondary / Secondary"))],
                             ),
                             MonitoringState(title=_("Resulting state"), ),
                         ],
                         default_value=("ignore", 0)),
                            title=_("Set roles"),
                            add_label=_("Add role rule"))
                 ],
             )),
            (
                "diskstates",
                Alternative(
                    title=_("Diskstates"),
                    elements=[
                        FixedValue(None, totext="", title=_("Do not monitor")),
                        ListOf(Tuple(
                            elements=[
                                DropdownChoice(
                                    title=_("Diskstate"),
                                    choices=[
                                        ("primary_Diskless",
                                         _("Primary - Diskless")),
                                        ("primary_Attaching",
                                         _("Primary - Attaching")),
                                        ("primary_Failed",
                                         _("Primary - Failed")),
                                        ("primary_Negotiating",
                                         _("Primary - Negotiating")),
                                        ("primary_Inconsistent",
                                         _("Primary - Inconsistent")),
                                        ("primary_Outdated",
                                         _("Primary - Outdated")),
                                        ("primary_DUnknown",
                                         _("Primary - DUnknown")),
                                        ("primary_Consistent",
                                         _("Primary - Consistent")),
                                        ("primary_UpToDate",
                                         _("Primary - UpToDate")),
                                        ("secondary_Diskless",
                                         _("Secondary - Diskless")),
                                        ("secondary_Attaching",
                                         _("Secondary - Attaching")),
                                        ("secondary_Failed",
                                         _("Secondary - Failed")),
                                        ("secondary_Negotiating",
                                         _("Secondary - Negotiating")),
                                        ("secondary_Inconsistent",
                                         _("Secondary - Inconsistent")),
                                        ("secondary_Outdated",
                                         _("Secondary - Outdated")),
                                        ("secondary_DUnknown",
                                         _("Secondary - DUnknown")),
                                        ("secondary_Consistent",
                                         _("Secondary - Consistent")),
                                        ("secondary_UpToDate",
                                         _("Secondary - UpToDate")),
                                    ],
                                ),
                                MonitoringState(title=_("Resulting state"))
                            ],
                            orientation="horizontal",
                        ),
                               title=_("Set diskstates"),
                               add_label=_("Add diskstate rule"))
                    ],
                ),
            )
        ],
    )
Beispiel #3
0
def _parameter_valuespec_if():
    # Transform old traffic related levels which used "traffic" and "traffic_minimum"
    # keys where each was configured with an Alternative valuespec
    return Transform(
        Dictionary(
            ignored_keys=[
                "aggregate",
                "discovered_oper_status",
                "discovered_admin_status",
                "discovered_speed",
            ],  # Created by discovery
            elements=[
                ("errors_in", _vs_if_errors("IN")),
                ("errors_out", _vs_if_errors("OUT")),
                ("speed",
                 OptionalDropdownChoice(
                     title=_("Operating speed"),
                     help=
                     _("If you use this parameter then the check goes warning if the "
                       "interface is not operating at the expected speed (e.g. it "
                       "is working with 100Mbit/s instead of 1Gbit/s.<b>Note:</b> "
                       "some interfaces do not provide speed information. In such cases "
                       "this setting is used as the assumed speed when it comes to "
                       "traffic monitoring (see below)."),
                     choices=[
                         (None, _("ignore speed")),
                         (10000000, "10 Mbit/s"),
                         (100000000, "100 Mbit/s"),
                         (1000000000, "1 Gbit/s"),
                         (10000000000, "10 Gbit/s"),
                     ],
                     otherlabel=_("specify manually ->"),
                     explicit=Integer(
                         title=_("Other speed in bits per second"),
                         label=_("Bits per second")))),
                ("state",
                 Optional(
                     ListChoice(
                         title=_("Allowed operational states:"),
                         choices=defines.interface_oper_states(),
                         allow_empty=False,
                     ),
                     title=_("Operational state"),
                     help=
                     _("If you activate the monitoring of the operational state "
                       "(<tt>ifOperStatus</tt>), the check will go critical if the current "
                       "state of the interface does not match one of the expected states."
                       ),
                     label=_("Ignore the operational state"),
                     none_label=_("ignore"),
                     negate=True)),
                ("map_operstates",
                 ListOf(
                     Tuple(orientation="horizontal",
                           elements=[
                               ListChoice(
                                   choices=defines.interface_oper_states(),
                                   allow_empty=False,
                               ),
                               MonitoringState()
                           ]),
                     title=_('Map operational states'),
                     help=
                     _('Map the operational state (<tt>ifOperStatus</tt>) to a monitoring state.'
                       ))),
                ("admin_state",
                 Optional(
                     ListChoice(
                         title=_("Allowed admin states:"),
                         choices=_admin_states(),
                         allow_empty=False,
                     ),
                     title=_("Admin state (SNMP with 64-bit counters only)"),
                     help=
                     _("If you activate the monitoring of the admin state "
                       "(<tt>ifAdminStatus</tt>), the check will go critical if the "
                       "current state of the interface does not match one of the expected "
                       "states. " + _note_for_admin_state_options()),
                     label=_("Ignore the admin state"),
                     none_label=_("ignore"),
                     negate=True)),
                ("map_admin_states",
                 ListOf(
                     Tuple(orientation="horizontal",
                           elements=[
                               ListChoice(
                                   choices=_admin_states(),
                                   allow_empty=False,
                               ),
                               MonitoringState(),
                           ]),
                     title=_(
                         'Map admin states (SNMP with 64-bit counters only)'),
                     help=
                     _("Map the admin state (<tt>ifAdminStatus</tt>) to a monitoring state. "
                       + _note_for_admin_state_options()),
                 )),
                ("assumed_speed_in",
                 OptionalDropdownChoice(
                     title=_("Assumed input speed"),
                     help=
                     _("If the automatic detection of the link speed does not work "
                       "or the switch's capabilities are throttled because of the network setup "
                       "you can set the assumed speed here."),
                     choices=[
                         (None, _("ignore speed")),
                         (10000000, "10 Mbit/s"),
                         (100000000, "100 Mbit/s"),
                         (1000000000, "1 Gbit/s"),
                         (10000000000, "10 Gbit/s"),
                     ],
                     otherlabel=_("specify manually ->"),
                     default_value=16000000,
                     explicit=Integer(
                         title=_("Other speed in bits per second"),
                         label=_("Bits per second"),
                         size=10))),
                ("assumed_speed_out",
                 OptionalDropdownChoice(
                     title=_("Assumed output speed"),
                     help=
                     _("If the automatic detection of the link speed does not work "
                       "or the switch's capabilities are throttled because of the network setup "
                       "you can set the assumed speed here."),
                     choices=[
                         (None, _("ignore speed")),
                         (10000000, "10 Mbit/s"),
                         (100000000, "100 Mbit/s"),
                         (1000000000, "1 Gbit/s"),
                         (10000000000, "10 Gbit/s"),
                     ],
                     otherlabel=_("specify manually ->"),
                     default_value=1500000,
                     explicit=Integer(
                         title=_("Other speed in bits per second"),
                         label=_("Bits per second"),
                         size=12))),
                ("unit",
                 DropdownChoice(
                     title=_("Measurement unit"),
                     help=
                     _("Here you can specifiy the measurement unit of the network interface"
                       ),
                     default_value="byte",
                     choices=[
                         ("bit", _("Bits")),
                         ("byte", _("Bytes")),
                     ],
                 )),
                ("infotext_format",
                 DropdownChoice(
                     title=_("Change infotext in check output"),
                     help=
                     _("This setting allows you to modify the information text which is displayed between "
                       "the two brackets in the check output. Please note that this setting does not work for "
                       "grouped interfaces, since the additional information of grouped interfaces is different"
                       ),
                     choices=[
                         ("alias", _("Show alias")),
                         ("description", _("Show description")),
                         ("alias_and_description",
                          _("Show alias and description")),
                         ("alias_or_description",
                          _("Show alias if set, else description")),
                         ("desription_or_alias",
                          _("Show description if set, else alias")),
                         ("hide", _("Hide infotext")),
                     ])),
                ("traffic",
                 ListOf(
                     CascadingDropdown(title=_("Direction"),
                                       orientation="horizontal",
                                       choices=[
                                           ('both', _("In / Out"),
                                            vs_interface_traffic()),
                                           ('in', _("In"),
                                            vs_interface_traffic()),
                                           ('out', _("Out"),
                                            vs_interface_traffic()),
                                       ]),
                     title=_("Used bandwidth (minimum or maximum traffic)"),
                     help=_(
                         "Setting levels on the used bandwidth is optional. If you do set "
                         "levels you might also consider using averaging."),
                 )),
                ("total_traffic",
                 Dictionary(
                     title=_(
                         "Activate total bandwidth metric (sum of in and out)"
                     ),
                     help=
                     _("By activating this item, the sum of incoming and outgoing traffic will "
                       "be monitored via a seperate metric. Setting levels on the used total bandwidth "
                       "is optional. If you do set levels you might also consider using averaging."
                       ),
                     elements=[(
                         "levels",
                         ListOf(
                             vs_interface_traffic(),
                             title=_("Provide levels"),
                             help=_(
                                 "Levels on the total bandwidth will act the same way as they do for "
                                 "in/out bandwidth."),
                         ),
                     )],
                     optional_keys=["levels"],
                 )),
                ("average",
                 Integer(
                     title=_("Average values for used bandwidth"),
                     help=
                     _("By activating the computation of averages, the levels on "
                       "traffic and speed are applied to the averaged value. That "
                       "way you can make the check react only on long-time changes, "
                       "not on one-minute events."),
                     unit=_("minutes"),
                     minvalue=1,
                     default_value=15,
                 )),
                (
                    "nucasts",
                    Tuple(
                        title=_("Non-unicast packet rates"),
                        help=
                        _("Setting levels on non-unicast packet rates is optional. This may help "
                          "to detect broadcast storms and other unwanted traffic."
                          ),
                        elements=[
                            Integer(title=_("Warning at"),
                                    unit=_("pkts / sec")),
                            Integer(title=_("Critical at"),
                                    unit=_("pkts / sec")),
                        ]),
                ),
                ("multicast",
                 Alternative(
                     title=_("Multicast packet rates"),
                     help=
                     _("These levels make the check go warning or critical whenever the "
                       "<b>percentual packet rate</b> or the <b>absolute packet "
                       "rate</b> of the monitored interface reaches the given "
                       "bounds. The percentual packet rate is computed by "
                       "dividing the number of multicast packets by the number "
                       "of unicast packets."),
                     elements=[
                         Tuple(title=_(
                             "Percentual levels for multicast packets"),
                               elements=[
                                   Percentage(title=_("Warning at"),
                                              unit=_("percent packets"),
                                              default_value=10.0,
                                              display_format='%.3f'),
                                   Percentage(title=_("Critical at"),
                                              unit=_("percent packets"),
                                              default_value=20.0,
                                              display_format='%.3f')
                               ]),
                         Tuple(
                             title=_("Absolute levels for multicast packets"),
                             elements=[
                                 Integer(title=_("Warning at"),
                                         unit=_("pkts / sec")),
                                 Integer(title=_("Critical at"),
                                         unit=_("pkts / sec"))
                             ])
                     ])),
                ("broadcast",
                 Alternative(
                     title=_("Broadcast packet rates"),
                     help=
                     _("These levels make the check go warning or critical whenever the "
                       "<b>percentual packet rate</b> or the <b>absolute packet "
                       "rate</b> of the monitored interface reaches the given "
                       "bounds. The percentual packet rate is computed by "
                       "dividing the number of broadcast packets by the number "
                       "of unicast packets."),
                     elements=[
                         Tuple(title=_(
                             "Percentual levels for broadcast packets"),
                               elements=[
                                   Percentage(title=_("Warning at"),
                                              unit=_("percent packets"),
                                              default_value=10.0,
                                              display_format='%.3f'),
                                   Percentage(title=_("Critical at"),
                                              unit=_("percent packets"),
                                              default_value=20.0,
                                              display_format='%.3f')
                               ]),
                         Tuple(
                             title=_("Absolute levels for broadcast packets"),
                             elements=[
                                 Integer(title=_("Warning at"),
                                         unit=_("pkts / sec")),
                                 Integer(title=_("Critical at"),
                                         unit=_("pkts / sec"))
                             ])
                     ])),
                ("average_bm",
                 Integer(
                     title=_(
                         "Average values for broad- and multicast packet rates"
                     ),
                     help=
                     _("By activating the computation of averages, the levels on "
                       "broad- and multicast packet rates are applied to "
                       "the averaged value. That way you can make the check react only on long-time "
                       "changes, not on one-minute events."),
                     unit=_("minutes"),
                     minvalue=1,
                     default_value=15,
                 )),
                ("discards",
                 Tuple(title=_("Absolute levels for discards rates"),
                       elements=[
                           Integer(title=_("Warning at"), unit=_("discards")),
                           Integer(title=_("Critical at"), unit=_("discards"))
                       ])),
                ("match_same_speed",
                 DropdownChoice(
                     title=_("Speed of interface groups (Netapp only)"),
                     help=
                     _("Choose the behaviour for different interface speeds in "
                       "interface groups. The default is \"Check and WARN\". This "
                       "feature is currently only supported by the check "
                       "netapp_api_if."),
                     choices=[
                         ("check_and_warn", _("Check and WARN")),
                         ("check_and_crit", _("Check and CRIT")),
                         ("check_and_display", _("Check and display only")),
                         ("dont_show_and_check", _("Don't show and check")),
                     ])),
                ("home_port",
                 DropdownChoice(
                     title=_("Is-Home state (Netapp only)"),
                     help=
                     _("Choose the behaviour when the current port is not the "
                       "home port of the respective interface. The default is "
                       "\"Check and Display\". This feature is currently only "
                       "supported by the check netapp_api_if."),
                     choices=[
                         ("check_and_warn", _("Check and WARN")),
                         ("check_and_crit", _("Check and CRIT")),
                         ("check_and_display", _("Check and display only")),
                         ("dont_show_and_check",
                          _("Don't show home port info")),
                     ])),
            ],
        ),
        forth=transform_if,
    )
Beispiel #4
0
def _parameter_valuespec_jenkins_nodes():
    return Dictionary(elements=[
        ("jenkins_offline", MonitoringState(title=_("Node state: Offline"), default_value=2)),
        ("jenkins_mode",
         DropdownChoice(
             title=_("Expected mode state."),
             help=_("Choose between Normal (Utilize this node as much "
                    "as possible) and Exclusive (Only build jobs with label "
                    "restrictions matching this node). The state will "
                    "change to warning state, if the mode differs."),
             choices=[
                 ("NORMAL", _("Normal")),
                 ("EXCLUSIVE", _("Exclusive")),
             ],
             default_value="NORMAL",
         )),
        ('jenkins_numexecutors',
         Tuple(
             title=_("Lower level for number of executors of this node"),
             elements=[
                 Integer(title=_("Warning below")),
                 Integer(title=_("Critical below")),
             ],
         )),
        ('jenkins_busyexecutors',
         Tuple(
             title=_("Upper level for number of busy executors of this node"),
             elements=[
                 Integer(title=_("Warning at")),
                 Integer(title=_("Critical at")),
             ],
         )),
        ('jenkins_idleexecutors',
         Tuple(
             title=_("Upper level for number of idle executors of this node"),
             elements=[
                 Integer(title=_("Warning at")),
                 Integer(title=_("Critical at")),
             ],
         )),
        ('avg_response_time',
         Tuple(
             title=_("Average round-trip response time to this node"),
             elements=[
                 Age(title=_("Warning at")),
                 Age(title=_("Critical at")),
             ],
         )),
        ('jenkins_clock',
         Tuple(
             title=_("Clock difference"),
             elements=[
                 Age(title=_("Warning at")),
                 Age(title=_("Critical at")),
             ],
         )),
        ("jenkins_temp",
         Tuple(
             title=_("Absolute levels for free temp space"),
             elements=[
                 Integer(
                     title=_("Warning if below"),
                     unit=_("MB"),
                     minvalue=0,
                 ),
                 Integer(
                     title=_("Critical if below"),
                     unit=_("MB"),
                     minvalue=0,
                 ),
             ],
         )),
    ],)
Beispiel #5
0
def _parameter_valuespec_livestatus_status():
    return Dictionary(
        help=
        _("When monitoring the performance of a monitoring site (i.e. its core) "
          "then also settings are being checked, e.g. for manually disabled notifications. "
          "The status of the various situations can be configured here."),
        elements=[
            ("site_stopped",
             MonitoringState(title="State when the site is stopped",
                             default_value=2)),
            ("execute_host_checks",
             MonitoringState(title="State when host checks are disabled",
                             default_value=2)),
            ("execute_service_checks",
             MonitoringState(title="State when service checks are disabled",
                             default_value=2)),
            ("accept_passive_host_checks",
             MonitoringState(
                 title="State when not accepting passive host checks",
                 default_value=2)),
            ("accept_passive_service_checks",
             MonitoringState(
                 title="State when not accepting passive service checks",
                 default_value=2)),
            ("check_host_freshness",
             MonitoringState(title="State when not checking host freshness",
                             default_value=2)),
            ("check_service_freshness",
             MonitoringState(title="State when not checking service freshness",
                             default_value=2)),
            ("enable_event_handlers",
             MonitoringState(title="State when event handlers are disabled",
                             default_value=0)),
            ("enable_flap_detection",
             MonitoringState(title="State when flap detection is disabled",
                             default_value=1)),
            ("enable_notifications",
             MonitoringState(title="State when notifications are disabled",
                             default_value=2)),
            ("process_performance_data",
             MonitoringState(title="State when performance data is disabled",
                             default_value=1)),
            ("check_external_commands",
             MonitoringState(title="State when not checking external commands",
                             default_value=2)),
            ("site_cert_days",
             Tuple(
                 title=_("Site certificate validity"),
                 help=_(
                     "Minimum number of days a certificate has to be valid."),
                 elements=[
                     Integer(
                         title=_("Warning at or below"),
                         minvalue=0,
                         unit=_("days"),
                         default_value=30,
                     ),
                     Integer(
                         title=_("Critical at or below"),
                         minvalue=0,
                         unit=_("days"),
                         default_value=7,
                     ),
                 ],
             )),
            ("average_latency_generic",
             Tuple(title=_("Levels Latency Check"),
                   help=_("Set Levels for the Check Latency Time"),
                   elements=[
                       Age(
                           title=_("Warning at or above"),
                           default_value=30,
                       ),
                       Age(
                           title=_("Critical at or above"),
                           default_value=60,
                       ),
                   ])),
            ("average_latency_cmk",
             Tuple(title=_("Levels Latency Checkmk"),
                   help=_("Set Levels for the Checkmk Latency Time"),
                   elements=[
                       Age(
                           title=_("Warning at or above"),
                           default_value=30,
                       ),
                       Age(
                           title=_("Critical at or above"),
                           default_value=60,
                       ),
                   ])),
            ("helper_usage_generic",
             Tuple(title=_("Levels Helper usage Check"),
                   help=_("Set Levels for the Check helper Usage"),
                   elements=[
                       Percentage(
                           title=_("Warning at or above"),
                           default_value="60",
                       ),
                       Percentage(
                           title=_("Critical at or above"),
                           default_value="90",
                       ),
                   ])),
            ("helper_usage_cmk",
             Tuple(title=_("Levels Helper usage Checkmk"),
                   help=_("Set Levels for the Checkmk helper Usage"),
                   elements=[
                       Percentage(
                           title=_("Warning at or above"),
                           default_value="60",
                       ),
                       Percentage(
                           title=_("Critical at or above"),
                           default_value="90",
                       ),
                   ])),
            ("livestatus_usage",
             Tuple(title=_("Levels Livestatus Usage"),
                   help=_("Set Levels for the Checkmk Livestatus Usage"),
                   elements=[
                       Percentage(
                           title=_("Warning at or above"),
                           default_value="80",
                       ),
                       Percentage(
                           title=_("Critical at or above"),
                           default_value="90",
                       ),
                   ])),
            ("livestatus_overflows_rate",
             Tuple(title=_("Levels Livestatus Overflows"),
                   help=_("Set Levels for the Checkmk Livestatus Overflows"),
                   elements=[
                       Float(
                           title=_("Warning at or above"),
                           unit=_("/s"),
                           default_value="0.01",
                       ),
                       Float(
                           title=_("Critical at or above"),
                           unit=_("/s"),
                           default_value="0.02",
                       ),
                   ])),
            ("levels_hosts",
             Tuple(title=_("Levels Hosts"),
                   help=_("Set Levels for the number of Hosts"),
                   elements=[
                       Integer(
                           title=_("Warning at or above"),
                           unit=_("Hosts"),
                       ),
                       Integer(
                           title=_("Critical at or above"),
                           unit=_("Hosts"),
                       ),
                   ])),
            ("levels_services",
             Tuple(title=_("Levels Services"),
                   help=_("Set Levels for the number of Services"),
                   elements=[
                       Integer(
                           title=_("Warning at or above"),
                           unit=_("Services"),
                       ),
                       Integer(
                           title=_("Critical at or above"),
                           unit=_("Services"),
                       ),
                   ])),
        ],
    )
Beispiel #6
0
def _parameter_valuespec_veritas_vcs():
    return Dictionary(elements=[
        ("map_states",
         Dictionary(
             title=_("Map Attribute 'State'"),
             elements=[
                 ("ONLINE", MonitoringState(title=_("ONLINE"),
                                            default_value=0)),
                 ("RUNNING",
                  MonitoringState(title=_("RUNNING"), default_value=0)),
                 ("OK", MonitoringState(title=_("OK"), default_value=0)),
                 ("OFFLINE",
                  MonitoringState(title=_("OFFLINE"), default_value=1)),
                 ("EXITED", MonitoringState(title=_("EXITED"),
                                            default_value=1)),
                 ("PARTIAL",
                  MonitoringState(title=_("PARTIAL"), default_value=1)),
                 ("FAULTED",
                  MonitoringState(title=_("FAULTED"), default_value=2)),
                 ("UNKNOWN",
                  MonitoringState(title=_("UNKNOWN"), default_value=3)),
                 ("default",
                  MonitoringState(title=_("States other than the above"),
                                  default_value=1)),
             ],
             optional_keys=False,
         )),
        ("map_frozen",
         Dictionary(
             title=_("Map Attribute 'Frozen'"),
             elements=[
                 ("tfrozen",
                  MonitoringState(title=_("Temporarily frozen"),
                                  default_value=1)),
                 ("frozen", MonitoringState(title=_("Frozen"),
                                            default_value=2)),
             ],
             optional_keys=False,
         )),
    ], )
Beispiel #7
0
def _parameter_valuespec_cisco_stack():
    # type: () -> Dictionary
    return Dictionary(
        elements=[
            ("waiting",
             MonitoringState(
                 title="waiting",
                 default_value=0,
                 help=_("Waiting for other switches to come online"))),
            ("progressing",
             MonitoringState(
                 title="progressing",
                 default_value=0,
                 help=_("Master election or mismatch checks in progress"))),
            ("added",
             MonitoringState(title="added",
                             default_value=0,
                             help=_("Added to stack"))),
            ("ready",
             MonitoringState(title="ready", default_value=0, help=_("Ready"))),
            ("sdmMismatch",
             MonitoringState(title="sdmMismatch",
                             default_value=1,
                             help=_("SDM template mismatch"))),
            ("verMismatch",
             MonitoringState(title="verMismatch",
                             default_value=1,
                             help=_("OS version mismatch"))),
            ("featureMismatch",
             MonitoringState(title="featureMismatch",
                             default_value=1,
                             help=_("Configured feature mismatch"))),
            ("newMasterInit",
             MonitoringState(title="newMasterInit",
                             default_value=0,
                             help=_("Waiting for new master initialization"))),
            ("provisioned",
             MonitoringState(title="provisioned",
                             default_value=0,
                             help=_("Not an active member of the stack"))),
            ("invalid",
             MonitoringState(title="invalid",
                             default_value=2,
                             help=_("State machine in invalid state"))),
            ("removed",
             MonitoringState(title="removed",
                             default_value=2,
                             help=_("Removed from stack"))),
        ],
        optional_keys=[],
    )
Beispiel #8
0
def _parameter_valuespec_check_mk_agent_update():
    return Dictionary(elements=[
        ("error_deployment_globally_disabled",
         MonitoringState(title=_("State if agent deployment is globally disabled"),
                         default_value=1)),
    ],)
Beispiel #9
0
 def parameter_valuespec(self):
     # Transform old traffic related levels which used "traffic" and "traffic_minimum"
     # keys where each was configured with an Alternative valuespec
     return Transform(
         Dictionary(
             ignored_keys=[
                 "aggregate"
             ],  # Created by discovery when using interface grouping
             elements=[
                 ("errors_in", _vs_if_errors("IN")),
                 ("errors_out", _vs_if_errors("OUT")),
                 ("speed",
                  OptionalDropdownChoice(
                      title=_("Operating speed"),
                      help=
                      _("If you use this parameter then the check goes warning if the "
                        "interface is not operating at the expected speed (e.g. it "
                        "is working with 100Mbit/s instead of 1Gbit/s.<b>Note:</b> "
                        "some interfaces do not provide speed information. In such cases "
                        "this setting is used as the assumed speed when it comes to "
                        "traffic monitoring (see below)."),
                      choices=[
                          (None, _("ignore speed")),
                          (10000000, "10 Mbit/s"),
                          (100000000, "100 Mbit/s"),
                          (1000000000, "1 Gbit/s"),
                          (10000000000, "10 Gbit/s"),
                      ],
                      otherlabel=_("specify manually ->"),
                      explicit=Integer(
                          title=_("Other speed in bits per second"),
                          label=_("Bits per second")))),
                 ("state",
                  Optional(
                      ListChoice(title=_("Allowed states:"),
                                 choices=defines.interface_oper_states()),
                      title=_("Operational state"),
                      help=
                      _("If you activate the monitoring of the operational state (<tt>ifOperStatus</tt>) "
                        "the check will get warning or critical if the current state "
                        "of the interface does not match one of the expected states. Note: the status 9 (<i>admin down</i>) "
                        "is only visible if you activate this status during switch port inventory or if you manually "
                        "use the check plugin <tt>if64adm</tt> instead of <tt>if64</tt>."
                        ),
                      label=_("Ignore the operational state"),
                      none_label=_("ignore"),
                      negate=True)),
                 ("map_operstates",
                  ListOf(
                      Tuple(
                          orientation="horizontal",
                          elements=[
                              DropdownChoice(
                                  choices=defines.interface_oper_states()),
                              MonitoringState()
                          ]),
                      title=_('Map operational states'),
                  )),
                 ("assumed_speed_in",
                  OptionalDropdownChoice(
                      title=_("Assumed input speed"),
                      help=
                      _("If the automatic detection of the link speed does not work "
                        "or the switch's capabilities are throttled because of the network setup "
                        "you can set the assumed speed here."),
                      choices=[
                          (None, _("ignore speed")),
                          (10000000, "10 Mbit/s"),
                          (100000000, "100 Mbit/s"),
                          (1000000000, "1 Gbit/s"),
                          (10000000000, "10 Gbit/s"),
                      ],
                      otherlabel=_("specify manually ->"),
                      default_value=16000000,
                      explicit=Integer(
                          title=_("Other speed in bits per second"),
                          label=_("Bits per second"),
                          size=10))),
                 ("assumed_speed_out",
                  OptionalDropdownChoice(
                      title=_("Assumed output speed"),
                      help=
                      _("If the automatic detection of the link speed does not work "
                        "or the switch's capabilities are throttled because of the network setup "
                        "you can set the assumed speed here."),
                      choices=[
                          (None, _("ignore speed")),
                          (10000000, "10 Mbit/s"),
                          (100000000, "100 Mbit/s"),
                          (1000000000, "1 Gbit/s"),
                          (10000000000, "10 Gbit/s"),
                      ],
                      otherlabel=_("specify manually ->"),
                      default_value=1500000,
                      explicit=Integer(
                          title=_("Other speed in bits per second"),
                          label=_("Bits per second"),
                          size=12))),
                 ("unit",
                  RadioChoice(
                      title=_("Measurement unit"),
                      help=
                      _("Here you can specifiy the measurement unit of the network interface"
                        ),
                      default_value="byte",
                      choices=[
                          ("bit", _("Bits")),
                          ("byte", _("Bytes")),
                      ],
                  )),
                 ("infotext_format",
                  DropdownChoice(
                      title=_("Change infotext in check output"),
                      help=
                      _("This setting allows you to modify the information text which is displayed between "
                        "the two brackets in the check output. Please note that this setting does not work for "
                        "grouped interfaces, since the additional information of grouped interfaces is different"
                        ),
                      choices=[
                          ("alias", _("Show alias")),
                          ("description", _("Show description")),
                          ("alias_and_description",
                           _("Show alias and description")),
                          ("alias_or_description",
                           _("Show alias if set, else description")),
                          ("desription_or_alias",
                           _("Show description if set, else alias")),
                          ("hide", _("Hide infotext")),
                      ])),
                 ("traffic",
                  ListOf(
                      CascadingDropdown(title=_("Direction"),
                                        orientation="horizontal",
                                        choices=[
                                            ('both', _("In / Out"),
                                             vs_interface_traffic()),
                                            ('in', _("In"),
                                             vs_interface_traffic()),
                                            ('out', _("Out"),
                                             vs_interface_traffic()),
                                        ]),
                      title=_(
                          "Used bandwidth (minimum or maximum traffic)"),
                      help=
                      _("Setting levels on the used bandwidth is optional. If you do set "
                        "levels you might also consider using averaging."),
                  )),
                 (
                     "nucasts",
                     Tuple(
                         title=_("Non-unicast packet rates"),
                         help=
                         _("Setting levels on non-unicast packet rates is optional. This may help "
                           "to detect broadcast storms and other unwanted traffic."
                           ),
                         elements=[
                             Integer(title=_("Warning at"),
                                     unit=_("pkts / sec")),
                             Integer(title=_("Critical at"),
                                     unit=_("pkts / sec")),
                         ]),
                 ),
                 ("discards",
                  Tuple(title=_("Absolute levels for discards rates"),
                        elements=[
                            Integer(title=_("Warning at"),
                                    unit=_("discards")),
                            Integer(title=_("Critical at"),
                                    unit=_("discards"))
                        ])),
                 ("average",
                  Integer(
                      title=_("Average values"),
                      help=
                      _("By activating the computation of averages, the levels on "
                        "errors and traffic are applied to the averaged value. That "
                        "way you can make the check react only on long-time changes, "
                        "not on one-minute events."),
                      unit=_("minutes"),
                      minvalue=1,
                      default_value=15,
                  )),
                 ("match_same_speed",
                  DropdownChoice(
                      title=_("Speed of interface groups (Netapp only)"),
                      help=
                      _("Choose the behaviour for different interface speeds in "
                        "interface groups. The default is \"Check and WARN\". This "
                        "feature is currently only supported by the check "
                        "netapp_api_if."),
                      choices=[
                          ("check_and_warn", _("Check and WARN")),
                          ("check_and_crit", _("Check and CRIT")),
                          ("check_and_display",
                           _("Check and display only")),
                          ("dont_show_and_check",
                           _("Don't show and check")),
                      ])),
             ],
         ),
         forth=transform_if,
     )
Beispiel #10
0
 def parameter_valuespec(self):
     return Transform(
         Dictionary(
             elements=[
                 ("capacity",
                  Tuple(title=_("Levels of battery capacity"),
                        elements=[
                            Percentage(
                                title=_("Warning below"),
                                default_value=95.0,
                            ),
                            Percentage(
                                title=_("Critical below"),
                                default_value=90.0,
                            ),
                        ])),
                 ("calibration_state",
                  MonitoringState(
                      title=_("State if calibration is invalid"),
                      default_value=0,
                  )),
                 ("post_calibration_levels",
                  Dictionary(
                      title=_(
                          "Levels of battery parameters after calibration"),
                      help=
                      _("After a battery calibration the battery capacity is reduced until the "
                        "battery is fully charged again. Here you can specify an alternative "
                        "lower level in this post-calibration phase. "
                        "Since apc devices remember the time of the last calibration only "
                        "as a date, the alternative lower level will be applied on the whole "
                        "day of the calibration until midnight. You can extend this time period "
                        "with an additional time span to make sure calibrations occuring just "
                        "before midnight do not trigger false alarms."),
                      elements=[
                          ("altcapacity",
                           Percentage(
                               title=
                               _("Alternative critical battery capacity after calibration"
                                 ),
                               default_value=50,
                           )),
                          ("additional_time_span",
                           Integer(
                               title=
                               ("Extend post-calibration phase by additional time span"
                                ),
                               unit=_("minutes"),
                               default_value=0,
                           )),
                      ],
                      optional_keys=False,
                  )),
                 ("battime",
                  Tuple(
                      title=_("Time left on battery"),
                      elements=[
                          Age(title=_("Warning at"),
                              help=
                              _("Time left on Battery at and below which a warning state is triggered"
                                ),
                              default_value=0,
                              display=["hours", "minutes"]),
                          Age(title=_("Critical at"),
                              help=
                              _("Time Left on Battery at and below which a critical state is triggered"
                                ),
                              default_value=0,
                              display=["hours", "minutes"]),
                      ],
                  )),
                 ("battery_replace_state",
                  MonitoringState(
                      title=_("State if battery needs replacement"),
                      default_value=1,
                  )),
             ],
             optional_keys=[
                 'post_calibration_levels', 'output_load', 'battime'
             ],
         ),
         forth=self._transform_apc_symmetra,
     )
Beispiel #11
0
def _parameter_valuespec_mssql_databases():
    return Dictionary(elements=[
        ("map_db_states",
         Dictionary(
             elements=[
                 ("ONLINE", MonitoringState(title=_("Database Online"))),
                 ("OFFLINE", MonitoringState(title=_("Database Offline"))),
                 ("RESTORING", MonitoringState(title=_("Database Files are restored"))),
                 ("RECOVERING", MonitoringState(title=_("Database is being recovered"))),
                 ("RECOVERY_PENDING", MonitoringState(title=_("Database must be recovered"))),
                 ("SUSPECT", MonitoringState(title=_("Database Suspect"))),
                 ("EMERGENCY", MonitoringState(title=_("Database changed to emergency"))),
             ],
             title=_('Map Database States'),
             optional_keys=[],
         )),
        ("map_auto_close_state",
         Dictionary(
             elements=[
                 ("on", MonitoringState(title=_("Auto close on"), default_value=1)),
                 ("off", MonitoringState(title=_("Auto close off"))),
             ],
             title=_('Map auto close status'),
             optional_keys=[],
         )),
        ("map_auto_shrink_state",
         Dictionary(
             elements=[
                 ("on", MonitoringState(title=_("Auto shrink on"), default_value=1)),
                 ("off", MonitoringState(title=_("Auto shrink off"))),
             ],
             title=_('Map auto shrink status'),
             optional_keys=[],
         )),
    ],)
Beispiel #12
0
def _parameter_valuespec_fileinfo_groups():
    return Dictionary(
        elements=file_size_age_elements + [
            ("minsize",
             Tuple(
                 title=_("Minimal size"),
                 elements=[
                     Filesize(title=_("Warning if below")),
                     Filesize(title=_("Critical if below")),
                 ],
             )),
            ("maxsize",
             Tuple(
                 title=_("Maximal size"),
                 elements=[
                     Filesize(title=_("Warning if above")),
                     Filesize(title=_("Critical if above")),
                 ],
             )),
            ("mincount",
             Tuple(
                 title=_("Minimal file count"),
                 elements=[
                     Integer(title=_("Warning if below")),
                     Integer(title=_("Critical if below")),
                 ],
             )),
            ("maxcount",
             Tuple(
                 title=_("Maximal file count"),
                 elements=[
                     Integer(title=_("Warning if above")),
                     Integer(title=_("Critical if above")),
                 ],
             )),
            ("timeofday",
             ListOfTimeRanges(
                 title=_("Only check during the following times of the day"),
                 help=_("Outside these ranges the check will always be OK"),
             )),
            ("conjunctions",
             ListOf(
                 Tuple(elements=[
                     MonitoringState(title=_("Monitoring state"),
                                     default_value=2),
                     ListOf(
                         CascadingDropdown(
                             orientation="horizontal",
                             choices=[
                                 ("count", _("File count at"), Integer()),
                                 ("count_lower", _("File count below"),
                                  Integer()),
                                 ("size", _("File size at"), Filesize()),
                                 ("size_lower", _("File size below"),
                                  Filesize()),
                                 ("largest_size", _("Largest file size at"),
                                  Filesize()),
                                 ("largest_size_lower",
                                  _("Largest file size below"), Filesize()),
                                 ("smallest_size", _("Smallest file size at"),
                                  Filesize()),
                                 ("smallest_size_lower",
                                  _("Smallest file size below"), Filesize()),
                                 ("oldest_age", _("Oldest file age at"),
                                  Age()),
                                 ("oldest_age_lower",
                                  _("Oldest file age below"), Age()),
                                 ("newest_age", _("Newest file age at"),
                                  Age()),
                                 ("newest_age_lower",
                                  _("Newest file age below"), Age()),
                             ],
                         ),
                         magic="@#@#",
                     )
                 ], ),
                 title=_("Level conjunctions"),
                 help=
                 _("In order to check dependent file group statistics you can configure "
                   "conjunctions of single levels now. A conjunction consists of a monitoring state "
                   "and any number of upper or lower levels. If all of the configured levels within "
                   "a conjunction are reached then the related state is reported."
                   ),
             )),
            ("additional_rules",
             ListOf(
                 Tuple(elements=[
                     RegExpUnicode(title=_("Filename/- expression"),
                                   mode="case_sensitive"),
                     Dictionary(elements=file_size_age_elements),
                 ], ),
                 title=_("Additional rules for files"),
                 help=
                 _("You can specify a filename or a regular expresion, and additional "
                   "rules that are applied to the matching files. This means that the "
                   "rules set for the whole file group are overwritten for those files. "
                   "Note that the order in which you specify the rules matters: "
                   "in case of multiple matching rules, the first matching rule is "
                   "applied."),
             )),
        ],
        ignored_keys=["precompiled_patterns", "group_patterns"],
    )
Beispiel #13
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2019 tribe29 GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.

from cmk.gui.i18n import _
from cmk.gui.valuespec import (
    Dictionary,
    MonitoringState,
    TextInput,
)
from cmk.gui.plugins.wato import (
    RulespecGroupCheckParametersApplications,
    register_check_parameters,
)

register_check_parameters(
    RulespecGroupCheckParametersApplications, "oracle_sql", _("Oracle Custom SQLs"),
    Dictionary(elements=[
        ("instance_error_state", MonitoringState(title=_("Instance error state"))),
        ("perfdata_error_state", MonitoringState(title=_("Perfdata error state"))),
    ],), TextInput(title=_("Custom SQL")), "dict")
Beispiel #14
0
        Age(title=_("warning at")),
        Age(title=_("critical at")),
    ],
)

ignore_db_status = DropdownChoice(
    title=_("Job State"),
    help=_("The state of the job is ignored by default."),
    choices=[
        (True, _("Ignore the state of the Job")),
        (False, _("Consider the state of the job")),
    ],
)

status_disabled_jobs = MonitoringState(
    title=_("Status of service in case of disabled job"),
    default_value=0,
)

status_missing_jobs = MonitoringState(
    title=_("Status of service in case of missing job"),
    default_value=2,
)

missinglog = MonitoringState(
    default_value=1,
    title=_("State in case of Job has no log information"),
    help=_(
        "It is possible that a job has no log information. This also means "
        "that the job has no last running state as this is obtained from the log. "
        "The last run state is ignored when no log information is found."),
)
Beispiel #15
0
def _parameter_valuespec_graylog_cluster_stats_elastic():
    return Dictionary(elements=[
        ("green", MonitoringState(
            title=_("Status: green"),
            default_value=0,
        )),
        ("yellow", MonitoringState(
            title=_("Status: yellow"),
            default_value=1,
        )),
        ("red", MonitoringState(
            title=_("Status: red"),
            default_value=2,
        )),
        ("number_of_nodes_lower",
         Tuple(
             title=_("Total number of nodes lower level"),
             elements=[
                 Integer(title=_("Warning if less then"), unit="nodes"),
                 Integer(title=_("Critical if less then"), unit="nodes")
             ],
         )),
        ("number_of_nodes_upper",
         Tuple(
             title=_("Total number of nodes upper level"),
             elements=[
                 Integer(title=_("Warning at"), unit="nodes"),
                 Integer(title=_("Critical at"), unit="nodes")
             ],
         )),
        ("number_of_data_nodes_lower",
         Tuple(
             title=_("Total number of data nodes lower level"),
             elements=[
                 Integer(title=_("Warning if less then"), unit="data nodes"),
                 Integer(title=_("Critical if less then"), unit="data nodes")
             ],
         )),
        ("number_of_data_nodes_upper",
         Tuple(
             title=_("Total number of data nodes upper level"),
             elements=[
                 Integer(title=_("Warning at"), unit="data nodes"),
                 Integer(title=_("Critical at"), unit="data nodes")
             ],
         )),
        ("active_shards_lower",
         Tuple(
             title=_("Total number of active shards lower level"),
             elements=[
                 Integer(title=_("Warning if less then"), unit="shards"),
                 Integer(title=_("Critical if less then"), unit="shards")
             ],
         )),
        ("active_shards_upper",
         Tuple(
             title=_("Total number of active shards upper level"),
             elements=[
                 Integer(title=_("Warning at"), unit="shards"),
                 Integer(title=_("Critical at"), unit="shards")
             ],
         )),
        ("active_primary_shards_lower",
         Tuple(
             title=_("Total number of active primary shards lower level"),
             elements=[
                 Integer(title=_("Warning if less then"), unit="shards"),
                 Integer(title=_("Critical if less then"), unit="shards")
             ],
         )),
        ("active_primary_shards_upper",
         Tuple(
             title=_("Total number of active primary shards upper level"),
             elements=[
                 Integer(title=_("Warning at"), unit="shards"),
                 Integer(title=_("Critical at"), unit="shards")
             ],
         )),
        ("unassigned_shards_upper",
         Tuple(
             title=_("Total number of unassigned shards"),
             elements=[
                 Integer(title=_("Warning at"), unit="shards"),
                 Integer(title=_("Critical at"), unit="shards")
             ],
         )),
        ("initializing_shards_upper",
         Tuple(
             title=_("Number of initializing shards"),
             elements=[
                 Integer(title=_("Warning at"), unit="shards"),
                 Integer(title=_("Critical at"), unit="shards")
             ],
         )),
        ("relocating_shards_upper",
         Tuple(
             title=_("Number of relocating shards"),
             elements=[
                 Integer(title=_("Warning at"), unit="shards"),
                 Integer(title=_("Critical at"), unit="shards")
             ],
         )),
        ("number_of_pending_tasks_upper",
         Tuple(
             title=_("Number of pending tasks"),
             elements=[
                 Integer(title=_("Warning at"), unit="tasks"),
                 Integer(title=_("Critical at"), unit="tasks")
             ],
         )),
        ("index_count_lower",
         Tuple(
             title=_("Total number of indices lower level"),
             elements=[
                 Integer(title=_("Warning if less then"), unit="indices"),
                 Integer(title=_("Critical if less then"), unit="indices")
             ],
         )),
        ("index_count_upper",
         Tuple(
             title=_("Total number of indices upper level"),
             elements=[
                 Integer(title=_("Warning at"), unit="indices"),
                 Integer(title=_("Critical at"), unit="indices")
             ],
         )),
    ], )
Beispiel #16
0
def _parameter_valuespec_graylog_nodes():
    return Dictionary(elements=[
        ("lb_alive",
         MonitoringState(title=_("State when load balancer state is alive"),
                         default_value=0)),
        ("lb_throttled",
         MonitoringState(
             title=_("State when load balancer state is throttled"),
             default_value=2)),
        ("lb_dead",
         MonitoringState(title=_("State when load balancer state is dead"),
                         default_value=2)),
        ("lc_running",
         MonitoringState(title=_("State when lifecycle state is running"),
                         default_value=0)),
        ("lc_starting",
         MonitoringState(title=_("State when lifecycle state is starting"),
                         default_value=1)),
        ("lc_halting",
         MonitoringState(title=_("State when lifecycle state is halting"),
                         default_value=1)),
        ("lc_paused",
         MonitoringState(title=_("State when lifecycle state is paused"),
                         default_value=1)),
        ("lc_uninitialized",
         MonitoringState(
             title=_("State when lifecycle state is uninitialized"),
             default_value=1)),
        ("lc_failed",
         MonitoringState(title=_("State when lifecycle state is failed"),
                         default_value=2)),
        ("lc_throttled",
         MonitoringState(title=_("State when lifecycle state is throttled"),
                         default_value=2)),
        ("lc_override_lb_alive",
         MonitoringState(
             title=_("State when lifecycle state is override_lb_alive"),
             default_value=0)),
        ("lc_override_lb_dead",
         MonitoringState(
             title=_("State when lifecycle state is override_lb_dead"),
             default_value=1)),
        ("lc_override_lb_throttled",
         MonitoringState(
             title=_("State when lifecycle state is override_lb_throttled"),
             default_value=1)),
        ("ps_true",
         MonitoringState(title=_("State when index is processing"),
                         default_value=0)),
        ("ps_false",
         MonitoringState(title=_("State when index is not processing"),
                         default_value=2)),
        ("input_state",
         MonitoringState(title=_("State when input is not in state running"),
                         default_value=1)),
        ("input_count_lower",
         Tuple(
             title=_("Total number of inputs lower level"),
             elements=[
                 Integer(title=_("Warning if less then"), unit="inputs"),
                 Integer(title=_("Critical if less then"), unit="inputs")
             ],
         )),
        ("input_count_upper",
         Tuple(
             title=_("Total number of inputs upper level"),
             elements=[
                 Integer(title=_("Warning at"), unit="inputs"),
                 Integer(title=_("Critical at"), unit="inputs")
             ],
         )),
    ], )
Beispiel #17
0
def _parameter_valuespec_jenkins_jobs():
    return Dictionary(elements=[
        (
            "jenkins_job_score",
            Tuple(
                title=_("Job score"),
                elements=[
                    Integer(title=_("Warning below"), unit="%"),
                    Integer(title=_("Critical below"), unit="%"),
                ],
            ),
        ),
        (
            "jenkins_last_build",
            Tuple(
                title=_("Time since last build"),
                elements=[
                    Age(title=_("Warning if older than")),
                    Age(title=_("Critical if older than")),
                ],
            ),
        ),
        (
            "jenkins_time_since",
            Tuple(
                title=_("Time since last successful build"),
                elements=[
                    Age(title=_("Warning if older than")),
                    Age(title=_("Critical if older than")),
                ],
            ),
        ),
        (
            "jenkins_build_duration",
            Tuple(
                title=_("Duration of last build"),
                elements=[
                    Age(title=_("Warning at")),
                    Age(title=_("Critical at")),
                ],
            ),
        ),
        (
            "job_state",
            Dictionary(
                title=_("Override check state based on job state"),
                elements=[
                    (
                        "aborted",
                        MonitoringState(
                            title=_("State when job is in state aborted"),
                            default_value=0),
                    ),
                    (
                        "blue",
                        MonitoringState(
                            title=_("State when job is in state success"),
                            default_value=0),
                    ),
                    (
                        "disabled",
                        MonitoringState(
                            title=_("State when job is in state disabled"),
                            default_value=0),
                    ),
                    (
                        "notbuilt",
                        MonitoringState(
                            title=_("State when job is in state not built"),
                            default_value=0),
                    ),
                    (
                        "red",
                        MonitoringState(
                            title=_("State when job is in state failed"),
                            default_value=2),
                    ),
                    (
                        "yellow",
                        MonitoringState(
                            title=_("State when job is in state unstable"),
                            default_value=1),
                    ),
                ],
            ),
        ),
        (
            "build_result",
            Dictionary(
                title=_("Override check state based on last build result"),
                elements=[
                    (
                        "success",
                        MonitoringState(title=_(
                            "State when last build result is: success"),
                                        default_value=0),
                    ),
                    (
                        "unstable",
                        MonitoringState(
                            title=_(
                                "State when last build result is: unstable"),
                            default_value=1,
                        ),
                    ),
                    (
                        "failure",
                        MonitoringState(
                            title=_("State when last build result is: failed"),
                            default_value=2),
                    ),
                    (
                        "aborted",
                        MonitoringState(title=_(
                            "State when last build result is: aborted"),
                                        default_value=0),
                    ),
                    (
                        "null",
                        MonitoringState(
                            title=
                            _("State when last build result is: module not built"
                              ),
                            default_value=1,
                        ),
                    ),
                    (
                        "none",
                        MonitoringState(
                            title=_("State when build result is: running"),
                            default_value=0),
                    ),
                ],
            ),
        ),
    ], )
Beispiel #18
0
def _parameter_valuespec_memory_simple():
    return Transform(
        Dictionary(
            help=_(
                "Memory levels for simple devices not running more complex OSs"
            ),
            elements=[
                (
                    "levels",
                    CascadingDropdown(
                        title=_("Levels for RAM usage"),
                        choices=[
                            (
                                "perc_used",
                                _("Percentual levels for used RAM"),
                                Tuple(elements=[
                                    Percentage(
                                        title=_("Warning at a RAM usage of"),
                                        default_value=80.0,
                                        maxvalue=None,
                                    ),
                                    Percentage(
                                        title=_("Critical at a RAM usage of"),
                                        default_value=90.0,
                                        maxvalue=None,
                                    ),
                                ], ),
                            ),
                            (
                                "abs_free",
                                _("Absolute levels for free RAM"),
                                Tuple(elements=[
                                    Filesize(title=_("Warning below")),
                                    Filesize(title=_("Critical below")),
                                ], ),
                            ),
                        ],
                    ),
                ),
                (
                    "levels_swap",
                    CascadingDropdown(
                        title=_("Levels for swap usage"),
                        choices=[
                            (
                                "perc_used",
                                _("Percentual levels for used swap"),
                                Tuple(elements=[
                                    Percentage(
                                        title=_("Warning at a swap usage of"),
                                        maxvalue=None),
                                    Percentage(
                                        title=_("Critical at a swap usage of"),
                                        maxvalue=None),
                                ], ),
                            ),
                            (
                                "abs_free",
                                _("Absolute levels for free swap"),
                                Tuple(elements=[
                                    Filesize(title=_("Warning below")),
                                    Filesize(title=_("Critical below")),
                                ], ),
                            ),
                        ],
                    ),
                ),
                (
                    "swap_errors",
                    MonitoringState(
                        title=_("Monitoring state in case of swap errors"),
                        default_value=0,
                    ),
                ),
            ],
            optional_keys=True,
        ),
        # Convert default levels from discovered checks
        forth=lambda v: not isinstance(v, dict) and
        {"levels": ("perc_used", v)} or v,
    )
Beispiel #19
0
def _parameter_valuespec_ibm_svc_mdisk():
    return Dictionary(
        optional_keys=False,
        elements=[
            (
                "online_state",
                MonitoringState(
                    title=_("Resulting state if disk is online"),
                    default_value=0,
                ),
            ),
            (
                "degraded_state",
                MonitoringState(
                    title=_("Resulting state if disk is degraded"),
                    default_value=1,
                ),
            ),
            (
                "offline_state",
                MonitoringState(
                    title=_("Resulting state if disk is offline"),
                    default_value=2,
                ),
            ),
            (
                "excluded_state",
                MonitoringState(
                    title=_("Resulting state if disk is excluded"),
                    default_value=2,
                ),
            ),
            (
                "managed_mode",
                MonitoringState(
                    title=_("Resulting state if disk is in managed mode"),
                    default_value=0,
                ),
            ),
            (
                "array_mode",
                MonitoringState(
                    title=_("Resulting state if disk is in array mode"),
                    default_value=0,
                ),
            ),
            (
                "image_mode",
                MonitoringState(
                    title=_("Resulting state if disk is in image mode"),
                    default_value=0,
                ),
            ),
            (
                "unmanaged_mode",
                MonitoringState(
                    title=_("Resulting state if disk is in unmanaged mode"),
                    default_value=1,
                ),
            ),
        ],
    )
def _parameter_valuespec_systemd_services():
    return Dictionary(
        elements=[
            (
                "states",
                Dictionary(
                    title=_("Map systemd states to monitoring states"),
                    elements=[
                        (
                            "active",
                            MonitoringState(
                                title=_(
                                    "Monitoring state if service is active"),
                                default_value=0,
                            ),
                        ),
                        (
                            "inactive",
                            MonitoringState(
                                title=_(
                                    "Monitoring state if service is inactive"),
                                default_value=0,
                            ),
                        ),
                        (
                            "failed",
                            MonitoringState(
                                title=_(
                                    "Monitoring state if service is failed"),
                                default_value=2,
                            ),
                        ),
                    ],
                ),
            ),
            (
                "states_default",
                MonitoringState(
                    title=_("Monitoring state for any other service state"),
                    default_value=2,
                ),
            ),
            (
                "ignored",
                ListOf(
                    valuespec=RegExp(
                        title=_("Pattern (Regex)"),
                        size=40,
                        mode=RegExp.infix,
                    ),
                    title=_(
                        "Exclude services matching provided regex patterns"),
                    help=
                    _("<p>You can optionally define one or multiple regular expressions "
                      "where a matching case will result in the exclusion of the concerning service(s). "
                      "This allows to ignore services which are known to fail beforehand. </p>"
                      ),
                    add_label=_("Add pattern"),
                ),
            ),
            (
                "activating_levels",
                Tuple(
                    title=
                    _("Define a tolerating time period for activating services"
                      ),
                    help=
                    _("Choose time levels (in seconds) for which a service is allowed to be in an 'activating' state"
                      ),
                    elements=[
                        Integer(title=_("Warning at"),
                                unit=_("seconds"),
                                default_value=30),
                        Integer(title=_("Critical at"),
                                unit=_("seconds"),
                                default_value=60),
                    ],
                ),
            ),
            (
                "deactivating_levels",
                Tuple(
                    title=
                    _("Define a tolerating time period for deactivating services"
                      ),
                    help=
                    _("Choose time levels (in seconds) for which a service is allowed to be in an 'deactivating' state"
                      ),
                    elements=[
                        Integer(title=_("Warning at"),
                                unit=_("seconds"),
                                default_value=30),
                        Integer(title=_("Critical at"),
                                unit=_("seconds"),
                                default_value=60),
                    ],
                ),
            ),
            (
                "reloading_levels",
                Tuple(
                    title=_(
                        "Define a tolerating time period for reloading services"
                    ),
                    help=
                    _("Choose time levels (in seconds) for which a service is allowed to be in a 'reloading' state"
                      ),
                    elements=[
                        Integer(title=_("Warning at"),
                                unit=_("seconds"),
                                default_value=30),
                        Integer(title=_("Critical at"),
                                unit=_("seconds"),
                                default_value=60),
                    ],
                ),
            ),
        ],
        help=_(
            "This ruleset only applies to the Summary Systemd service and not the individual "
            "Systemd services."),
    )
Beispiel #21
0
 def parameter_valuespec(self):
     return Dictionary(
         elements=[
             ("minage_oldest",
              Tuple(
                  title=_("Minimal age of oldest file"),
                  elements=[
                      Age(title=_("Warning if younger than")),
                      Age(title=_("Critical if younger than")),
                  ],
              )),
             ("maxage_oldest",
              Tuple(
                  title=_("Maximal age of oldest file"),
                  elements=[
                      Age(title=_("Warning if older than")),
                      Age(title=_("Critical if older than")),
                  ],
              )),
             ("minage_newest",
              Tuple(
                  title=_("Minimal age of newest file"),
                  elements=[
                      Age(title=_("Warning if younger than")),
                      Age(title=_("Critical if younger than")),
                  ],
              )),
             ("maxage_newest",
              Tuple(
                  title=_("Maximal age of newest file"),
                  elements=[
                      Age(title=_("Warning if older than")),
                      Age(title=_("Critical if older than")),
                  ],
              )),
             ("minsize_smallest",
              Tuple(
                  title=_("Minimal size of smallest file"),
                  elements=[
                      Filesize(title=_("Warning if below")),
                      Filesize(title=_("Critical if below")),
                  ],
              )),
             ("maxsize_smallest",
              Tuple(
                  title=_("Maximal size of smallest file"),
                  elements=[
                      Filesize(title=_("Warning if above")),
                      Filesize(title=_("Critical if above")),
                  ],
              )),
             ("minsize_largest",
              Tuple(
                  title=_("Minimal size of largest file"),
                  elements=[
                      Filesize(title=_("Warning if below")),
                      Filesize(title=_("Critical if below")),
                  ],
              )),
             ("maxsize_largest",
              Tuple(
                  title=_("Maximal size of largest file"),
                  elements=[
                      Filesize(title=_("Warning if above")),
                      Filesize(title=_("Critical if above")),
                  ],
              )),
             ("minsize",
              Tuple(
                  title=_("Minimal size"),
                  elements=[
                      Filesize(title=_("Warning if below")),
                      Filesize(title=_("Critical if below")),
                  ],
              )),
             ("maxsize",
              Tuple(
                  title=_("Maximal size"),
                  elements=[
                      Filesize(title=_("Warning if above")),
                      Filesize(title=_("Critical if above")),
                  ],
              )),
             ("mincount",
              Tuple(
                  title=_("Minimal file count"),
                  elements=[
                      Integer(title=_("Warning if below")),
                      Integer(title=_("Critical if below")),
                  ],
              )),
             ("maxcount",
              Tuple(
                  title=_("Maximal file count"),
                  elements=[
                      Integer(title=_("Warning if above")),
                      Integer(title=_("Critical if above")),
                  ],
              )),
             ("timeofday",
              ListOfTimeRanges(
                  title=_("Only check during the following times of the day"),
                  help=_("Outside these ranges the check will always be OK"),
              )),
             ("conjunctions",
              ListOf(
                  Tuple(elements=[
                      MonitoringState(title=_("Monitoring state"), default_value=2),
                      ListOf(
                          CascadingDropdown(
                              orientation="hroizontal",
                              choices=[
                                  ("count", _("File count at"), Integer()),
                                  ("count_lower", _("File count below"), Integer()),
                                  ("size", _("File size at"), Filesize()),
                                  ("size_lower", _("File size below"), Filesize()),
                                  ("largest_size", _("Largest file size at"), Filesize()),
                                  ("largest_size_lower", _("Largest file size below"),
                                   Filesize()),
                                  ("smallest_size", _("Smallest file size at"), Filesize()),
                                  ("smallest_size_lower", _("Smallest file size below"),
                                   Filesize()),
                                  ("oldest_age", _("Oldest file age at"), Age()),
                                  ("oldest_age_lower", _("Oldest file age below"), Age()),
                                  ("newest_age", _("Newest file age at"), Age()),
                                  ("newest_age_lower", _("Newest file age below"), Age()),
                              ],
                          ),
                          magic="@#@#",
                      )
                  ],),
                  title=_("Level conjunctions"),
                  help=
                  _("In order to check dependent file group statistics you can configure "
                    "conjunctions of single levels now. A conjunction consists of a monitoring state "
                    "and any number of upper or lower levels. If all of the configured levels within "
                    "a conjunction are reached then the related state is reported."),
              )),
         ],
         ignored_keys=["precompiled_patterns"],
     )
Beispiel #22
0
 def valuespec(self):
     return Transform(
         Dictionary(elements=[
             ("sw_changes",
              MonitoringState(
                  title=_("State when software changes are detected"),
                  default_value=0,
              )),
             ("sw_missing",
              MonitoringState(
                  title=_("State when software packages info is missing"),
                  default_value=0,
              )),
             ("hw_changes",
              MonitoringState(
                  title=_("State when hardware changes are detected"),
                  default_value=0,
              )),
             ("fail_status",
              MonitoringState(
                  title=_("State when inventory fails"),
                  help=
                  _("The check takes this state in case the inventory cannot be "
                    "updated because of any possible reason. A common use is "
                    "setting this to OK for workstations that can be switched "
                    "off - so you will get no notifications in that case."),
                  default_value=1,
              )),
             ("status_data_inventory",
              DropdownChoice(
                  title=_("Status data inventory"),
                  help=
                  _("All hosts configured via this ruleset will do a hardware and "
                    "software inventory after every check cycle if there's at least "
                    "one inventory plugin which processes status data. "
                    "<b>Note:</b> in order to get any useful "
                    "result for agent based hosts make sure that you have installed "
                    "the agent plugin <tt>mk_inventory</tt> on these hosts."
                    ),
                  choices=[
                      (True, _("Do status data inventory")),
                      (False, _("Do not status data inventory")),
                  ],
                  default_value=True,
              )),
             ("host_label_inventory",
              DropdownChoice(
                  title=_("Host label discovery"),
                  help=
                  _("All hosts configured via this ruleset will try to find new "
                    "host labels during every check cycle."),
                  choices=[
                      (True, _("Do automatic host label discovery")),
                      (False,
                       _("Do not perform automatic host label discovery")),
                  ],
                  default_value=True,
              )),
         ]),
         title=_("Do hardware/software Inventory"),
         help=
         _("All hosts configured via this ruleset will do a hardware and "
           "software inventory. For each configured host a new active check "
           "will be created. You should also create a rule for changing the "
           "normal interval for that check to something between a couple of "
           "hours and one day. "
           "<b>Note:</b> in order to get any useful "
           "result for agent based hosts make sure that you have installed "
           "the agent plugin <tt>mk_inventory</tt> on these hosts."),
         forth=lambda x: x is not None and x or {
         },  # convert from legacy None
     )
Beispiel #23
0
def _parameter_valuespec_ipmi():
    return Dictionary(
        elements=[
            (
                "sensor_states",
                ListOf(
                    Tuple(elements=[TextInput(),
                                    MonitoringState()], ),
                    title=_("Set states of IPMI sensor status texts"),
                    help=_(
                        "The pattern specified here must match exactly the beginning of "
                        "the sensor state (case sensitive)."),
                ),
            ),
            (
                "ignored_sensors",
                ListOfStrings(
                    title=_(
                        "Ignore the following IPMI sensors (only summary)"),
                    help=
                    _("Names of IPMI sensors that should be ignored when summarizing."
                      "The pattern specified here must match exactly the beginning of "
                      "the actual sensor name (case sensitive)."),
                    orientation="horizontal",
                ),
            ),
            (
                "ignored_sensorstates",
                ListOfStrings(
                    title=_(
                        "Ignore the following IPMI sensor states (only summary)"
                    ),
                    help=
                    _("IPMI sensors with these states that should be ignored when summarizing."
                      "The pattern specified here must match exactly the beginning of "
                      "the actual sensor state (case sensitive)."),
                    orientation="horizontal",
                    default_value=["nr", "ns"],
                ),
            ),
            (
                "numerical_sensor_levels",
                ListOf(
                    Tuple(elements=[
                        TextInput(
                            title=_("Sensor name"),
                            help=
                            _("Enter the name of the sensor. In single mode, this can be read off "
                              "from the service descriptions of the services 'IPMI Sensor ...'."
                              ),
                        ),
                        Dictionary(elements=[
                            (
                                "lower",
                                Tuple(
                                    title=_("Lower levels"),
                                    elements=[
                                        Float(label=_("Warning at")),
                                        Float(label=_("Critical at")),
                                    ],
                                ),
                            ),
                            (
                                "upper",
                                Tuple(
                                    title=_("Upper levels"),
                                    elements=[
                                        Float(label=_("Warning at")),
                                        Float(label=_("Critical at")),
                                    ],
                                ),
                            ),
                        ], ),
                    ], ),
                    title=_(
                        "Set lower and upper levels for numerical sensors"),
                ),
            ),
        ],
        ignored_keys=["ignored_sensors", "ignored_sensor_states"],
    )
Beispiel #24
0
def _parameter_valuespec_graylog_sidecars():
    return Dictionary(elements=[
        (
            "active_state",
            MonitoringState(title=_("State when active state is not OK"),
                            default_value=2),
        ),
        (
            "last_seen",
            Tuple(
                title=_("Time since the sidecar was last seen by graylog"),
                elements=[
                    Age(title=_("Warning at")),
                    Age(title=_("Critical at"))
                ],
            ),
        ),
        (
            "running_lower",
            Tuple(
                title=_("Total number of collectors in state running lower "
                        "level"),
                elements=[
                    Integer(title=_("Warning if less then"),
                            unit="collectors",
                            default_value=1),
                    Integer(title=_("Critical if less then"),
                            unit="collectors",
                            default_value=0),
                ],
            ),
        ),
        (
            "running_upper",
            Tuple(
                title=_("Total number of collectors in state running upper "
                        "level"),
                elements=[
                    Integer(title=_("Warning at"), unit="collectors"),
                    Integer(title=_("Critical at"), unit="collectors"),
                ],
            ),
        ),
        (
            "stopped_lower",
            Tuple(
                title=_("Total number of collectors in state stopped lower "
                        "level"),
                elements=[
                    Integer(title=_("Warning if less then"),
                            unit="collectors"),
                    Integer(title=_("Critical if less then"),
                            unit="collectors"),
                ],
            ),
        ),
        (
            "stopped_upper",
            Tuple(
                title=_("Total number of collectors in state stopped upper "
                        "level"),
                elements=[
                    Integer(title=_("Warning at"),
                            unit="collectors",
                            default_value=1),
                    Integer(title=_("Critical at"),
                            unit="collectors",
                            default_value=1),
                ],
            ),
        ),
        (
            "failing_lower",
            Tuple(
                title=_("Total number of collectors in state failing lower "
                        "level"),
                elements=[
                    Integer(title=_("Warning if less then"),
                            unit="collectors"),
                    Integer(title=_("Critical if less then"),
                            unit="collectors"),
                ],
            ),
        ),
        (
            "failing_upper",
            Tuple(
                title=_("Total number of collectors in state failing upper "
                        "level"),
                elements=[
                    Integer(title=_("Warning at"),
                            unit="collectors",
                            default_value=1),
                    Integer(title=_("Critical at"),
                            unit="collectors",
                            default_value=1),
                ],
            ),
        ),
        (
            "running",
            MonitoringState(
                title=_("State when collector is in state running"),
                default_value=0),
        ),
        (
            "stopped",
            MonitoringState(
                title=_("State when collector is in state stopped"),
                default_value=1),
        ),
        (
            "failing",
            MonitoringState(
                title=_("State when collector is in state failing"),
                default_value=2),
        ),
        (
            "no_ping",
            MonitoringState(title=_("State when no ping signal from sidecar"),
                            default_value=2),
        ),
    ], )
Beispiel #25
0
 def parameter_valuespec(self):
     return Dictionary(
         elements=[
             ("if_in_octets",
              Levels(
                  title=_("Incoming Traffic Maximum"),
                  unit=_("bytes/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_in_octets_lower",
              Levels(
                  title=_("Incoming Traffic Minimum"),
                  unit=_("bytes/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_out_octets",
              Levels(
                  title=_("Outgoing Traffic Maximum"),
                  unit=_("bytes/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_out_octets_lower",
              Levels(
                  title=_("Outgoing Traffic Minimum"),
                  unit=_("bytes/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_total_octets",
              Levels(
                  title=_("Total Traffic Maximum"),
                  unit=_("bytes/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_total_octets_lower",
              Levels(
                  title=_("Total Traffic Minimum"),
                  unit=_("bytes/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_in_pkts",
              Levels(
                  title=_("Incoming Packets Maximum"),
                  unit=_("packets/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_in_pkts_lower",
              Levels(
                  title=_("Incoming Packets Minimum"),
                  unit=_("packets/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_out_pkts",
              Levels(
                  title=_("Outgoing Packets Maximum"),
                  unit=_("packets/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_out_pkts_lower",
              Levels(
                  title=_("Outgoing Packets Minimum"),
                  unit=_("packets/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_total_pkts",
              Levels(
                  title=_("Total Packets Maximum"),
                  unit=_("packets/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             ("if_total_pkts_lower",
              Levels(
                  title=_("Total Packets Minimum"),
                  unit=_("packets/s"),
                  default_difference=(5, 8),
                  default_value=None,
              )),
             (
                 "state",
                 Dictionary(
                     title=_("Map states"),
                     elements=[
                         ("is_disabled", MonitoringState(
                             title=_("Is disabled"), default_value=1)),
                         ("is_up_and_available",
                          MonitoringState(title=_("Is up and available"), default_value=0)),
                         ("is_currently_not_available",
                          MonitoringState(
                              title=_("Is currently not available"), default_value=2)),
                         ("is_not_available",
                          MonitoringState(title=_("Is not available"), default_value=2)),
                         ("availability_is_unknown",
                          MonitoringState(title=_("Availability is unknown"), default_value=1)),
                         ("is_unlicensed",
                          MonitoringState(title=_("Is unlicensed"), default_value=3)),
                         (
                             "children_pool_members_down_if_not_available",
                             # Special handling, see check plugin
                             MonitoringState(
                                 title=
                                 _("The children pool member(s) are down if VServer is not available"
                                  ),
                                 default_value=0)),
                     ],
                     optional_keys=False,
                 )),
         ],)
Beispiel #26
0
def _parameter_valuespec_threepar_ports():
    return Dictionary(elements=[
        ("1_link",
         MonitoringState(title=_("Link State: CONFIG_WAIT"), default_value=1)),
        ("2_link",
         MonitoringState(title=_("Link State: ALPA_WAIT"), default_value=1)),
        ("3_link",
         MonitoringState(title=_("Link State: LOGIN_WAIT"), default_value=1)),
        ("4_link",
         MonitoringState(title=_("Link State: READY"), default_value=0)),
        ("5_link",
         MonitoringState(title=_("Link State: LOSS_SYNC"), default_value=2)),
        ("6_link",
         MonitoringState(title=_("Link State: ERROR_STATE"), default_value=2)),
        ("7_link", MonitoringState(title=_("Link State: XXX"),
                                   default_value=1)),
        ("8_link",
         MonitoringState(title=_("Link State: NOPARTICIPATE"),
                         default_value=0)),
        ("9_link",
         MonitoringState(title=_("Link State: COREDUMP"), default_value=1)),
        ("10_link",
         MonitoringState(title=_("Link State: OFFLINE"), default_value=1)),
        ("11_link",
         MonitoringState(title=_("Link State: FWDEAD"), default_value=1)),
        ("12_link",
         MonitoringState(title=_("Link State: IDLE_FOR_RESET"),
                         default_value=1)),
        ("13_link",
         MonitoringState(title=_("Link State: DHCP_IN_PROGESS"),
                         default_value=1)),
        ("14_link",
         MonitoringState(title=_("Link State: PENDING_RESET"),
                         default_value=1)),
        ("1_fail",
         MonitoringState(title=_("Failover State: NONE"), default_value=0)),
        (
            "2_fail",
            MonitoringState(title=_("Failover State: FAILOVER_PENDING"),
                            default_value=2),
        ),
        ("3_fail",
         MonitoringState(title=_("Failover State: FAILED_OVER"),
                         default_value=2)),
        ("4_fail",
         MonitoringState(title=_("Failover State: ACTIVE"), default_value=2)),
        ("5_fail",
         MonitoringState(title=_("Failover State: ACTIVE_DOWN"),
                         default_value=2)),
        ("6_fail",
         MonitoringState(title=_("Failover State: ACTIVE_FAILED"),
                         default_value=2)),
        (
            "7_fail",
            MonitoringState(title=_("Failover State: FAILBACK_PENDING"),
                            default_value=1),
        ),
    ], )
Beispiel #27
0
def _parameter_valuespec_mssql_instance():
    return Dictionary(elements=[("map_connection_state",
                                 MonitoringState(title=_("Connection status"),
                                                 default_value=2))], )
Beispiel #28
0
def _parameter_valuespec_jenkins_queue():
    return Dictionary(elements=[
        (
            "queue_length",
            Tuple(
                title=_("Upper level for queue length"),
                elements=[
                    Integer(title=_("Warning at"), unit="Tasks"),
                    Integer(title=_("Critical at"), unit="Tasks"),
                ],
            ),
        ),
        (
            "in_queue_since",
            Tuple(
                title=_("Task in queue since"),
                elements=[
                    Age(title=_("Warning at"), default_value=3600),
                    Age(title=_("Critical at"), default_value=7200),
                ],
            ),
        ),
        (
            "stuck",
            MonitoringState(
                title=_("Task state: Stuck"),
                default_value=2,
            ),
        ),
        (
            "jenkins_stuck_tasks",
            Tuple(
                title=_("Upper level for stuck tasks"),
                elements=[
                    Integer(title=_("Warning at"),
                            unit="Tasks",
                            default_value=1),
                    Integer(title=_("Critical at"),
                            unit="Tasks",
                            default_value=2),
                ],
            ),
        ),
        (
            "blocked",
            MonitoringState(
                title=_("Task state: Blocked"),
                default_value=0,
            ),
        ),
        (
            "jenkins_blocked_tasks",
            Tuple(
                title=_("Upper level for blocked tasks"),
                elements=[
                    Integer(title=_("Warning at"), unit="Tasks"),
                    Integer(title=_("Critical at"), unit="Tasks"),
                ],
            ),
        ),
        ("pending",
         MonitoringState(title=_("Task state: Pending"), default_value=0)),
        (
            "jenkins_pending_tasks",
            Tuple(
                title=_("Upper level for pending tasks"),
                elements=[
                    Integer(title=_("Warning at or above"), unit="Tasks"),
                    Integer(title=_("Critical at or above"), unit="Tasks"),
                ],
            ),
        ),
    ], )
Beispiel #29
0
        ]
    ),
    None,
    "dict",
)

register_check_parameters(
    RulespecGroupCheckParametersNetworking,
    "checkpoint_tunnels",
    _("Checkpoint Tunnel Status"),
    Dictionary(
        elements=[
            (
                "Active",
                MonitoringState(
                    title=_("State when VPN status is Active"),
                    default_value=0,
                ),
            ),
            (
                "Destroy",
                MonitoringState(
                    title=_("State when VPN status is Destroy"),
                    default_value=1,
                ),
            ),
            (
                "Idle",
                MonitoringState(
                    title=_("State when VPN status is Idle"),
                    default_value=0,
                ),
def _parameter_valuespec_oracle_dataguard_stats():
    return Dictionary(
        help=_(
            "The Data-Guard statistics are available in Oracle Enterprise Edition with enabled Data-Guard. "
            "The <tt>init.ora</tt> parameter <tt>dg_broker_start</tt> must be <tt>TRUE</tt> for this check. "
            "The apply and transport lag can be configured with this rule."
        ),
        elements=[
            (
                "active_dataguard_option",
                MonitoringState(
                    title=_("State in case of Active Data-Guard Option is active: "),
                    help=_("The Active Data-Guard Option needs an addional License from Oracle."),
                    default_value=1,
                ),
            ),
            (
                "mrp_option",
                Tuple(
                    title=_("State in case Managed Recovery Process (MRP) is started or stopped"),
                    help=_(
                        "The MRP is usally started on each physical "
                        "standby node. But in some setups this may vary and the process should "
                        "only be started on specific or random nodes. Here you may define which "
                        "state a specific node or service should have in case the MRP is started "
                        "or stopped."
                    ),
                    elements=[
                        MonitoringState(title=_("State in case MRP is started"), default_value=0),
                        MonitoringState(title=_("State in case MRP is stopped"), default_value=2),
                    ],
                ),
            ),
            (
                "primary_broker_state",
                Checkbox(
                    title=_("Check State of Broker on Primary: "),
                    default_value=False,
                    help=_(
                        "Data-Guards with dg_broker_start=false needs Ignore Brokerstate to monitor "
                        "the Switchoverstate on Primary."
                    ),
                ),
            ),
            (
                "apply_lag",
                Tuple(
                    title=_("Apply Lag Maximum Time"),
                    help=_("The maximum limit for the apply lag in <tt>v$dataguard_stats</tt>."),
                    elements=[
                        Age(
                            title=_("Warning at"),
                        ),
                        Age(
                            title=_("Critical at"),
                        ),
                    ],
                ),
            ),
            (
                "apply_lag_min",
                Tuple(
                    title=_("Apply Lag Minimum Time"),
                    help=_(
                        "The minimum limit for the apply lag in <tt>v$dataguard_stats</tt>. "
                        "This is only useful if also <i>Apply Lag Maximum Time</i> has been configured."
                    ),
                    elements=[
                        Age(
                            title=_("Warning at"),
                        ),
                        Age(
                            title=_("Critical at"),
                        ),
                    ],
                ),
            ),
            (
                "transport_lag",
                Tuple(
                    title=_("Transport Lag"),
                    help=_("The limit for the transport lag in <tt>v$dataguard_stats</tt>"),
                    elements=[
                        Age(
                            title=_("Warning at"),
                        ),
                        Age(
                            title=_("Critical at"),
                        ),
                    ],
                ),
            ),
        ],
    )