Module: check_mk
Branch: master
Commit: 82b8bb232f1df92fb1461b356a8a05b703b9a069
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=82b8bb232f1df9…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 22 09:40:49 2017 +0100
5536 Network scan: New option to disable configuring "IPv4 Address" attribute
Change-Id: I0f6107fdfb91bd4e1c3f88e0d798385a4c21b017
---
.werks/5536 | 10 ++++++++++
web/htdocs/wato.py | 5 ++++-
web/plugins/wato/builtin_attributes.py | 6 ++++++
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/5536 b/.werks/5536
new file mode 100644
index 0000000..a52a8f8
--- /dev/null
+++ b/.werks/5536
@@ -0,0 +1,10 @@
+Title: Network scan: New option to disable configuring "IPv4 Address"
attribute
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.5.0i2
+Date: 1511340038
+Class: feature
+
+
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 28a0208..eb3df83 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -16787,9 +16787,12 @@ def add_scanned_hosts_to_folder(folder, found):
host_name = cmk.translations.translate_hostname(translation, host_name)
attrs = {
- "ipaddress" : ipaddress,
"tag_criticality" :
network_scan_properties.get("tag_criticality", "offline"),
}
+
+ if network_scan_properties.get("set_ipaddress", True):
+ attrs["ipaddress"] = ipaddress
+
if not watolib.Host.host_exists(host_name):
entries.append((host_name, attrs, None))
diff --git a/web/plugins/wato/builtin_attributes.py
b/web/plugins/wato/builtin_attributes.py
index 635efc9..93bd567 100644
--- a/web/plugins/wato/builtin_attributes.py
+++ b/web/plugins/wato/builtin_attributes.py
@@ -287,6 +287,12 @@ class NetworkScanAttribute(ValueSpecAttribute):
help = _("Limit the execution of the scan to this time
range."),
allow_empty=False,
)),
+ ("set_ipaddress", Checkbox(
+ title = _("Set IPv4 address"),
+ help = _("Whether or not to configure the found IP address
as the IPv4 "
+ "address of the found hosts."),
+ default_value = True,
+ )),
("tag_criticality", DropdownChoice(
title = _("Set criticality host tag"),
help = _("Added hosts will be created as
\"offline\" host by default. You "