Module: check_mk
Branch: master
Commit: 4cd8aed833d052c28ee06271050eb1150d0a9236
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4cd8aed833d052…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 25 10:07:07 2016 +0200
Added WATO hook to find hosts using same IP address
---
doc/treasures/wato_hook_check_duplicate_hosts.py | 49 ++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/doc/treasures/wato_hook_check_duplicate_hosts.py b/doc/treasures/wato_hook_check_duplicate_hosts.py
new file mode 100644
index 0000000..a27d063
--- /dev/null
+++ b/doc/treasures/wato_hook_check_duplicate_hosts.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# tails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# This hook scans the whole WATO configuration for duplicate hosts having
+# duplicate names or IP addresses and warns the admin about this fact.
+
+# Put this script into local/share/check_mk/web/plugins/wato on a Check_MK site
+# and run "omd reload apache" as site user to ensure the plugin is loaded.
+
+
+def pre_activate_changes_check_duplicate_host(hosts):
+ addresses = {}
+
+ for host_name, attrs in hosts.items():
+ if attrs["ipaddress"]:
+ host_names = addresses.setdefault(attrs["ipaddress"], [])
+ host_names.append(host_name)
+
+
+ for address, host_names in addresses.items():
+ if len(host_names) > 1:
+ html.show_warning("The IP address %s is used for multiple hosts: %s" %
+ (address, ", ".join(host_names)))
+
+
+register_hook('pre-activate-changes', pre_activate_changes_check_duplicate_host)
Module: check_mk
Branch: master
Commit: 92b51256305401af0f61e35c3bfc2295393e81da
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=92b51256305401…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 25 08:46:02 2016 +0200
3720 The Event Console views are now supporting distributed setups
The Event Console was not really supporting distributed setups in the past. In case you have
a setup of multiple sites you always had to decide whether or not to setup a single, central,
EC or one EC per site and how to handle and configure monitoring and notifications.
The Event Console can now be integrated into distributed setups more easily. The standard
setup should now be a single Event Console per site which receives the events of all
hosts monitoringed with this site.
In case you have a central view site, the Event Console views show up the events of all Event
Console instances configured in the central site. You can manage all the events of the remote
Event Console just like managing hosts and services of the remote site.
---
.werks/3720 | 19 +++++++++++++++++++
ChangeLog | 1 +
2 files changed, 20 insertions(+)
diff --git a/.werks/3720 b/.werks/3720
new file mode 100644
index 0000000..b6dae7a
--- /dev/null
+++ b/.werks/3720
@@ -0,0 +1,19 @@
+Title: The Event Console views are now supporting distributed setups
+Level: 2
+Component: ec
+Compatible: compat
+Version: 1.4.0i1
+Date: 1469428806
+Class: feature
+
+The Event Console was not really supporting distributed setups in the past. In case you have
+a setup of multiple sites you always had to decide whether or not to setup a single, central,
+EC or one EC per site and how to handle and configure monitoring and notifications.
+
+The Event Console can now be integrated into distributed setups more easily. The standard
+setup should now be a single Event Console per site which receives the events of all
+hosts monitoringed with this site.
+
+In case you have a central view site, the Event Console views show up the events of all Event
+Console instances configured in the central site. You can manage all the events of the remote
+Event Console just like managing hosts and services of the remote site.
diff --git a/ChangeLog b/ChangeLog
index 1d70b85..fabe220 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -550,6 +550,7 @@
* 3656 Added support for syslog messages produced by Aristana devices...
* 3716 New sites now have a default rule pack from the start
* 3717 Added search to EC settings and structured the options in multiple settings
+ * 3720 The Event Console views are now supporting distributed setups...
* 3058 FIX: Event Console is now allowing non loadable MIB modules on startup...
* 3097 FIX: mkeventd: fixed crash with non-descriptive error message if mibs couldn't be loaded
* 3335 FIX: Improved error handling when requested rule pack does not exist
Module: check_mk
Branch: master
Commit: e18dd1c5084d982286a9e0b11064b6199a08a4e6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e18dd1c5084d98…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Sat Jul 23 12:46:12 2016 +0200
Updated bug entries #2387
---
.bugs/2387 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/2387 b/.bugs/2387
index 4b09c44..f95e385 100644
--- a/.bugs/2387
+++ b/.bugs/2387
@@ -1,9 +1,12 @@
Title: Better error message if omd is executed in deleted folder
Component: core
-State: open
+Class: todo
+State: done
Date: 2015-10-08 12:14:57
Targetversion: future
-Class: todo
If the command omd is executed in a deleted folder the error message is not helpful for the user.
It should be more userfriendly.
+
+2016-07-23 12:42:39: changed state open -> done
+already fixed
Module: check_mk
Branch: master
Commit: fe2104babd3f39a602fb81c9402d2943d4fab86e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fe2104babd3f39…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 22 18:04:44 2016 +0200
Updated bug entries #2462
---
.bugs/2462 | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/.bugs/2462 b/.bugs/2462
new file mode 100644
index 0000000..54dd441
--- /dev/null
+++ b/.bugs/2462
@@ -0,0 +1,11 @@
+Title: EC: User without permission to host can view host information
+Component: multisite
+State: open
+Date: 2016-07-22 18:02:26
+Targetversion: 1.2.8
+Class: bug
+
+When viewing an event of a host which the user is not permitted to see
+while the user has "see all events permission", the user sees the
+service states in the last column. The user can also add more columns
+to the view to see all information about the host.
Module: check_mk
Branch: master
Commit: fb2c159dbd85e098b1263c80ea138b73b3114644
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fb2c159dbd85e0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 22 18:24:11 2016 +0200
3718 FIX Changes not needing a core restart are not showing up pending changes anymore
Those changes where shown by the pending changes log but automatically commited
when opening the activate changes page.
---
.werks/3718 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/watolib.py | 43 +++++++++++++++++++------------------------
3 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/.werks/3718 b/.werks/3718
new file mode 100644
index 0000000..23b799d
--- /dev/null
+++ b/.werks/3718
@@ -0,0 +1,11 @@
+Title: Changes not needing a core restart are not showing up pending changes anymore
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1469204588
+
+Those changes where shown by the pending changes log but automatically commited
+when opening the activate changes page.
diff --git a/ChangeLog b/ChangeLog
index dd164bf..e27eb62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -498,6 +498,7 @@
* 3661 FIX: Service discovery is now possible with only "modify services" permission...
* 3152 FIX: lvm_vgs: fixed exception in host-specific settings if rule for LVM groups is set
* 3557 FIX: Web API: get_host/get_all_hosts action now also returns the nodes of cluster host
+ * 3718 FIX: Changes not needing a core restart are not showing up pending changes anymore...
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 861383c..d01c1b9 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -214,7 +214,6 @@ def log_audit(linkinfo, what, message, user_id = None):
# sites have already been marked for restart. Do nothing here.
# In non-distributed mode mark for restart
def log_pending(status, linkinfo, what, message, user_id = None):
-
log_audit(linkinfo, what, message, user_id)
need_sidebar_reload()
@@ -223,35 +222,31 @@ def log_pending(status, linkinfo, what, message, user_id = None):
# pylint: disable=undefined-variable
need_to_bake_agents()
- # The latter one condition applies to slave sites
- # Otherwise slave sites would trigger the cmcrushd
- if not is_distributed() and not is_wato_slave_site():
- if status != SYNC:
- log_entry(linkinfo, what, message, "pending.log", user_id)
+ # Only add pending log entries when a restart is needed
+ if has_wato_slave_sites() or status in [ RESTART, SYNCRESTART, LOCALRESTART ]:
+ log_entry(linkinfo, what, message, "pending.log", user_id)
# Currently we add the pending to each site, regardless if
# the site is really affected. This needs to be optimized
# in future.
- else:
- log_entry(linkinfo, what, message, "pending.log", user_id)
- for siteid, site in config.sites.items():
+ for siteid, site in config.sites.items():
+ changes = {}
- changes = {}
+ # Local site can never have pending changes to be synced
+ if config.site_is_local(siteid):
+ if status in [ RESTART, SYNCRESTART ]:
+ changes["need_restart"] = True
+ else:
+ if status in [ SYNC, SYNCRESTART ]:
+ changes["need_sync"] = True
- # Local site can never have pending changes to be synced
- if config.site_is_local(siteid):
- if status in [ RESTART, SYNCRESTART ]:
- changes["need_restart"] = True
- else:
- if status in [ SYNC, SYNCRESTART ]:
- changes["need_sync"] = True
- if status in [ RESTART, SYNCRESTART ]:
- changes["need_restart"] = True
- update_replication_status(siteid, changes)
-
- # Make sure that a new snapshot for syncing will be created
- # when times comes to syncing
- remove_sync_snapshot(siteid)
+ if status in [ RESTART, SYNCRESTART ]:
+ changes["need_restart"] = True
+ update_replication_status(siteid, changes)
+
+ # Make sure that a new snapshot for syncing will be created
+ # when times comes to syncing
+ remove_sync_snapshot(siteid)
def log_exists(what):
Module: check_mk
Branch: master
Commit: c70e2449d3d4564d8fc0c78fd8ca423b0fdeea5e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c70e2449d3d456…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 22 18:45:33 2016 +0200
3719 FIX Fixed possible wrong encoding of audit log messages when editing global settings
---
.werks/3719 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 7 ++++---
web/htdocs/watolib.py | 6 +++++-
4 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/.werks/3719 b/.werks/3719
new file mode 100644
index 0000000..73ebcf8
--- /dev/null
+++ b/.werks/3719
@@ -0,0 +1,10 @@
+Title: Fixed possible wrong encoding of audit log messages when editing global settings
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1469205887
+
+
diff --git a/ChangeLog b/ChangeLog
index e27eb62..1d70b85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -499,6 +499,7 @@
* 3152 FIX: lvm_vgs: fixed exception in host-specific settings if rule for LVM groups is set
* 3557 FIX: Web API: get_host/get_all_hosts action now also returns the nodes of cluster host
* 3718 FIX: Changes not needing a core restart are not showing up pending changes anymore...
+ * 3719 FIX: Fixed possible wrong encoding of audit log messages when editing global settings
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index ff657d2..95185c4 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -4883,7 +4883,8 @@ def render_audit_log(log, what, with_filename = False, hilite_others=False):
_("This change has been made by another user"))
htmlcode += user + '</td>'
- htmlcode += '</td><td width="100%%">%s</td></tr>\n' % html.attrencode(text)
+ # This must not be attrencoded: The entries are encoded when writing to the log.
+ htmlcode += '</td><td width="100%%">%s</td></tr>\n' % text
htmlcode += "</table>"
if what == 'audit':
@@ -6815,8 +6816,8 @@ def mode_edit_configvar(phase, what = 'globalvars'):
else:
new_value = get_edited_value(valuespec)
current_settings[varname] = new_value
- msg = _("Changed global configuration variable %s to %s.") \
- % (varname, valuespec.value_to_text(new_value))
+ msg = HTML(_("Changed global configuration variable %s to %s.") \
+ % (varname, valuespec.value_to_text(new_value)))
if siteid:
save_sites(configured_sites, activate=False)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index d01c1b9..eb5435d 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -175,7 +175,11 @@ def foreign_changes():
# linkinfo identifies the object operated on. It can be a Host or a Folder
# or a text.
def log_entry(linkinfo, action, message, logfilename, user_id = None):
- message = make_utf8(message).strip()
+ # Using attrencode here is against our regular rule to do the escaping
+ # at the last possible time: When rendering. But this here is the last
+ # place where we can distinguish between HTML() encapsulated (already)
+ # escaped / allowed HTML and strings to be escaped.
+ message = make_utf8(html.attrencode(message)).strip()
# linkinfo is either a Folder, or a Host or a hostname or None
if isinstance(linkinfo, Folder):
Module: check_mk
Branch: master
Commit: f49e3fa79ae7a0466b6ddc84dcce3f5cf8d7e57e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f49e3fa79ae7a0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 25 08:11:59 2016 +0200
Updated bug entries #2314
---
.bugs/2314 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/2314 b/.bugs/2314
index 5286d2d..6581807 100644
--- a/.bugs/2314
+++ b/.bugs/2314
@@ -1,9 +1,9 @@
Title: Cleanup json output format of views to use the json module
Component: multisite
-State: open
+Class: cleanup
+State: done
Date: 2015-04-13 14:30:38
Targetversion: 1.2.7
-Class: cleanup
We have the simplejson module shipped with OMD now, so we can use
@@ -14,3 +14,6 @@ except ImportError:
to get the json module which can then be used to encode the
data in json format easily.
+
+2016-07-23 12:52:17: changed state open -> done
+already fixed