Beispiel #1
0
def _parameter_valuespec_power_presence():
    return Dictionary(elements=[
        (
            "power_off_criticality",
            MonitoringState(
                title=_("Service criticality"),
                help=
                _("Criticality of the service when sensors detect that power is off."
                  ),
            ),
        ),
    ], )
Beispiel #2
0
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])
Beispiel #3
0
def _parameter_valuespec_netapp_instance():
    return ListOf(
        Dictionary(
            help=_("This rule allows you to override netapp warnings"),
            elements=[
                ("name", TextInput(title=_("Warning starts with"))),
                ("state", MonitoringState(title="Set state to", default_value=1)),
            ],
            optional_keys=False,
        ),
        add_label=_("Add warning"),
    )
def _parameter_valuespec_ucs_c_rack_server_led():
    return Dictionary(
        title=_("Mapping of LED color to monitoring state"),
        help=
        _("Define a translation of the possible LED colors to monitoring states, i.e. to the "
          "result of the check. This overwrites the default mapping used by the check."
          ),
        elements=[(color,
                   MonitoringState(title=_(
                       "Monitoring state if LED color is %s" % color),
                                   default_value=state))
                  for color, state in COLORS_DEF_STATES])
Beispiel #5
0
def _parameter_valuespec_splunk_health():
    return Dictionary(
        help=_("You can specify a separate monitoring state for each "
               "possible combination of service state."),
        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,
            )),
        ],
    )
Beispiel #6
0
def _parameter_valuespec_esx_vsphere_objects():
    return Dictionary(
        help=_("Usually the check goes to WARN if a VM or host is powered off and OK otherwise. "
               "You can change this behaviour on a per-state-basis here."),
        optional_keys=False,
        elements=[
            ("states",
             Dictionary(
                 title=_("Target states"),
                 optional_keys=False,
                 elements=[
                     ("poweredOn",
                      MonitoringState(
                          title=_("Powered ON"),
                          help=_("Check result if the host or VM is powered on"),
                          default_value=0,
                      )),
                     ("poweredOff",
                      MonitoringState(
                          title=_("Powered OFF"),
                          help=_("Check result if the host or VM is powered off"),
                          default_value=1,
                      )),
                     ("suspended",
                      MonitoringState(
                          title=_("Suspended"),
                          help=_("Check result if the host or VM is suspended"),
                          default_value=1,
                      )),
                     ("unknown",
                      MonitoringState(
                          title=_("Unknown"),
                          help=_(
                              "Check result if the host or VM state is reported as <i>unknown</i>"),
                          default_value=3,
                      )),
                 ],
             )),
        ],
    )
Beispiel #7
0
def _parameter_valuespec_cluster_status():
    return Dictionary(
        elements=[
            (
                "type",
                DropdownChoice(
                    title=_("Cluster type"),
                    help=_("Expected cluster type."),
                    choices=[
                        ("active_standby", _("active / standby")),
                        ("active_active", _("active / active")),
                    ],
                    default_value="active_standby",
                ),
            ),
            (
                "v11_2_states",
                Dictionary(
                    title=_("Interpretation of failover cluster state"),
                    help=
                    _("Here you can set the failover state for BIG-IP system of version 11.2.0"
                      ),
                    elements=[
                        ("0", MonitoringState(title="Unknown",
                                              default_value=3)),
                        ("1", MonitoringState(title="Offline",
                                              default_value=2)),
                        ("2",
                         MonitoringState(title="Forced offline",
                                         default_value=2)),
                        ("3", MonitoringState(title="Standby",
                                              default_value=0)),
                        ("4", MonitoringState(title="Active",
                                              default_value=0)),
                    ],
                ),
            ),
        ],
        required_keys=["type"],
    )
Beispiel #8
0
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,
             )),
            ("else",
             MonitoringState(
                 title=
                 _("Monitoring state if a monitored service is not found at all."
                   ),
                 default_value=2,
             )),
        ],
        help=_(
            "This ruleset only applies when individual Systemd services are discovered. The user "
            "needs to configure this option in the discovery section."))
