def _parameter_valuespec_skype_xmpp(): return Dictionary(elements=[ ('failed_outbound_streams', Dictionary( title=_("XMPP Failed outbound stream establishes"), elements=[ ("upper", Tuple(elements=[ Float(title=_("Warning at"), unit=_("per second"), default_value=0.01), Float(title=_("Critical at"), unit=_("per second"), default_value=0.02), ], )), ], optional_keys=[], )), ('failed_inbound_streams', Dictionary( title=_("XMPP Failed inbound stream establishes"), elements=[ ("upper", Tuple(elements=[ Float(title=_("Warning at"), unit=_("per second"), default_value=0.01), Float(title=_("Critical at"), unit=_("per second"), default_value=0.02), ], )), ], optional_keys=[], )), ], )
def parameter_valuespec(self): return Dictionary( elements=[ ("sensor_states", ListOf( Tuple(elements=[TextAscii(), 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)."), orientation="horizontal", )), ("ignored_sensors", ListOfStrings( title=_("Ignore the following IPMI sensors"), help= _("Names of IPMI sensors that should be ignored during discovery " "and 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"), help= _("IPMI sensors with these states that should be ignored during discovery " "and when summarizing." "The pattern specified here must match exactly the beginning of " "the actual sensor name (case sensitive)."), orientation="horizontal", default_value=["nr", "ns"], )), ("numerical_sensor_levels", ListOf(Tuple(elements=[ TextAscii( title=_("Sensor name (only summary)"), help= _("In summary mode you have to state the sensor name. " "In single mode the sensor name comes from service description." )), Dictionary(elements=[ ("lower", Tuple( title=_("Lower levels"), elements=[Float(), Float()], )), ("upper", Tuple( title=_("Upper levels"), elements=[Float(), Float()], )), ], ), ], ), title=_( "Set lower and upper levels for numerical sensors") )), ], ignored_keys=["ignored_sensors", "ignored_sensor_states"], )
def _parameter_valuespec_docsis_channels_upstream(): return Dictionary(elements=[ ('signal_noise', Tuple( title=_("Levels for signal/noise ratio"), elements=[ Float(title=_("Warning at or below"), unit="dB", default_value=10.0), Float(title=_("Critical at or below"), unit="dB", default_value=5.0), ], )), ('correcteds', Tuple( title=_("Levels for rate of corrected errors"), elements=[ Percentage(title=_("Warning at"), default_value=5.0), Percentage(title=_("Critical at"), default_value=8.0), ], )), ('uncorrectables', Tuple( title=_("Levels for rate of uncorrectable errors"), elements=[ Percentage(title=_("Warning at"), default_value=1.0), Percentage(title=_("Critical at"), default_value=2.0), ], )), ],)
def _ntp_params(): return Tuple( title=_("Thresholds for quality of time"), elements=[ Integer( title=_("Critical at stratum"), default_value=10, help= _("The stratum (\"distance\" to the reference clock) at which the check gets critical." ), ), Float( title=_("Warning at"), unit=_("ms"), default_value=200.0, help=_( "The offset in ms at which a warning state is triggered."), ), Float( title=_("Critical at"), unit=_("ms"), default_value=500.0, help=_( "The offset in ms at which a critical state is triggered." ), ), ])
def parameter_valuespec(self): return Dictionary( title=_("Set Levels"), elements=[ ('latency', Tuple( title=_("Average latency for RPC requests"), elements=[ Float(title=_("Warning at"), unit=_('ms'), default_value=200.0), Float(title=_("Critical at"), unit=_('ms'), default_value=250.0) ], )), ('requests', Tuple( title=_("Maximum number of RPC requests per second"), elements=[ Integer(title=_("Warning at"), unit=_('requests'), default_value=30), Integer(title=_("Critical at"), unit=_('requests'), default_value=40) ], )) ], optional_keys=[], )
def _parameter_valuespec_varnish_objects(): return Dictionary(elements=[ ("expired", Tuple( title=_("Upper levels for \"expired objects\" per second"), elements=[ Float(title=_("Warning at"), default_value=1.0, allow_empty=False), Float(title=_("Critical at"), default_value=2.0, allow_empty=False) ], )), ("lru_nuked", Tuple( title=_("Upper levels for \"LRU nuked objects\" per second"), elements=[ Float(title=_("Warning at"), default_value=1.0, allow_empty=False), Float(title=_("Critical at"), default_value=2.0, allow_empty=False) ], )), ], )
def _parameter_valuespec_docsis_cm_status(): return Dictionary(elements=[ ("error_states", ListChoice( title=_("Modem States that lead to a critical state"), help=_( "If one of the selected states occurs the check will repsond with a critical state " ), choices=[ (1, "other"), (2, "notReady"), (3, "notSynchronized"), (4, "phySynchronized"), (5, "usParametersAcquired"), (6, "rangingComplete"), (7, "ipComplete"), (8, "todEstablished"), (9, "securityEstablished"), (10, "paramTransferComplete"), (11, "registrationComplete"), (12, "operational"), (13, "accessDenied"), ], default_value=[1, 2, 13], )), ("tx_power", Tuple( title=_("Transmit Power"), help=_("The operational transmit power"), elements=[ Float(title=_("warning at"), unit="dBmV", default_value=20.0), Float(title=_("critical at"), unit="dBmV", default_value=10.0), ], )), ],)
def parameter_valuespec(self): return Dictionary(elements=[ ("level_low", Tuple(title=_("Lower levels"), elements=[ Float(title=_("Warning if below"), unit=_("l/s"), default_value=5.0, allow_int=True), Float(title=_("Critical if below"), unit=_("l/s"), default_value=2.0, allow_int=True) ])), ("level_high", Tuple(title=_("Upper levels"), elements=[ Float(title=_("Warning at"), unit=_("l/s"), default_value=10.0, allow_int=True), Float(title=_("Critical at"), unit=_("l/s"), default_value=11.0, allow_int=True) ])), ], )
def _parameter_valuespec_mcafee_web_gateway(): return Dictionary(elements=[ ( "infections", Tuple( title=_("Upper levels for infections"), help=_( "Here you can specify upper levels for the number of " "infections detected by the McAfee Gateway Antimalware Engine." ), elements=[ Float(title=_("Warning at")), Float(title=_("Critical at")), ], ), ), ( "connections_blocked", Tuple( title=_("Upper levels for blocked connections"), elements=[ Float(title=_("Warning at")), Float(title=_("Critical at")), ], ), ), ], )
def _parameter_valuespec_db2_counters(): return Dictionary( help=_( "This rule allows you to configure limits for the deadlocks and lockwaits " "counters of a DB2."), elements=[ ( "deadlocks", Tuple( title=_("Deadlocks"), elements=[ Float(title=_("Warning at"), unit=_("deadlocks/sec")), Float(title=_("Critical at"), unit=_("deadlocks/sec")), ], ), ), ( "lockwaits", Tuple( title=_("Lockwaits"), elements=[ Float(title=_("Warning at"), unit=_("lockwaits/sec")), Float(title=_("Critical at"), unit=_("lockwaits/sec")), ], ), ), ], )
def _parameter_valuespec_msx_info_store(): return Dictionary( title=_("Set Levels"), elements=[('store_latency', Tuple( title=_("Average latency for store requests"), elements=[ Float(title=_("Warning at"), unit=_('ms'), default_value=40.0), Float(title=_("Critical at"), unit=_('ms'), default_value=50.0) ], )), ('clienttype_latency', Tuple( title=_("Average latency for client type requests"), elements=[ Float(title=_("Warning at"), unit=_('ms'), default_value=40.0), Float(title=_("Critical at"), unit=_('ms'), default_value=50.0) ], )), ('clienttype_requests', Tuple( title=_("Maximum number of client type requests per second"), elements=[ Integer(title=_("Warning at"), unit=_('requests'), default_value=60), Integer(title=_("Critical at"), unit=_('requests'), default_value=70) ], ))], optional_keys=[], )
def _parameter_valuespec_sap_dialog(): return Dictionary(elements=[ ("UsersLoggedIn", Tuple( title=_("Number of Loggedin Users"), elements=[ Integer(title=_("Warning at"), label=_("Users")), Integer(title=_("Critical at"), label=_("Users")) ], )), ("FrontEndNetTime", Tuple( title=_("Frontend net time"), elements=[ Float(title=_("Warning at"), unit=_('ms')), Float(title=_("Critical at"), unit=_('ms')) ], )), ("ResponseTime", Tuple( title=_("Response Time"), elements=[ Float(title=_("Warning at"), unit=_('ms')), Float(title=_("Critical at"), unit=_('ms')) ], )), ], )
def parameter_valuespec(self): return Dictionary(elements=[ ("errors", Tuple( title=_("Upper levels for \"ESI errors\" per second"), elements=[ Float(title=_("Warning at"), default_value=1.0, allow_empty=False), Float(title=_("Critical at"), default_value=2.0, allow_empty=False) ], )), ("warnings", Tuple( title=_("Upper levels for \"ESI warnings\" per second"), elements=[ Float(title=_("Warning at"), default_value=1.0, allow_empty=False), Float(title=_("Critical at"), default_value=2.0, allow_empty=False) ], )), ], )
def _parameter_valuespec_safenet_hsm_operstats(): return Dictionary(elements=[ ("error_rate", Tuple( title=_("Error rate"), elements=[ Float(title=_("Warning at"), default_value=0.01, unit=_("1/s")), Float(title=_("Critical at"), default_value=0.05, unit=_("1/s")), ], )), ("request_rate", Levels( title=_("Request rate"), unit=_("1/s"), default_value=None, )), ("operation_errors", Tuple( title=_("Operation errors"), help= _("Sets levels on total operation errors since last counter reset." ), elements=[ Integer(title=_("Warning at"), default_value=0), Integer(title=_("Critical at"), default_value=1), ], )), ], )
def _parameter_valuespec_voltage(): return Dictionary( title=_("Voltage Sensor"), optional_keys=True, elements=[ ("levels", Tuple( title=_("Upper Levels for Voltage"), elements=[ Float(title=_("Warning at"), default_value=15.00, unit="V"), Float(title=_("Critical at"), default_value=16.00, unit="V"), ], )), ("levels_lower", Tuple( title=_("Lower Levels for Voltage"), elements=[ Float(title=_("Warning below"), default_value=10.00, unit="V"), Float(title=_("Critical below"), default_value=9.00, unit="V"), ], )), ], )
def parameter_valuespec(self): return Dictionary(elements=[ ("read", Tuple( title=_("Read throughput"), elements=[ Float(title=_("warning at"), unit=_("MB/s")), Float(title=_("critical at"), unit=_("MB/s")) ], )), ("write", Tuple( title=_("Write throughput"), elements=[ Float(title=_("warning at"), unit=_("MB/s")), Float(title=_("critical at"), unit=_("MB/s")) ], )), ("average", Integer( title=_("Average"), help= _("When averaging is set, a floating average value " "of the disk throughput is computed and the levels for read " "and write will be applied to the average instead of the current " "value."), minvalue=1, default_value=5, unit=_("minutes"))) ], )
def _parameter_valuespec_msx_rpcclientaccess(): return Dictionary( title=_("Set Levels"), elements=[ ( "latency", Tuple( title=_("Average latency for RPC requests"), elements=[ Float(title=_("Warning at"), unit=_("ms"), default_value=200.0), Float(title=_("Critical at"), unit=_("ms"), default_value=250.0), ], ), ), ( "requests", Tuple( title=_("Maximum number of RPC requests per second"), elements=[ Integer(title=_("Warning at"), unit=_("requests"), default_value=30), Integer(title=_("Critical at"), unit=_("requests"), default_value=40), ], ), ), ], optional_keys=[], )
def liveproxyd_connection_params_elements(cls): defaults = ConfigDomainLiveproxy.connection_params_defaults() return [ ("channels", Integer( title=_("Number of channels to keep open"), minvalue=2, maxvalue=50, default_value=defaults["channels"], )), ("heartbeat", Tuple(title=_("Regular heartbeat"), orientation="float", elements=[ Integer( label=_("One heartbeat every"), unit=_("sec"), minvalue=1, default_value=defaults["heartbeat"][0], ), Float(label=_("with a timeout of"), unit=_("sec"), minvalue=0.1, default_value=defaults["heartbeat"][1], display_format="%.1f"), ])), ("channel_timeout", Float( title=_("Timeout waiting for a free channel"), minvalue=0.1, default_value=defaults["channel_timeout"], unit=_("sec"), )), ("query_timeout", Float( title=_("Total query timeout"), minvalue=0.1, unit=_("sec"), default_value=defaults["query_timeout"], )), ("connect_retry", Float( title=_("Cooling period after failed connect/heartbeat"), minvalue=0.1, unit=_("sec"), default_value=defaults["connect_retry"], )), ("cache", Checkbox( title=_("Enable Caching"), label=_("Cache several non-status queries"), help= _("This option will enable the caching of several queries that " "need no current data. This reduces the number of Livestatus " "queries to sites and cuts down the response time of remote " "sites with large latencies."), default_value=defaults["cache"], )), ]
def parameter_valuespec(self): return Dictionary(elements=[ ("state", MonitoringState( title=_("State if at least one blocked session"), default_value=2, )), ("waittime", Tuple( title=_("Levels for wait"), help=_("The threshholds for wait_duration_ms. Will " "overwrite the default state set above."), default_value=(0, 0), elements=[ Float(title=_("Warning at"), unit=_("seconds"), display_format="%.3f"), Float(title=_("Critical at"), unit=_("seconds"), display_format="%.3f"), ], )), ("ignore_waittypes", DualListChoice( title=_("Ignore wait types"), rows=40, choices=[(entry, entry) for entry in mssql_waittypes], )), ], )
def parameter_valuespec(self): return Dictionary(elements=[ ("drop", Tuple( title=_("Upper levels for \"clients dropped\" per second"), elements=[ Float(title=_("Warning at"), default_value=1.0, allow_empty=False), Float(title=_("Critical at"), default_value=2.0, allow_empty=False) ], )), ("req", Tuple( title=_("Upper levels for \"client requests\" per second"), elements=[ Float(title=_("Warning at"), default_value=1.0, allow_empty=False), Float(title=_("Critical at"), default_value=2.0, allow_empty=False) ], )), ], )
def _parameter_valuespec_jvm_gc(): return Transform( valuespec=Dictionary( help=_("This ruleset also covers Tomcat, Jolokia and JMX. "), elements=[ ( "collection_time", Tuple( title=_("Time spent collecting garbage in percent"), elements=[ Percentage(title=_("Warning at")), Percentage(title=_("Critical at")), ], ), ), ( "collection_count", Tuple( title=_("Count of garbage collections per second"), elements=[ Float(title=_("Warning at")), Float(title=_("Critical at")), ], ), ), ], ), forth=transform_units, )
def _parameter_valuespec_fanspeed(): return Transform( Dictionary(elements=[ ( "levels", Transform( Tuple( title=_("Upper levels for the fan speed"), elements=[ Float(title=_("Warning at"), unit=u"rpm", default_value=12000), Float(title=_("Critical at"), unit=u"rpm", default_value=15000), ], ), forth=lambda elems: (float(elems[0]), float(elems[1])), ), ), ( "levels_lower", Transform( Tuple( title=_("Lower levels for the fan speed"), elements=[ Float(title=_("Warning below"), unit=u"rpm", default_value=300), Float(title=_("Critical below"), unit=u"rpm", default_value=100), ], ), forth=lambda elems: (float(elems[0]), float(elems[1])), ), ), ("device_levels_handling", DropdownChoice( title=_( "Interpretation of the device's own fan speed status"), choices=[ ("usr", _("Ignore device's own levels")), ("dev", _("Only use device's levels, ignore yours")), ("best", _("Use least critical of your and device's levels")), ("worst", _("Use most critical of your and device's levels")), ("devdefault", _("Use device's levels if present, otherwise yours")), ("usrdefault", _("Use your own levels if present, otherwise the device's" )), ], default_value="usrdefault", )), ], ), forth=lambda v: isinstance(v, tuple) and {"levels": v} or v, )
def _parameter_valuespec_prometheus_custom(): return Dictionary( elements=[ ("metric_list", ListOf( Dictionary( elements=[ ("metric_label", TextInput( title=_('Metric label'), allow_empty=False, help=_( 'The defined levels will only apply if the metric label matches the one ' 'specified in the custom Prometheus service.'), )), ("levels", Dictionary( elements=[ ("lower_levels", Tuple(title=_("Lower levels"), elements=[ Float(title=_("Warning below")), Float(title=_("Critical below")), ])), ("upper_levels", Tuple( title=_("Upper levels"), elements=[ Float(title=_("Warning at")), Float(title=_("Critical at")), ], )), ], validate=_verify_empty, )), ], optional_keys=[], ), title=_('Metric levels'), add_label=_("Add metric level"), allow_empty=False, help= _("Specify upper and/or lower levels for a queried PromQL value. The matching happens " "on a 2-level basis: First on the service description level where the regular " "expression allows to target multiple services at once. Specify the regular " "expression in the Conditions section below. A service can consist of multiple " "metrics and you can add levels to each queried metric value. For the relevant " "service, levels to the metric value will only apply if the metric label matches " "the label specified in the custom Prometheus service definition. Levels for the " "Prometheus custom check can be defined at two places: in the Prometheus Datasource " "rule and here. The ruleset here always has priority over the levels defined in the " "Datasource rule."), )), ], optional_keys=[], title=_('Levels for Prometheus services'), help=_("This rule allows you to configure levels for the Prometheus custom check targeting " "specific service metric values"), )
def ceph_epoch_element(title): return [("epoch", Tuple(title=title, elements=[ Float(title=_("Warning at")), Float(title=_("Critical at")), Integer(title=_("Average interval"), unit=_("minutes")), ]))]
def _float_tuple(title): return Tuple( title=title, elements=[ Float(title="Warning", unit="/s"), Float(title="Critical", unit="/s"), ], )
def _parameter_valuespec_read_hits() -> Tuple: return Tuple( title=_("Prefetch hits"), elements=[ Float(title=_("Warning below"), default_value=95.0), Float(title=_("Critical below"), default_value=90.0), ], )
def _float_tuple(title): return Tuple( title=title, elements=[ Float(title='Warning', unit='/s'), Float(title='Critical', unit='/s'), ], )
def parameter_valuespec(self): return Dictionary( help=_("This rule set is for configuring levels for global packet counters."), elements=[ ("average", Integer( title=_("Averaging"), help=_( "When this option is activated then the packet rates are being " "averaged <b>before</b> the levels are being applied. Setting this to zero will " "deactivate averaging."), unit=_("minutes"), default_value=3, minvalue=1, label=_("Compute average over last "), )), ("fragment", Tuple( title=_("Levels for rate of fragmented packets"), elements=[ Float(title=_("Warning at"), unit=_("pkts/s"), default_value=100.0), Float(title=_("Critical at"), unit=_("pkts/s"), default_value=10000.0), ], )), ("normalized", Tuple( title=_("Levels for rate of normalized packets"), elements=[ Float(title=_("Warning at"), unit=_("pkts/s"), default_value=100.0), Float(title=_("Critical at"), unit=_("pkts/s"), default_value=10000.0), ], )), ("badoffset", Tuple( title=_("Levels for rate of packets with bad offset"), elements=[ Float(title=_("Warning at"), unit=_("pkts/s"), default_value=100.0), Float(title=_("Critical at"), unit=_("pkts/s"), default_value=10000.0), ], )), ("short", Tuple( title=_("Levels for rate of short packets"), elements=[ Float(title=_("Warning at"), unit=_("pkts/s"), default_value=100.0), Float(title=_("Critical at"), unit=_("pkts/s"), default_value=10000.0), ], )), ("memdrop", Tuple( title=_("Levels for rate of packets dropped due to memory limitations"), elements=[ Float(title=_("Warning at"), unit=_("pkts/s"), default_value=100.0), Float(title=_("Critical at"), unit=_("pkts/s"), default_value=10000.0), ], )), ], )
def _parameter_valuespec_timesyncd_time(): return Dictionary(elements=[ ("stratum_level", Integer(title=_("Critical at stratum"), default_value=10)), ("quality_levels", Tuple( title=_("Thresholds for quality of time"), elements=[ Float( title=_("Warning at"), unit=_("ms"), default_value=200, help= _("The offset in s at which a warning state is triggered." ), ), Float( title=_("Critical at"), unit=_("ms"), default_value=500, help= _("The offset in s at which a critical state is triggered." ), ) ])), ("alert_delay", Tuple(title=_("Phases without synchronization"), elements=[ Age( title=_("Warning at"), display=["hours", "minutes"], default_value=300, ), Age( title=_("Critical at"), display=["hours", "minutes"], default_value=3600, ), ])), ("last_synchronized", Tuple( title=_("Allowed duration since last synchronisation"), help=_(""), elements=[ Age( title=_("Warning at"), display=["hours", "minutes"], default_value=3600, ), Age( title=_("Critical at"), display=["hours", "minutes"], default_value=7200, ), ], )) ])
def _parameter_valuespec_aws_elbv2_lcu(): return Dictionary(elements=[ ('levels', Tuple(title=_('Upper levels for load balancer capacity units'), elements=[ Float(title=_('Warning at')), Float(title=_('Critical at')), ])), ])