Tuple( orientation='horizontal', elements=[ Integer( title=_("Nodes"), help= _("Apply these levels to clusters that have at least the following number of nodes:" ), minvalue=1, ), Dictionary(elements=_esx_host_memory_elements()), ]), title=_('Clusters: node specific memory utilization'), help=_( 'Configure thresholds that apply to clusters based on how many nodes ' 'they have.'), ), ), ], ), forth=_transform_memory_usage_params, ) rulespec_registry.register( CheckParameterRulespecWithoutItem( check_group_name="esx_host_memory", group=RulespecGroupCheckParametersOperatingSystem, parameter_valuespec=_parameter_valuespec_esx_host_memory, title=lambda: _("Main memory usage of ESX host system"), ))
def _valuespec_discovery_cmciii(): return Dictionary( title=_("Rittal CMC III discovery"), elements=[ ("use_sensor_description", DropdownChoice( title=_("Service description"), help= _("The sensor description is a user defined text. If you use " "this option, you must ensure that all sensors have a " "unique description. Otherwise two or more sensors can be " "aliased to the same service."), choices=[ (False, _("Use device and sensor name")), (True, _("Use sensor description (see help text)")), ], )), ], ) rulespec_registry.register( HostRulespec( group=RulespecGroupCheckParametersDiscovery, match_type="dict", name="discovery_cmciii", valuespec=_valuespec_discovery_cmciii, ))
def _parameter_valuespec_siemens_plc_counter(): return Dictionary( elements=[ ('levels', Tuple( title=_("Counter level"), elements=[ Integer(title=_("Warning at"), ), Integer(title=_("Critical at"), ), ], )), ], help=_( "This rule is used to configure thresholds for counter values read from " "Siemens PLC devices."), title=_("Counter levels"), ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="siemens_plc_counter", group=RulespecGroupCheckParametersEnvironment, item_spec=_item_spec_siemens_plc_counter, match_type="dict", parameter_valuespec=_parameter_valuespec_siemens_plc_counter, title=lambda: _("Siemens PLC Counter"), ))
( "total_size", Tuple( title=_("Maximum size of all files on backup space"), help= _("The maximum size of all files on the backup space. " "This might be set to the allowed quotas on the configured " "FTP server to be notified if the space limit is reached." ), elements=[ Filesize(title=_("Warning at")), Filesize(title=_("Critical at")), ], ), ), ], optional_keys=['backup_age', 'total_size'], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="plesk_backups", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextAscii(title=_("Service descriptions"), allow_empty=False), match_type="dict", parameter_valuespec=_parameter_valuespec_plesk_backups, title=lambda: _("Plesk Backups"), ))
def _parameter_valuespec_bonding(): return Dictionary(elements=[ ("expect_active", DropdownChoice( title=_("Warn on unexpected active interface"), choices=[ ("ignore", _("ignore which one is active")), ("primary", _("require primary interface to be active")), ("lowest", _("require interface that sorts lowest alphabetically")), ], default_value="ignore", )), ("ieee_302_3ad_agg_id_missmatch_state", MonitoringState( title=_("State for missmatching Aggregator IDs for LACP"), default_value=1, )), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="bonding", group=RulespecGroupCheckParametersNetworking, item_spec=lambda: TextAscii(title=_("Name of the bonding interface")), match_type="dict", parameter_valuespec=_parameter_valuespec_bonding, title=lambda: _("Status of Linux bonding interfaces"), ))
def _parameter_valuespec_uptime(): return Dictionary(elements=[ ("min", Tuple( title=_("Minimum required uptime"), elements=[ Age(title=_("Warning if below")), Age(title=_("Critical if below")), ], )), ("max", Tuple( title=_("Maximum allowed uptime"), elements=[ Age(title=_("Warning at")), Age(title=_("Critical at")), ], )), ], ) rulespec_registry.register( CheckParameterRulespecWithoutItem( check_group_name="uptime", group=RulespecGroupCheckParametersOperatingSystem, match_type="dict", parameter_valuespec=_parameter_valuespec_uptime, title=lambda: _("Uptime since last reboot"), ))
rulespec_registry, ) from cmk.gui.valuespec import Dictionary, Integer, TextAscii, Tuple def _mongodb_cluster_count_tuple(title, course): return Tuple(title=_(title), elements=[ Integer(title=_("Warning if %s") % course, unit=_("count"), minvalue=0), Integer(title=_("Critical if %s") % course, unit=_("count"), minvalue=0), ]) def _parameter_valuespec_mongodb_cluster(): return Dictionary(elements=[ ("levels_number_jumbo", _mongodb_cluster_count_tuple("Number of jumbo chunks per shard per collection", "above")), ]) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="mongodb_cluster", group=RulespecGroupCheckParametersStorage, item_spec=lambda: TextAscii(title=_( "Database/Collection name ('<DB name> <collection name>')"),), match_type="dict", parameter_valuespec=_parameter_valuespec_mongodb_cluster, title=lambda: _("MongoDB Cluster"), ))
from cmk.gui.i18n import _ from cmk.gui.valuespec import ( Percentage, Tuple, ) from cmk.gui.plugins.wato import ( CheckParameterRulespecWithoutItem, rulespec_registry, RulespecGroupCheckParametersOperatingSystem, ) def _parameter_valuespec_sp_util(): return Tuple( title=_("Specify levels in percentage of storage processor usage"), elements=[ Percentage(title=_("Warning at"), default_value=50.0), Percentage(title=_("Critical at"), default_value=60.0), ], ) rulespec_registry.register( CheckParameterRulespecWithoutItem( check_group_name="sp_util", group=RulespecGroupCheckParametersOperatingSystem, parameter_valuespec=_parameter_valuespec_sp_util, title=lambda: _("Storage Processor Utilization"), ))
def _parameter_valuespec_ipsecvpn(): return Transform( Dictionary( elements=[("levels", Tuple( title=_("Levels for number of down channels"), elements=[ Integer(title=_("Warning at"), default_value=1), Integer(title=_("Critical at"), default_value=2), ], )), ("tunnels_ignore_levels", ListOfStrings(title=_("Tunnels which ignore levels")))], optional_keys=[], ), forth=lambda params: isinstance(params, dict) and params or {"levels": params}, ) rulespec_registry.register( CheckParameterRulespecWithoutItem( check_group_name="ipsecvpn", group=RulespecGroupCheckParametersNetworking, match_type="dict", parameter_valuespec=_parameter_valuespec_ipsecvpn, title=lambda: _("Fortigate IPSec VPN Tunnels"), ))
from cmk.gui.i18n import _ from cmk.gui.plugins.wato import ( CheckParameterRulespecWithoutItem, rulespec_registry, RulespecGroupCheckParametersEnvironment, ) from cmk.gui.valuespec import Integer, Tuple def _parameter_valuespec_hw_single_temperature(): return Tuple(help=_("Temperature levels for hardware devices with " "a single temperature sensor."), elements=[ Integer(title=_("warning at"), unit=u"°C", default_value=35), Integer(title=_("critical at"), unit=u"°C", default_value=40), ]) rulespec_registry.register( CheckParameterRulespecWithoutItem( check_group_name="hw_single_temperature", group=RulespecGroupCheckParametersEnvironment, is_deprecated=True, parameter_valuespec=_parameter_valuespec_hw_single_temperature, title=lambda: _("Host/Device temperature"), ))
CheckParameterRulespecWithoutItem, rulespec_registry, RulespecGroupCheckParametersApplications, ) def _parameter_valuespec_cisco_fw_connections(): return Dictionary(elements=[ ("connections", Tuple( help=_( "This rule sets limits to the current number of connections through " "a Cisco ASA firewall."), title=_("Maximum number of firewall connections"), elements=[ Integer(title=_("Warning at")), Integer(title=_("Critical at")), ], )), ], ) rulespec_registry.register( CheckParameterRulespecWithoutItem( check_group_name="cisco_fw_connections", group=RulespecGroupCheckParametersApplications, match_type="dict", parameter_valuespec=_parameter_valuespec_cisco_fw_connections, title=lambda: _("Cisco ASA Firewall Connections"), ))
from cmk.gui.i18n import _ from cmk.gui.valuespec import ( Dictionary, MonitoringState, ) from cmk.gui.plugins.wato import ( CheckParameterRulespecWithoutItem, rulespec_registry, RulespecGroupCheckParametersApplications, ) 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)), ], ) rulespec_registry.register( CheckParameterRulespecWithoutItem( check_group_name="agent_update", group=RulespecGroupCheckParametersApplications, parameter_valuespec=_parameter_valuespec_check_mk_agent_update, title=lambda: _("Agent update"), ))
('levels_low_in', Tuple( title=_('Levels for laser input'), default_value=(-160.0, -180.0), elements=[ Integer(title=_("Warning below")), Integer(title=_("Critical below")), ], )), ('levels_low_out', Tuple( title=_('Levels for laser output'), default_value=(-160.0, -180.0), elements=[ Integer(title=_("Warning below")), Integer(title=_("Critical below")), ], )), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="huawei_osn_laser", group=RulespecGroupCheckParametersNetworking, item_spec=lambda: TextInput(title=_("Laser id")), match_type="dict", parameter_valuespec=_parameter_valuespec_huawei_osn_laser, title=lambda: _("OSN Laser attenuation"), ))
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)), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="graylog_sidecars", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextInput(title=_("Sidecar name")), match_type="dict", parameter_valuespec=_parameter_valuespec_graylog_sidecars, title=lambda: _("Graylog sidecars"), ))
], 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=[], )), ], ) rulespec_registry.register( CheckParameterRulespecWithoutItem( check_group_name="skype_xmpp", group=RulespecGroupCheckParametersApplications, match_type="dict", parameter_valuespec=_parameter_valuespec_skype_xmpp, title=lambda: _("Skype for Business XMPP"), ))
elements=[ Percentage(title=_("CPU usage warning at"), default_value=75.0), Percentage(title=_("CPU usage critical at"), default_value=90.0), ], )), ("open_file_descriptors", Tuple( title=_("Expected number of open file descriptors"), elements=[ Integer(title=_("Warning if at"), unit="file descriptors"), Integer(title=_("Critical if at"), unit="file descriptor") ], )), ], optional_keys=["open_file_descriptors", "cpu_levels"], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="elasticsearch_nodes", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextAscii(title=_("Name of node")), match_type="dict", parameter_valuespec=_parameter_valuespec_elasticsearch_nodes, title=lambda: _("Elasticsearch Nodes"), ))
default_value=1, ), ), ( "Online", MonitoringState( title=_("State for <i>Online</i>"), default_value=0, ), ), ( "Offline", MonitoringState( title=_("State for <i>Offline</i>"), default_value=2, ), ), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="storcli_pdisks", group=RulespecGroupCheckParametersStorage, item_spec=_item_spec_storcli_pdisks, match_type="dict", parameter_valuespec=_parameter_valuespec_storcli_pdisks, title=lambda: _("LSI RAID physical disks (StorCLI)"), ))
( 'users', Alternative( title=_('Levels for number of Phion VPN Users'), elements=[ FixedValue( None, title=_('No Levels'), totext=_('Do not impose levels, always be OK'), ), Tuple( title=_('Fixed Levels'), elements=[ Integer(title=_('Warning at'), ), Integer(title=_('Critical at'), ), ], ), ], ), ), ]) rulespec_registry.register( CheckParameterRulespecWithoutItem( check_group_name='phion_vpnusers', group=RulespecGroupCheckParametersApplications, parameter_valuespec=_parameter_valuespec_phion_vpnusers, title=lambda: _('Phion/Barracuda VPN Users'), ))
) from cmk.gui.valuespec import CascadingDropdown, Dictionary def _valuespec_discovery_netapp_api_psu_rules(): return Dictionary( title=_("Netapp power supply unit discovery"), elements=[ ("mode", CascadingDropdown( title=_("Specify discovery mode"), help= _("Option which allows to specify whether all power supply units will be grouped into one service (summary) or each unit gets allocated one individual service (single)." ), orientation="vertical", choices=[ ("summarize", _("Summary")), ("single", _("Single")), ])), ], ) rulespec_registry.register( HostRulespec( group=RulespecGroupCheckParametersDiscovery, match_type="dict", name="discovery_netapp_api_psu_rules", valuespec=_valuespec_discovery_netapp_api_psu_rules, ))
maxvalue=None), Percentage(title=_("Critical at a usage of"), unit=_("% of RAM"), maxvalue=None) ], ), Tuple( title=_("Specify levels in absolute usage values"), elements=[ Integer(title=_("Warning at"), unit=_("MB")), Integer(title=_("Critical at"), unit=_("MB")) ], ), ], )), ] + size_trend_elements), forth=lambda spec: spec if isinstance(spec, dict) else {"levels": spec}, ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="cisco_mem", group=RulespecGroupCheckParametersOperatingSystem, item_spec=lambda: TextAscii(title=_("Memory Pool Name"), allow_empty=False), parameter_valuespec=_parameter_valuespec_cisco_mem, title=lambda: _("Cisco Memory Usage"), ))
TextInput, ) 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: TextInput(title=_("Port index"),), match_type="dict", parameter_valuespec=_parameter_valuespec_fcport_words, title=lambda: _("Atto Fibrebridge FC port"), ))
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"), ))
def _parameter_valuespec_sap_hana_replication_status(): return Dictionary(elements=[ ("state_unknown", MonitoringState(title=_("State in case of unknown status from replication script"), default_value=3)), ("state_no_replication", MonitoringState(title=_("State in case of no system replication"), default_value=2)), ("state_error", MonitoringState(title=_("State when replication state is error"), default_value=2)), ("state_replication_unknown", MonitoringState(title=_("State when replication state is unknown"), default_value=2)), ("state_initializing", MonitoringState(title=_("State when replication state is intializing"), default_value=1)), ("state_syncing", MonitoringState(title=_("State when replication state is syncing"), default_value=0)), ("state_active", MonitoringState(title=_("State when replication state is active"), default_value=0)), ],) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="sap_hana_replication_status", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextInput(title=_("The instance name")), match_type="dict", parameter_valuespec=_parameter_valuespec_sap_hana_replication_status, title=lambda: _("SAP HANA replication status"), ))
def _item_spec_siemens_plc_flag(): return TextAscii( title=_("Device Name and Value Ident"), help= _("You need to concatenate the device name which is configured in the special agent " "for the PLC device separated by a space with the ident of the value which is also " "configured in the special agent."), allow_empty=True) def _parameter_valuespec_siemens_plc_flag(): return DropdownChoice(help=_( "This rule sets the expected state, the one which should result in an OK state, " "of the monitored flags of Siemens PLC devices."), title=_("Expected flag state"), choices=[ (True, _("Expect the flag to be: On")), (False, _("Expect the flag to be: Off")), ], default_value=True) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="siemens_plc_flag", group=RulespecGroupCheckParametersEnvironment, item_spec=_item_spec_siemens_plc_flag, parameter_valuespec=_parameter_valuespec_siemens_plc_flag, title=lambda: _("State of Siemens PLC Flags"), ))
Tuple(title=_("No levels"), elements=[ FixedValue(None, totext=""), FixedValue(None, totext=""), ]), ]) def _parameter_valuespec_fortinet_signatures(): return Dictionary(elements=[ ('av_age', _vs_fortinet_signatures(_("Age of Anti-Virus signature"))), ('av_ext_age', _vs_fortinet_signatures( _("Age of Anti-Virus signature extended database"))), ('ips_age', _vs_fortinet_signatures(_("Age of Intrusion Prevention signature"))), ('ips_ext_age', _vs_fortinet_signatures( _("Age of Intrusion Prevention signature extended database"))), ], ) rulespec_registry.register( CheckParameterRulespecWithoutItem( check_group_name="fortinet_signatures", group=RulespecGroupCheckParametersNetworking, match_type="dict", parameter_valuespec=_parameter_valuespec_fortinet_signatures, title=lambda: _("Fortigate Signatures"), ))
"write_latency", Levels( title=_("Write latency"), unit=_("ms"), default_value=None, default_levels=(50.0, 100.0), ), ), ( "latency", Levels( title=_("Overall latency"), unit=_("ms"), default_value=None, default_levels=(50.0, 100.0), ), ), ], ) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="fcp", group=RulespecGroupCheckParametersNetworking, item_spec=lambda: TextInput(title=_("Port specification"), allow_empty=False), match_type="dict", parameter_valuespec=_parameter_valuespec_fcp, title=lambda: _("Fibrechannel Interfaces"), ))
("levels", Alternative( title=_("Levels for volume group"), show_alternative_title=True, default_value=(80.0, 90.0), match=match_dual_level_type, elements=[ get_free_used_dynamic_valuespec("used", "volume group"), Transform(get_free_used_dynamic_valuespec( "free", "volume group", default_value=(20.0, 10.0)), title=_("Levels for volume group free space"), allow_empty=False, forth=transform_filesystem_free, back=transform_filesystem_free) ], )), ], optional_keys=False) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="volume_groups", group=RulespecGroupCheckParametersStorage, item_spec=lambda: TextAscii(title=_("Volume Group"), allow_empty=False ), match_type="dict", parameter_valuespec=_parameter_valuespec_volume_groups, title=lambda: _("Volume Groups (LVM)"), ))
TextAscii, Transform, ) def _valuespec_special_agents_ilo(): return Transform( Dictionary( title=_("Agent HPE iLO Configuration"), elements=[ ("user", TextAscii( title=_("Username"), allow_empty=False, )), ("password", IndividualOrStoredPassword( title=_("Password"), allow_empty=False, )), ], ), ) rulespec_registry.register( HostRulespec( group=RulespecGroupDatasourcePrograms, name="special_agents:ilo", title=lambda: _("Agent HPE iLO Configuration"), valuespec=_valuespec_special_agents_ilo, ))
("status", Dictionary( title=_('Override check state based on channel state'), elements=[ ("INACTIVE", MonitoringState(title=_("When INACTIVE"), default_value=0)), ("INITIALIZING", MonitoringState(title=_("When INITIALIZING"), default_value=0)), ("BINDING", MonitoringState(title=_("When BINDING"), default_value=0)), ("STARTING", MonitoringState(title=_("When STARTING"), default_value=0)), ("RUNNING", MonitoringState(title=_("When RUNNING"), default_value=0)), ("RETRYING", MonitoringState(title=_("When RETRYING"), default_value=1)), ("STOPPING", MonitoringState(title=_("When STOPPING"), default_value=0)), ("STOPPED", MonitoringState(title=_("When STOPPED"), default_value=2)), ("other", MonitoringState(title=_("State when channel status is unknown"), default_value=2)), ], optional_keys=[], )), ],) rulespec_registry.register( CheckParameterRulespecWithItem( check_group_name="ibm_mq_channels", group=RulespecGroupCheckParametersApplications, item_spec=lambda: TextAscii(title=_("Name of Channel")), match_type="dict", parameter_valuespec=_parameter_valuespec_ibm_mq_channels, title=lambda: _("IBM MQ Channels"), ))
def _valuespec_inventory_mssql_counters_rules(): return Dictionary( title=_("MSSQL counter discovery"), elements=[ ("add_zero_based_services", Checkbox(title=_("Include service with zero base."))), ], optional_keys=[], ) rulespec_registry.register( HostRulespec( group=RulespecGroupCheckParametersDiscovery, match_type="dict", name="inventory_mssql_counters_rules", valuespec=_valuespec_inventory_mssql_counters_rules, )) def _parameter_valuespec_mssql_counters_locks(): return Dictionary( help= _("This check monitors locking related information of MSSQL tablespaces." ), elements=[ ( "lock_requests/sec", Tuple( title=_("Lock Requests / sec"),