Beispiel #9
0
def _parameter_valuespec_vpn_tunnel():
    return Dictionary(elements=[
        ("tunnels",
         ListOf(
             Tuple(
                 title=("VPN Tunnel Endpoints"),
                 elements=[
                     IPv4Address(
                         title=_("IP-Address or Name of Tunnel Endpoint"),
                         help=_(
                             "The configured value must match a tunnel reported by the monitored "
                             "device."),
                     ),
                     TextInput(
                         title=_("Tunnel Alias"),
                         help=
                         _("You can configure an individual alias here for the tunnel matching "
                           "the IP-Address or Name configured in the field above."
                           ),
                     ),
                     MonitoringState(
                         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."),
         )),
    ], )
Beispiel #10
0
def _parameter_valuespec_storcli_pdisks():
    return Dictionary(
        title=_("Evaluation of PDisk States"),
        elements=[
            ("Dedicated Hot Spare",
             MonitoringState(
                 title=_("State for <i>Dedicated Hot Spare</i>"),
                 default_value=0,
             )),
            ("Global Hot Spare",
             MonitoringState(
                 title=_("State for <i>Global Hot Spare</i>"),
                 default_value=0,
             )),
            ("Unconfigured Good",
             MonitoringState(
                 title=_("State for <i>Unconfigured Good</i>"),
                 default_value=0,
             )),
            ("Unconfigured Bad",
             MonitoringState(
                 title=_("State for <i>Unconfigured Bad</i>"),
                 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,
            )),
        ],
    )
Beispiel #11
0
def _parameter_valuespec_emcvnx_disks():
    return Dictionary(elements=[
        (
            "state_read_error",
            Tuple(
                title=_("State on hard read error"),
                elements=[
                    MonitoringState(
                        title=_("State"),
                        default_value=2,
                    ),
                    Integer(
                        title=_("Minimum error count"),
                        default_value=2,
                    ),
                ],
            ),
        ),
        (
            "state_write_error",
            Tuple(
                title=_("State on hard write error"),
                elements=[
                    MonitoringState(
                        title=_("State"),
                        default_value=2,
                    ),
                    Integer(
                        title=_("Minimum error count"),
                        default_value=2,
                    ),
                ],
            ),
        ),
        (
            "state_rebuilding",
            MonitoringState(default_value=1,
                            title=_("State when rebuildung enclosure")),
        ),
    ], )
Beispiel #12
0
def valuespec_alert_remapping():
    return ListOf(
        Dictionary(
            elements=[
                ("rule_names",
                 ListOfStrings(
                     title=_("Alert rule names"),
                     help=_(
                         "A list of rule names as defined in Alertmanager."),
                 )),
                ("map",
                 Dictionary(
                     title=_("States"),
                     elements=[
                         ("inactive", MonitoringState(title="inactive")),
                         ("pending", MonitoringState(title="pending")),
                         ("firing", MonitoringState(title="firing")),
                         ("none", MonitoringState(title="none")),
                         ("n/a", MonitoringState(title="n/a")),
                     ],
                     optional_keys=[],
                 )),
            ],
            optional_keys=[],
        ),
        title=_("Remap alert rule states"),
        add_label=_("Add mapping"),
        help=_("Configure the monitoring state for Alertmanager rules."),
        allow_empty=False,
        default_value=[{
            "map": {
                "inactive": 2,
                "pending": 2,
                "firing": 0,
                "none": 2,
                "n/a": 2,
            },
            "rule_names": ["Watchdog"]
        }],
    )
Beispiel #13
0
 def parameter_valuespec(self):
     return Dictionary(elements=[
         ("map_states",
          Dictionary(
              elements=[
                  ("unavailable",
                   MonitoringState(title=_("Device unavailable"),
                                   default_value=2)),
                  ("available",
                   MonitoringState(title=_("Device available"),
                                   default_value=0)),
                  ("online",
                   MonitoringState(title=_("Device online"),
                                   default_value=0)),
                  ("offline",
                   MonitoringState(title=_("Device offline"),
                                   default_value=2)),
                  ("going online",
                   MonitoringState(title=_("Device going online"),
                                   default_value=1)),
                  ("state not available",
                   MonitoringState(title=_("Device state not available"),
                                   default_value=3)),
              ],
              title=_('Map Device States'),
              optional_keys=[],
          )),
     ], )
Beispiel #14
0
def _parameter_valuespec_vm_guest_tools():
    return Dictionary(
        optional_keys=False,
        elements=[
            (
                "guestToolsCurrent",
                MonitoringState(
                    title=_(
                        "VMware Tools is installed, and the version is current"
                    ),
                    default_value=0,
                ),
            ),
            (
                "guestToolsNeedUpgrade",
                MonitoringState(
                    title=
                    _("VMware Tools is installed, but the version is not current"
                      ),
                    default_value=1,
                ),
            ),
            (
                "guestToolsNotInstalled",
                MonitoringState(
                    title=_("VMware Tools have never been installed"),
                    default_value=2,
                ),
            ),
            (
                "guestToolsUnmanaged",
                MonitoringState(
                    title=
                    _("VMware Tools is installed, but it is not managed by VMWare"
                      ),
                    default_value=0,
                ),
            ),
        ],
    )
Beispiel #15
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 #16
0
 def parameter_valuespec(self):
     return Dictionary(
         elements=[
             ("levels",
              Tuple(
                  title=_("Levels for used configured reserve"),
                  elements=[
                      Percentage(title=_("Warning at or above"), unit="%", default_value=85.0),
                      Percentage(title=_("Critical at or above"), unit="%", default_value=90.0),
                  ],
              )),
             ("state_noreserve", MonitoringState(title=_("State if no reserve is configured"),)),
         ],)
def _parameter_valuespec_apc_system_events():
    return Dictionary(
        title=_("System Events on APX Inrow Devices"),
        elements=[
            (
                "state",
                MonitoringState(
                    title=_("State during active system events"),
                    default_value=2,
                ),
            ),
        ],
    )
Beispiel #18
0
def _parameter_valuespec_haproxy_server() -> Dictionary:
    return Dictionary(
        title=_("Translation of HAProxy state to monitoring state"),
        help=
        _("Define a direct translation of the possible states of the HAProxy server "
          "to monitoring states, i.e. to the result of the check. This overwrites the default "
          "mapping used by the check."),
        elements=[(server_state,
                   MonitoringState(
                       title=_("Monitoring state if HAProxy server is %s") %
                       server_state,
                       default_value=default))
                  for server_state, default in SERVER_STATES])
Beispiel #19
0
 def parameter_valuespec(self):
     return Dictionary(
         title=_("Interpretation of Config Sync Status"),
         elements=[
             ("0", MonitoringState(title="Unknown", default_value=3)),
             ("1", MonitoringState(title="Syncing", default_value=0)),
             ("2", MonitoringState(title="Need Manual Sync",
                                   default_value=1)),
             ("3", MonitoringState(title="In Sync", default_value=0)),
             ("4", MonitoringState(title="Sync Failed", default_value=2)),
             ("5",
              MonitoringState(title="Sync Disconnected", default_value=2)),
             ("6", MonitoringState(title="Standalone", default_value=2)),
             ("7",
              MonitoringState(title="Awaiting Initial Sync",
                              default_value=1)),
             ("8",
              MonitoringState(title="Incompatible Version",
                              default_value=2)),
             ("9", MonitoringState(title="Partial Sync", default_value=2)),
         ],
     )
Beispiel #20
0
def _parameter_valuespec_plesk_backups():
    return Dictionary(
        help=_("This check monitors backups configured for domains in plesk."),
        elements=[
            ("no_backup_configured_state",
             MonitoringState(title=_("State when no backup is configured"),
                             default_value=1)),
            ("no_backup_found_state",
             MonitoringState(title=_("State when no backup can be found"),
                             default_value=1)),
            (
                "backup_age",
                Tuple(
                    title=_("Maximum age of backups"),
                    help=_("The maximum age of the last backup."),
                    elements=[
                        Age(title=_("Warning at")),
                        Age(title=_("Critical at")),
                    ],
                ),
            ),
            (
                "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'],
    )
Beispiel #21
0
 def parameter_valuespec(self):
     return Transform(Dictionary(
         title=_("Consider state of Archivelogmode: "),
         elements=[
             ('archivelog',
              MonitoringState(
                  default_value=0,
                  title=_("State in case of Archivelogmode is enabled: "),
              )),
             (
                 'noarchivelog',
                 MonitoringState(
                     default_value=1,
                     title=_(
                         "State in case of Archivelogmode is disabled: "),
                 ),
             ),
             (
                 'forcelogging',
                 MonitoringState(
                     default_value=0,
                     title=_("State in case of Force Logging is enabled: "),
                 ),
             ),
             (
                 'noforcelogging',
                 MonitoringState(
                     default_value=1,
                     title=_(
                         "State in case of Force Logging is disabled: "),
                 ),
             ),
             (
                 'logins',
                 MonitoringState(
                     default_value=2,
                     title=_("State in case of logins are not possible: "),
                 ),
             ),
             (
                 'primarynotopen',
                 MonitoringState(
                     default_value=2,
                     title=
                     _("State in case of Database is PRIMARY and not OPEN: "
                       ),
                 ),
             ),
             ('uptime_min',
              Tuple(
                  title=_("Minimum required uptime"),
                  elements=[
                      Age(title=_("Warning if below")),
                      Age(title=_("Critical if below")),
                  ],
              )),
         ],
     ),
                      forth=self._transform_oracle_instance_params)
Beispiel #22
0
def _parameter_valuespec_vm_heartbeat():
    return Dictionary(
        optional_keys=False,
        elements=[
            (
                "heartbeat_missing",
                MonitoringState(
                    title=_("No heartbeat"),
                    help=_(
                        "Guest operating system may have stopped responding."),
                    default_value=2,
                ),
            ),
            (
                "heartbeat_intermittend",
                MonitoringState(
                    title=_("Intermittent heartbeat"),
                    help=_("May be due to high guest load."),
                    default_value=1,
                ),
            ),
            (
                "heartbeat_no_tools",
                MonitoringState(
                    title=_("Heartbeat tools missing or not installed"),
                    help=_("No VMWare Tools installed."),
                    default_value=1,
                ),
            ),
            (
                "heartbeat_ok",
                MonitoringState(
                    title=_("Heartbeat OK"),
                    help=_("Guest operating system is responding normally."),
                    default_value=0,
                ),
            ),
        ],
    )
Beispiel #23
0
def _parameter_valuespec_cisco_wlc():
    return Dictionary(
        help=_("Here you can set which alert type is set when the given "
               "access point is missing (might be powered off). The access point "
               "can be specified by the AP name or the AP model"),
        elements=[("ap_name",
                   ListOf(Tuple(elements=[
                       TextAscii(title=_("AP name")),
                       MonitoringState(title=_("State when missing"), default_value=2)
                   ],),
                          title=_("Access point name"),
                          add_label=_("Add name")))],
    )
Beispiel #24
0
def _parameter_valuespec_job():
    return Dictionary(
        elements=[
            (
                "age",
                Tuple(
                    title=_("Maximum time since last start of job execution"),
                    elements=[
                        Age(title=_("Warning at"), default_value=0),
                        Age(title=_("Critical at"), default_value=0),
                    ],
                ),
            ),
            (
                "exit_code_to_state_map",
                ListOf(
                    valuespec=Tuple(
                        orientation="horizontal",
                        elements=[
                            Integer(title=_("Exit code")),
                            MonitoringState(
                                title=_("Resulting state"),
                            ),
                        ],
                        default_value=(0, 0),
                    ),
                    title=_("Explicit mapping of job exit codes to states"),
                    help=_(
                        "Here you can define a mapping between possible exit codes and service states. "
                        "If no mapping is defined, the check becomes CRITICAL when the exit code is not 0. "
                        "If an exit code occurs that is not defined in this mapping, the check becomes CRITICAL. "
                        "If you happen to define the same exit code multiple times the first entry will be used."
                    ),
                    allow_empty=False,
                ),
            ),
            (
                "outcome_on_cluster",
                DropdownChoice(
                    title="%s - %s"
                    % (
                        _("Clusters: Preferred check result of local checks"),
                        _deprecation_message(),
                    ),
                    choices=[],
                    deprecated_choices=("worst", "best"),
                    invalid_choice_title=_('Old setting: "%s". Choose that in the new ruleset.'),
                ),
            ),
        ],
    )
def _parameter_valuespec_elasticsearch_cluster_health():
    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",
             Tuple(
                 title=_("Expected number of nodes"),
                 elements=[
                     Integer(title=_("Warning if less then"), unit="nodes"),
                     Integer(title=_("Critical if less then"), unit="nodes")
                 ],
             )),
            ("number_of_data_nodes",
             Tuple(
                 title=_("Expected number of data nodes"),
                 elements=[
                     Integer(title=_("Warning if less then"), unit="nodes"),
                     Integer(title=_("Critical if less then"), unit="nodes")
                 ],
             )),
        ],
        optional_keys=[
            "number_of_nodes", "number_of_data_nodes", "green", "yellow", "red"
        ],
    )
Beispiel #26
0
 def parameter_valuespec(self):
     return Dictionary(elements=websphere_mq_common_elements() + [
         ("status",
          Dictionary(
              title=_('Override check state based on channel state'),
              elements=[
                  ("INACTIVE",
                   MonitoringState(
                       title=_("State when channel is inactive"),
                       default_value=2)),
                  ("INITIALIZING",
                   MonitoringState(
                       title=_("State when channel is initializing"),
                       default_value=2)),
                  ("BINDING",
                   MonitoringState(title=_("State when channel is binding"),
                                   default_value=2)),
                  ("STARTING",
                   MonitoringState(
                       title=_("State when channel is starting"),
                       default_value=2)),
                  ("RUNNING",
                   MonitoringState(title=_("State when channel is running"),
                                   default_value=0)),
                  ("RETRYING",
                   MonitoringState(
                       title=_("State when channel is retrying"),
                       default_value=2)),
                  ("STOPPING",
                   MonitoringState(
                       title=_("State when channel is stopping"),
                       default_value=2)),
                  ("STOPPED",
                   MonitoringState(title=_("State when channel is stopped"),
                                   default_value=1)),
                  ("other",
                   MonitoringState(
                       title=_("State when channel status is unknown"),
                       default_value=2)),
              ],
              optional_keys=[],
          )),
     ], )
Beispiel #27
0
def _parameter_valuespec_keepalived():
    return Dictionary(elements=[
        (
            "master",
            MonitoringState(
                title=_("master"),
                default_value=0,
            ),
        ),
        (
            "unknown",
            MonitoringState(
                title=_("unknown"),
                default_value=3,
            ),
        ),
        (
            "init",
            MonitoringState(
                title=_("init"),
                default_value=0,
            ),
        ),
        (
            "backup",
            MonitoringState(
                title=_("backup"),
                default_value=0,
            ),
        ),
        (
            "fault",
            MonitoringState(
                title=_("fault"),
                default_value=2,
            ),
        ),
    ])
Beispiel #28
0
def _parameter_valuespec_couchbase_status():
    return Dictionary(
        title=_("Couchbase Node: Cluster status"),
        elements=[
            (
                "warmup_state",
                MonitoringState(
                    title=_('Resulting state if the status is "warmup"'),
                    default_value=0,
                ),
            ),
            (
                "unhealthy_state",
                MonitoringState(
                    title=_('Resulting state if the status is "unhealthy"'),
                    default_value=2,
                ),
            ),
            (
                "inactive_added_state",
                MonitoringState(
                    title=
                    _('Resulting state if the cluster membership status is "inactiveAdded"'
                      ),
                    default_value=1,
                ),
            ),
            (
                "inactive_failed_state",
                MonitoringState(
                    title=
                    _('Resulting state if the cluster membership status is "inactiveFailed"'
                      ),
                    default_value=2,
                ),
            ),
        ],
    )
Beispiel #29
0
def _parameter_valuespec():
    return Dictionary(
        elements=[
            (
                "failed_state",
                MonitoringState(
                    title=_(("Monitoring state if a container terminates "
                             "unsuccessfully (non-zero exit code)")),
                    default_value=2,
                ),
            ),
        ],
        required_keys=["failed_state"],
    )
Beispiel #30
0
def _parameter_valuespec_printer_supply():
    return Transform(
        Dictionary(elements=[
            ("levels",
             Tuple(
                 title=_("Levels for remaining supply"),
                 elements=[
                     Percentage(
                         title=_("Warning level for remaining"),
                         allow_int=True,
                         default_value=20.0,
                         help=
                         _("For consumable supplies, this is configured as the percentage of "
                           "remaining capacity. For supplies that fill up, this is configured "
                           "as remaining space."),
                     ),
                     Percentage(
                         title=_("Critical level for remaining"),
                         allow_int=True,
                         default_value=10.0,
                         help=
                         _("For consumable supplies, this is configured as the percentage of "
                           "remaining capacity. For supplies that fill up, this is configured "
                           "as remaining space."),
                     ),
                 ],
             )),
            ("some_remaining",
             MonitoringState(
                 title=_("State for <i>some remaining</i>"),
                 help=_(
                     "Some printers do not report a precise percentage but "
                     "just <i>some remaining</i> at a low fill state. Here you "
                     "can set the monitoring state for that situation"),
                 default_value=1,
             )),
            ("upturn_toner",
             Checkbox(
                 title=_("Upturn toner levels"),
                 label=
                 _("Printer sends <i>used</i> material instead of <i>remaining</i>"
                   ),
                 help=
                 _("Some Printers (eg. Konica for Drum Cartdiges) returning the available"
                   " fuel instead of what is left. In this case it's possible"
                   " to upturn the levels to handle this behavior"),
             )),
        ], ),
        forth=transform_printer_supply,
    )