default_value=2, title=_("State if tunnel is not found"), ) ], ), add_label=_("Add tunnel"), movable=False, title=_("VPN tunnel specific configuration"), )), ("state", MonitoringState( title=_( "Default state to report when tunnel can not be found anymore" ), help=_( "Default state if a tunnel, which is not listed above in this rule, " "can no longer be found."), )), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="vpn_tunnel", group=RulespecGroupCheckParametersNetworking, item_spec=lambda: TextAscii(title=_("IP-Address of Tunnel Endpoint")), match_type="dict", parameter_valuespec=_parameter_valuespec_vpn_tunnel, title=lambda: _("VPN Tunnel"), ))
elements=[ Tuple( title=_("Percentual levels (in relation to policy speed)"), elements=[ Percentage(title=_("Warning at"), maxvalue=1000, label=_("% of port speed")), Percentage(title=_("Critical at"), maxvalue=1000, label=_("% of port speed")), ], ), Tuple(elements=[ Integer(title=_("Warning at"), size=8, label=_("bits / bytes per second")), Integer(title=_("Critical at"), size=8, label=_("bits / bytes per second")), ],) ], )), ],) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="cisco_qos", group=RulespecGroupCheckParametersNetworking, item_spec=lambda: TextAscii(title=_("port specification"), allow_empty=False), match_type="dict", parameter_valuespec=_parameter_valuespec_cisco_qos, title=lambda: _("Cisco quality of service"), ))
], )), ("maxcount", Tuple( title=_("Maximal file count"), elements=[ Integer(title=_("Warning if above")), Integer(title=_("Critical if above")), ], )), ], help= _("Here you can impose various levels the results reported by the" " mk_filstats plugin. Note that some levels only apply to a matching" " putput format (e.g. max/min count levels are not applied if only the" " smallest, largest, oldes and newest file is reported). In order to" " receive the required data, you must configure the plugin mk_filestats." ), ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="filestats", group=RulespecGroupCheckParametersStorage, item_spec=_item_spec_filestats, match_type="dict", parameter_valuespec=_parameter_valuespec_filestats, title=lambda: _("Size, age and count of file groups (mk_filestats)"), ))
FixedValue( False, title=_("All must be online"), totext="", ), Tuple( title=_("Specify levels"), elements=[ Integer(title=_("Warning below"), minvalue=-1, unit=_("online canisters")), Integer(title=_("Critical below"), minvalue=-1, unit=_("online canisters")), ], ), ], )) ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="ibm_svc_enclosure", group=RulespecGroupCheckParametersStorage, item_spec=_item_spec_ibm_svc_enclosure, match_type="dict", parameter_valuespec=_parameter_valuespec_ibm_svc_enclosure, title=lambda: _("IBM SVC Enclosure"), ))
title=_("Map device state"), help= _("Here you can enter either device state number (eg. from SNMP devices) " "or exact device state name and the related monitoring state." ), )), ], ignored_keys=['_item_key'], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="el_inphase", group=RulespecGroupCheckParametersEnvironment, item_spec=_item_spec_el_inphase, match_type="dict", parameter_valuespec=_parameter_valuespec_el_inphase, title=lambda: _("Parameters for input phases of UPSs and PDUs"), )) def _item_spec_ups_outphase(): return TextInput( title=_("Output Name"), help=_("The name of the output, e.g. <tt>Phase 1</tt>/<tt>PDU 1</tt>")) def _transform_parameter_valuespec_ups_outphase( params: Dict[str, Any]) -> Dict[str, Any]: changed_keys = {"load": "output_load"} return {changed_keys.get(k, k): v for k, v in params.items()}
from cmk.gui.valuespec import Dictionary, Percentage, TextInput, Tuple def _parameter_valuespec_printer_output(): return Dictionary( elements=[ ( "capacity_levels", Tuple( title=_("Capacity filled"), elements=[ Percentage(title=_("Warning at"), default_value=0.0), Percentage(title=_("Critical at"), default_value=0.0), ], ), ), ], default_keys=["capacity_levels"], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="printer_output", group=RulespecGroupCheckParametersPrinters, item_spec=lambda: TextInput(title=_("Unit Name"), allow_empty=True), match_type="dict", parameter_valuespec=_parameter_valuespec_printer_output, title=lambda: _("Printer Output Units"), ))
Integer(title=_("Warning at"), unit=_("per second"), default_value=20), Integer(title=_("Critical at"), unit=_("per second"), default_value=40), ],)), ], optional_keys=[], )), ('packets_dropped', Dictionary( title=_("Packets Dropped"), elements=[ ("upper", Tuple(elements=[ Integer(title=_("Warning at"), unit=_("per second"), default_value=200), Integer(title=_("Critical at"), unit=_("per second"), default_value=400), ],)), ], optional_keys=[], )), ],) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="skype_edge", group=RulespecGroupCheckParametersApplications, item_spec=_item_spec_skype_edge, match_type="dict", parameter_valuespec=_parameter_valuespec_skype_edge, title=lambda: _("Skype for Business Edge"), ))
) def _item_cohesity_node_status(): return TextAscii( title=_("Node"), help=_("Name of node"), ) def _parameter_valuespec_cohesity_node_status(): return Dictionary(elements=[ ('services', ListOfStrings( title=_("Services to ignore"), help=_("Specify all services to ignore"), valuespec=TextUnicode(), )), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="cohesity_node_status", group=RulespecGroupCheckParametersApplications, match_type="dict", item_spec=_item_cohesity_node_status, parameter_valuespec=_parameter_valuespec_cohesity_node_status, title=lambda: _("Cohesity node status ignored services"), ))
optional_keys=False, elements=[ ( "user", Checkbox( title=_("Monitor user quotas"), label=_("Enable"), default_value=True, ), ), ( "group", Checkbox( title=_("Monitor group quotas"), label=_("Enable"), ), ), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="lnx_quota", group=RulespecGroupCheckParametersApplications, item_spec=_item_spec_lnx_quota, match_type="dict", parameter_valuespec=_parameter_valuespec_lnx_quota, title=lambda: _("Linux quota check"), ))
Tuple( title=_("Upper absolute levels"), elements=[ Filesize(title=_("Warning at")), Filesize(title=_("Critical at")) ], ), Tuple( title=_("Upper percentage levels"), elements=[ Percentage(title=_("Warning at")), Percentage(title=_("Critical at")) ], ), ], )), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="mssql_file_sizes", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextAscii(title=_("Service descriptions"), allow_empty=False), match_type="dict", parameter_valuespec=_parameter_valuespec_mssql_file_sizes, title=lambda: _("MSSQL Log and Data File Sizes"), ))
from cmk.gui.plugins.wato import ( CheckParameterRulespecWithItem, rulespec_registry, RulespecGroupCheckParametersApplications, ) def _parameter_valuespec_veeam_backup(): return Dictionary(elements=[("age", Tuple( title=_("Time since end of last backup"), elements=[ Age(title=_("Warning if older than"), default_value=108000), Age(title=_("Critical if older than"), default_value=172800) ], ))], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="veeam_backup", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextAscii(title=_("Job name")), match_type="dict", parameter_valuespec=_parameter_valuespec_veeam_backup, title=lambda: _("Veeam: Time since last Backup"), ))
) def _parameter_valuespec_mysql_slave(): return Dictionary(elements=[ ("seconds_behind_master", Tuple( title=_("Max. time behind the master"), help=_( "Compares the time which the slave can be behind the master. " "This rule makes the check raise warning/critical states if the time is equal to " "or above the configured levels."), elements=[ Age(title=_("Warning at")), Age(title=_("Critical at")), ], )), ], optional_keys=False) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="mysql_slave", group=RulespecGroupCheckParametersApplications, item_spec=_item_spec_mysql_slave, match_type="dict", parameter_valuespec=_parameter_valuespec_mysql_slave, title=lambda: _("MySQL Slave"), ))
help= _("Here you can override the default levels for the ORACLE Processes check. The levels " "are applied on the number of used processes in percentage of the configured limit." ), elements=[ ("levels", Tuple( title=_("Levels for used processes"), elements=[ Percentage(title=_("Warning if more than"), default_value=70.0), Percentage(title=_("Critical if more than"), default_value=90.0) ], )), ], optional_keys=False, ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="oracle_processes", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextInput( title=_("Database SID"), size=12, allow_empty=False), match_type="dict", parameter_valuespec=_parameter_valuespec_oracle_processes, title=lambda: _("Oracle Processes"), ))
Tuple( elements=[ Float(title=_("Frequencies up to"), unit=u"MHz"), Float(title=_("Warning below"), unit=u"V"), Float(title=_("Critical below"), unit=u"V"), Float(title=_("Warning at or above"), unit=u"V"), Float(title=_("Critical at or above"), unit=u"V"), ], ), title=_("Lock voltages for TX PLL"), help= _("Specify frequency ranges by the upper boundary of the range " "to which the voltage levels are to apply. The list is sorted " "automatically when saving."), movable=False)), ], optional_keys=["rx", "tx"], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="pll_lock_voltage", group=RulespecGroupCheckParametersEnvironment, item_spec=lambda: DropdownChoice(title=_("RX/TX"), choices=[("RX", _("RX")), ("TX", _("TX"))]), match_type="dict", parameter_valuespec=_parameter_valuespec_pll_lock_voltage, title=lambda: _("Lock Voltage for PLLs"), ))
("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)), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="threepar_ports", group=RulespecGroupCheckParametersNetworking, item_spec=lambda: TextAscii(title=_("Port"), help=_("The Port Description")), match_type="dict", parameter_valuespec=_parameter_valuespec_threepar_ports, title=lambda: _("3PAR Ports"), ))
("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, ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="if", group=RulespecGroupCheckParametersNetworking, item_spec=_item_spec_if, match_type="dict", parameter_valuespec=_parameter_valuespec_if, title=lambda: _("Network interfaces and switch ports"), )) def _parameter_valuespec_k8s_if(): return Dictionary(elements=[ ("errors", Alternative( title=_("Levels for error rates"), help=_( "These levels make the check go warning or critical whenever the " "<b>percentual error rate</b> or the <b>absolute error rate</b> of the monitored interface reaches " "the given bounds. The percentual error rate is computed by dividing number of " "errors by the total number of packets (successful plus errors)."),
], )), ("msg_publish_rate_lower", Tuple( title=_("Lower level for published message rate"), elements=[ Float(title=_("Warning below"), unit="1/s"), Float(title=_("Critical below"), unit="1/s"), ], )), ("abs_memory", Tuple( title=_("Absolute levels for used memory"), elements=[ Filesize(title=_("Warning at")), Filesize(title=_("Critical at")), ], )), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="rabbitmq_queues", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextInput(title=_("Queue name")), match_type="dict", parameter_valuespec=_parameter_valuespec_rabbitmq_queues, title=lambda: _("RabbitMQ queues"), ))
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")), ], ), ), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="db2_counters", group=RulespecGroupCheckParametersApplications, item_spec=_item_spec_db2_counters, match_type="dict", parameter_valuespec=_parameter_valuespec_db2_counters, title=lambda: _("DB2 Counters"), ))
)), 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"], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="ipmi", group=RulespecGroupCheckParametersEnvironment, item_spec=lambda: TextAscii(title=_("The sensor name")), match_type="dict", parameter_valuespec=_parameter_valuespec_ipmi, title=lambda: _("IPMI sensors"), ))
RulespecGroupCheckParametersEnvironment, ) from cmk.gui.valuespec import Integer, TextInput, Tuple def _item_spec_evolt(): return TextInput( title=_("Phase"), help=_("The identifier of the phase the power is related to.")) def _parameter_valuespec_evolt(): return Tuple( help=_("Voltage Levels for devices like UPS or PDUs. " "Several phases may be addressed independently."), elements=[ Integer(title=_("warning if below"), unit="V", default_value=210), Integer(title=_("critical if below"), unit="V", default_value=180), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="evolt", group=RulespecGroupCheckParametersEnvironment, item_spec=_item_spec_evolt, parameter_valuespec=_parameter_valuespec_evolt, title=lambda: _("Voltage levels (UPS / PDU / Other Devices)"), ))
elements=[ ('curr_items', _int_tuple(_('Levels for active items'))), ('non_residents', _int_tuple(_('Levels for non-resident items'))), ('curr_items_tot', _int_tuple(_('Levels for total number of items'))), ('fetched_items', _int_tuple( _('Buckets only: Levels for number of items fetched from disk' ))), ('disk_write_ql', _int_tuple( _('Buckets only: Levels for length of disk write queue'))), ('disk_fill_rate', _float_tuple(_('Buckets only: Levels for disk queue fill rate'))), ('disk_drain_rate', _float_tuple( _('Buckets only: Levels for disk queue drain rate'))), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="couchbase_items", group=RulespecGroupCheckParametersApplications, match_type="dict", item_spec=lambda: TextInput(title=_('Node or Bucket name')), parameter_valuespec=_parameter_valuespec_couchbase_operations, title=lambda: _("Couchbase Items"), ))
("queueSize", Tuple( title=_("Size of the queue"), elements=[ Integer(title=_("Warning at")), Integer(title=_("Critical at")), ], )), ("deferredMessages", Tuple( title=_("Number of messages in deferred state"), elements=[ Integer(title=_("Warning at")), Integer(title=_("Critical at")), ], )), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="sym_brightmail_queues", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextInput(title=_("Instance name"), allow_empty=True ), match_type="dict", parameter_valuespec=_parameter_valuespec_sym_brightmail_queues, title=lambda: _("Symantec Brightmail Queues"), ))
TextAscii, ) from cmk.gui.plugins.wato import ( CheckParameterRulespecWithItem, rulespec_registry, RulespecGroupCheckParametersEnvironment, ) def _parameter_valuespec_switch_contact(): return DropdownChoice( help=_("This rule sets the required state of a switch contact"), label=_("Required switch contact state"), choices=[ ("open", "Switch contact is <b>open</b>"), ("closed", "Switch contact is <b>closed</b>"), ("ignore", "Ignore switch contact state"), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="switch_contact", group=RulespecGroupCheckParametersEnvironment, item_spec=lambda: TextAscii(title=_("Sensor"), allow_empty=False), parameter_valuespec=_parameter_valuespec_switch_contact, title=lambda: _("Switch contact state"), ))
return TextAscii( title=_("Module Name"), help=_("The identificator of the module."), ) def _parameter_valuespec_juniper_mem_modules(): return Tuple( title=_("Specify levels in percentage of total memory usage"), elements=[ Percentage(title=_("Warning at a usage of"), unit=_("% of RAM"), default_value=80.0, maxvalue=100.0), Percentage(title=_("Critical at a usage of"), unit=_("% of RAM"), default_value=90.0, maxvalue=100.0) ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="juniper_mem_modules", group=RulespecGroupCheckParametersOperatingSystem, item_spec=_item_spec_juniper_mem_modules, parameter_valuespec=_parameter_valuespec_juniper_mem_modules, title=lambda: _("Juniper Modules Memory Usage"), ))
from cmk.gui.i18n import _ from cmk.gui.valuespec import ( Percentage, TextAscii, Tuple, ) from cmk.gui.plugins.wato import ( CheckParameterRulespecWithItem, rulespec_registry, RulespecGroupCheckParametersNetworking, ) def _parameter_valuespec_signal_quality(): return Tuple(elements=[ Percentage(title=_("Warning if under"), maxvalue=100), Percentage(title=_("Critical if under"), maxvalue=100), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="signal_quality", group=RulespecGroupCheckParametersNetworking, item_spec=lambda: TextAscii(title=_("Network specification"), allow_empty=True), parameter_valuespec=_parameter_valuespec_signal_quality, title=lambda: _("Signal quality of Wireless device"), ))
"and Job-Name, separated by a dot, for example <tt>TUX12C.SYS.PURGE_LOG</tt>" ), regex=r'.+\..+', allow_empty=False) def _parameter_valuespec_oracle_jobs(): return Dictionary( help=_( "A scheduler job is an object in an ORACLE database which could be " "compared to a cron job on Unix. "), elements=[ ("run_duration", run_duration), ("disabled", ignore_db_status), ("status_disabled_jobs", status_disabled_jobs), ("status_missing_jobs", status_missing_jobs), ("missinglog", missinglog), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="oracle_jobs", group=RulespecGroupCheckParametersApplications, item_spec=_item_spec_oracle_jobs, match_type="dict", parameter_valuespec=_parameter_valuespec_oracle_jobs, title=lambda: _("Oracle Scheduler Job"), ))
STATES_CHECK_RES = [("deleted", 2), ("read-only", 1), ("read-write", 0), ("replication destination", 0), ("retention lock disabled", 0), ("retention lock enabled", 0), ("unknown", 3)] def _parameter_valuespec_emc_datadomain_mtree(): return Dictionary( title=_("Mapping of MTree state to monitoring state"), help= _("Define a translation of the possible states of the MTree to monitoring " "states, i.e. to the result of the check. This overwrites the default " "mapping used by the check."), elements=[(state, MonitoringState(title=_( "Monitoring state if MTree state is '%s'" % state), default_value=check_res)) for state, check_res in STATES_CHECK_RES]) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="emc_datadomain_mtree", group=RulespecGroupCheckParametersStorage, item_spec=lambda: TextAscii(title=_("MTree name")), match_type="dict", parameter_valuespec=_parameter_valuespec_emc_datadomain_mtree, title=lambda: _("State of EMC Data Domain MTree"), ))
)), ("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"))) ],) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="mysql_innodb_io", group=RulespecGroupCheckParametersApplications, item_spec=_item_spec_mysql_innodb_io, match_type="dict", parameter_valuespec=_parameter_valuespec_mysql_innodb_io, title=lambda: _("MySQL InnoDB Throughput"), ))
("levels", Tuple( title=_("Levels for remaining undo retention"), elements=[ Age(title=_("warning if less then"), default_value=600), Age(title=_("critical if less then"), default_value=300), ], )), ( 'nospaceerrcnt_state', MonitoringState( default_value=2, title=_( "State in case of non space error count is greater then 0: " ), ), ), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="oracle_undostat", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextAscii( title=_("Database SID"), size=12, allow_empty=False), match_type="dict", parameter_valuespec=_parameter_valuespec_oracle_undostat, title=lambda: _("Oracle Undo Retention"), ))
TextAscii, ) from cmk.gui.plugins.wato import ( CheckParameterRulespecWithItem, rulespec_registry, Levels, RulespecGroupCheckParametersStorage, ) def _parameter_valuespec_fcport_words(): return Dictionary( title=_("Levels for transmitted and received words"), elements=[ ("fc_tx_words", Levels(title=_("Tx"), unit=_("words/s"))), ("fc_rx_words", Levels(title=_("Rx"), unit=_("words/s"))), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="fcport_words", group=RulespecGroupCheckParametersStorage, item_spec=lambda: TextAscii(title=_("Port index"), ), match_type="dict", parameter_valuespec=_parameter_valuespec_fcport_words, title=lambda: _("Atto Fibrebridge FC port"), ))