Module: check_mk
Branch: master
Commit: c153b1001982003c2d03715a29c651dd147f7eca
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c153b100198200…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Mar 27 17:12:11 2017 +0200
Remove duplicate code
Change-Id: I489a9a40358a30ca6ef33bb2da246f7073297e31
---
web/plugins/wato/check_parameters.py | 138 -----------------------------------
1 file changed, 138 deletions(-)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 611d5fd..bd08bf8 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -4746,88 +4746,6 @@ register_check_parameters(
match_type = "first",
)
-def windows_printer_queues_forth(old):
- default = {
- "levels" : (None, None),
- "warn_states" : [ 8, 11 ],
- "crit_states" : [ 9, 10 ],
- }
- if type(old) == tuple:
- default['levels'] = old
- if type(old) == dict:
- return old
- return default
-
-register_check_parameters(
- subgroup_printing,
- "windows_printer_queues",
- _("Number of open jobs of a printer on windows" ),
- Transform(
- Dictionary(
- title = _("Windows Printer Configuration"),
- elements = [
- ( "levels",
- Tuple(
- title = _("Levels for the number of print jobs"),
- help = _("This rule is applied to the number of print jobs
"
- "currently waiting in windows printer
queue."),
- elements = [
- Integer(title = _("Warning at"), unit =
_("jobs"), default_value = 40),
- Integer(title = _("Critical at"), unit =
_("jobs"), default_value = 60),
- ]
- ),
- ),
- ("crit_states",
- ListChoice(
- title = _("States who should lead to critical"),
- choices = [
- ( 0, "Unkown"),
- ( 1, "Other"),
- ( 2, "No Error"),
- ( 3, "Low Paper"),
- ( 4, "No Paper"),
- ( 5, "Low Toner"),
- ( 6, "No Toner"),
- ( 7, "Door Open"),
- ( 8, "Jammed"),
- ( 9, "Offline"),
- ( 10, "Service Requested"),
- ( 11, "Output Bin Full"),
- ],
- default_value = [9, 10],
- )
- ),
- ("warn_states",
- ListChoice(
- title = _("States who should lead to warning"),
- choices = [
- ( 0, "Unkown"),
- ( 1, "Other"),
- ( 2, "No Error"),
- ( 3, "Low Paper"),
- ( 4, "No Paper"),
- ( 5, "Low Toner"),
- ( 6, "No Toner"),
- ( 7, "Door Open"),
- ( 8, "Jammed"),
- ( 9, "Offline"),
- ( 10, "Service Requested"),
- ( 11, "Output Bin Full"),
- ],
- default_value = [8, 11],
- )
- ),
- ]
- ),
- forth = windows_printer_queues_forth,
- ),
- TextAscii(
- title = _("Printer Name"),
- allow_empty = True
- ),
- match_type = "first",
-)
-
register_check_parameters(
subgroup_printing,
"printer_input",
@@ -7944,62 +7862,6 @@ register_check_parameters(
"dict",
)
-register_check_parameters(
- subgroup_printing,
- "printer_supply",
- _("Printer cartridge levels"),
- 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,
- ),
- TextAscii(
- title = _("cartridge specification"),
- allow_empty = True
- ),
- match_type = "first",
-)
-
def windows_printer_queues_forth(old):
default = {
"warn_states" : [ 8, 11 ],