Module: check_mk
Branch: master
Commit: 2f223e2c1d1ed284e77c15656112163c9a95d72b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2f223e2c1d1ed2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 10 10:54:43 2017 +0200
Moved internal valuespec from plugins to general WATO code
Change-Id: I2d125d6ea2af729a1e39e071dc25925de64a6bda
---
web/htdocs/wato.py | 58 +++++++++++++++++++++++++++++-
web/plugins/wato/check_mk_configuration.py | 56 +----------------------------
2 files changed, 58 insertions(+), 56 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 73d4176..a89a56d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -3963,7 +3963,7 @@ class ModeBulkDiscovery(WatoMode):
def __init__(self):
super(ModeBulkDiscovery, self).__init__()
self._from_html_vars()
- self._vs = vs_bulk_discovery
+ self._vs = ModeBulkDiscovery.vs_bulk_discovery
self._get_bulk_discovery_params()
@@ -4210,6 +4210,62 @@ class ModeBulkDiscovery(WatoMode):
return entries
+ @classmethod
+ def vs_bulk_discovery(cls, render_form=False):
+ if render_form:
+ render = "form"
+ else:
+ render = None
+
+ return Dictionary(
+ title = _("Bulk discovery"),
+ render = render,
+ elements = [
+ ("mode", RadioChoice(
+ title = _("Mode"),
+ orientation = "vertical",
+ default_value = "new",
+ choices = [
+ ("new", _("Add unmonitored services")),
+ ("remove", _("Remove vanished services")),
+ ("fixall", _("Add unmonitored & remove
vanished services")),
+ ("refresh", _("Refresh all services (tabula
rasa)")),
+ ],
+ )),
+ ("selection", Tuple(
+ title = _("Selection"),
+ elements = [
+ Checkbox(label = _("Include all subfolders"),
+ default_value = True),
+ Checkbox(label = _("Only include hosts that failed on
previous discovery"),
+ default_value = False),
+ Checkbox(label = _("Only include hosts with a failed
discovery check"),
+ default_value = False),
+ Checkbox(label = _("Exclude hosts where the agent is
unreachable"),
+ default_value = False),
+ ]
+ )),
+ ("performance", Tuple(
+ title = _("Performance options"),
+ elements = [
+ Checkbox(label = _("Use cached data if present"),
+ default_value = True),
+ Checkbox(label = _("Do full SNMP scan for SNMP
devices"),
+ default_value = True),
+ Integer(label = _("Number of hosts to handle at
once"),
+ default_value = 10),
+ ]
+ )),
+ ("error_handling", Checkbox(
+ title = _("Error handling"),
+ label = _("Ignore errors in single check plugins"),
+ default_value = True)),
+ ],
+ optional_keys = [],
+ )
+
+
+
def find_hosts_with_failed_inventory_check():
import sites
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index 39663cd..07a06d8 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -78,63 +78,9 @@ def web_log_level_elements():
return elements
-def vs_bulk_discovery(render_form=False):
- if render_form:
- render = "form"
- else:
- render = None
-
- return Dictionary(
- title = _("Bulk discovery"),
- render = render,
- elements = [
- ("mode", RadioChoice(
- title = _("Mode"),
- orientation = "vertical",
- default_value = "new",
- choices = [
- ("new", _("Add unmonitored services")),
- ("remove", _("Remove vanished services")),
- ("fixall", _("Add unmonitored & remove vanished
services")),
- ("refresh", _("Refresh all services (tabula
rasa)")),
- ],
- )),
- ("selection", Tuple(
- title = _("Selection"),
- elements = [
- Checkbox(label = _("Include all subfolders"),
- default_value = True),
- Checkbox(label = _("Only include hosts that failed on previous
discovery"),
- default_value = False),
- Checkbox(label = _("Only include hosts with a failed discovery
check"),
- default_value = False),
- Checkbox(label = _("Exclude hosts where the agent is
unreachable"),
- default_value = False),
- ]
- )),
- ("performance", Tuple(
- title = _("Performance options"),
- elements = [
- Checkbox(label = _("Use cached data if present"),
- default_value = True),
- Checkbox(label = _("Do full SNMP scan for SNMP devices"),
- default_value = True),
- Integer(label = _("Number of hosts to handle at once"),
- default_value = 10),
- ]
- )),
- ("error_handling", Checkbox(
- title = _("Error handling"),
- label = _("Ignore errors in single check plugins"),
- default_value = True)),
- ],
- optional_keys = [],
- )
-
-
register_configvar(group,
"bulk_discovery_default_settings",
- vs_bulk_discovery(),
+ ModeBulkDiscovery.vs_bulk_discovery(),
domain = "multisite"
)