Module: check_mk
Branch: master
Commit: 1206adc7eda85608e188c30fc3977bd4bc41d7cf
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1206adc7eda856…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Feb 11 14:34:24 2016 +0100
Fixed exception when syncing to slave creates initial WATO config on remote site
---
web/htdocs/config.py | 19 ++++++-------------
web/htdocs/wato.py | 6 ++++++
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 2025420..2944146 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -285,7 +285,7 @@ def login_super_user():
user_id = None
global user_role_ids
- user_role_ids = []
+ user_role_ids = [ "admin" ]
global user_baserole_ids
user_baserole_ids = [ "admin" ]
@@ -321,12 +321,6 @@ def hide_language(lang):
return lang in hide_languages
def roles_of_user(user):
- # Make sure, builtin roles are present, even if not modified
- # and saved with WATO.
- for br in builtin_role_ids:
- if br not in roles:
- roles[br] = {}
-
if user in multisite_users:
return existing_role_ids(multisite_users[user]["roles"])
elif user in admin_users:
@@ -422,12 +416,6 @@ def get_role_permissions():
# and for each permission loop all roles
# and check wether it has the permission or not
- # Make sure, builtin roles are present, even if not modified
- # and saved with WATO.
- for br in builtin_role_ids:
- if br not in roles:
- roles[br] = {}
-
roleids = roles.keys()
for perm in permissions_by_order:
for role_id in roleids:
@@ -607,4 +595,9 @@ def save_site_config():
def load_plugins(force):
load_web_plugins("config", globals())
+ # Make sure, builtin roles are present, even if not modified and saved with WATO.
+ for br in builtin_role_ids:
+ roles.setdefault(br, {})
+
+
load_plugins(True)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 305012f..1aefb28 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9491,6 +9491,12 @@ def page_automation():
if secret != get_login_secret():
raise MKAuthException(_("Invalid automation secret."))
+ # The automation page is accessed unauthenticated. After leaving the index.py area
+ # into the page handler we always want to have a user context initialized to keep
+ # the code free from special cases (if no user logged in, then...). So fake the
+ # logged in user here.
+ config.login_super_user()
+
# To prevent mixups in written files we use the same lock here as for
# the normal WATO page processing. This might not be needed for some
# special automation requests, like inventory e.g., but to keep it simple,
Module: check_mk
Branch: master
Commit: 06148959806d62b334392d3a2115fdac229034f7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=06148959806d62…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Feb 11 16:48:25 2016 +0100
#3054 FIX ups_modulys_battery: Fixed wrong remaining minutes in some cases
---
.bugs/2290 | 7 +++++--
.werks/3054 | 9 +++++++++
ChangeLog | 1 +
checks/ups_modulys_battery | 4 ++--
4 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.bugs/2290 b/.bugs/2290
index c540e44..2879da8 100644
--- a/.bugs/2290
+++ b/.bugs/2290
@@ -1,11 +1,14 @@
Title: Clarify encoding within Check_MK (core)
Component: core
-State: open
+Class: nastiness
+State: done
Date: 2015-03-10 09:24:00
Targetversion: 1.2.7
-Class: nastiness
We need to deal correctly with encoding within Check_MK. In Multisite we
have a clear situation. Everything is decoded to unicode strings when
reading into Check_MK. When writing out to external programs it's encoded
with UTF-8 again.
+
+2016-02-11 16:39:56: changed state open -> done
+should be clear now.
diff --git a/.werks/3054 b/.werks/3054
new file mode 100644
index 0000000..593244d
--- /dev/null
+++ b/.werks/3054
@@ -0,0 +1,9 @@
+Title: ups_modulys_battery: Fixed wrong remaining minutes in some cases
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1455205667
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index eff1840..8b2f8ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -268,6 +268,7 @@
* 3174 FIX: Fix exception in Check_MK agent version check if version number does not contain three parts
* 3049 FIX: esx_vsphere_hostsystem.mem_usage_cluster: Fixed exception when no thresholds configured
* 3052 FIX: domino_mailqueues: Fixed exception when receiving empty data from SNMP
+ * 3054 FIX: ups_modulys_battery: Fixed wrong remaining minutes in some cases
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/ups_modulys_battery b/checks/ups_modulys_battery
index 86bc48d..f9f1b21 100644
--- a/checks/ups_modulys_battery
+++ b/checks/ups_modulys_battery
@@ -42,7 +42,7 @@ def check_ups_modulys_battery(item, params, info):
condition, elapsed_sec, capacity = map(lambda x: int(x), (condition, elapsed_sec, capacity))
if elapsed_sec == 0:
# not on battery so the it will not run out
- remainig_min = sys.maxint
+ remaining_min = sys.maxint
elif not remaining_min:
# The "remaining_min" value isn't always reported and we don't know why.
# One theory is that it will be reported if on battery but we have no data to verify.
@@ -50,7 +50,7 @@ def check_ups_modulys_battery(item, params, info):
# If the theory holds true, this branch is never taken. If it doesn't then its likely
# the information is only available on some variants of the device or in some
# configurations. We can still report useful data based on "capacity"
- remainig_min = sys.maxint
+ remaining_min = sys.maxint
else:
remaining_min = int(remaining_min)
Module: check_mk
Branch: master
Commit: 25bc1b3c9f9065fdcef86a7e7ac98b12cc71c656
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=25bc1b3c9f9065…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Feb 11 10:55:13 2016 +0100
Added help texts to log event icons
---
.bugs/1001 | 7 +++++--
.bugs/2185 | 14 ++++++++++++--
.bugs/2411 | 6 ++++--
web/plugins/views/painters.py | 28 +++++++++++++++++++++++++++-
4 files changed, 48 insertions(+), 7 deletions(-)
diff --git a/.bugs/1001 b/.bugs/1001
index 6c57b12..83b5e33 100644
--- a/.bugs/1001
+++ b/.bugs/1001
@@ -1,12 +1,15 @@
Title: check ups_power uses the group 'hw_temperature' which settings levels in degree celcius'
Component: checks
-State: open
+Class: nastiness
+State: done
Date: 2013-08-22 13:43:24
Targetversion: future
-Class: nastiness
Levels for the electric power of ups devices are in watt, however the check uses the group
hw_temperature to set the values with the corresponding wato check in degrees celcius.
This will nevertheless work and may be in active use since the values are integers. However it
may be confusing. A new group hw_power with corresponding wato rule should be added. Customers
need to be aware that this fix may break their existing checks.
+
+2016-02-11 10:37:06: changed state open -> done
+has already been fixed.
diff --git a/.bugs/2185 b/.bugs/2185
index 74270aa..b257b0c 100644
--- a/.bugs/2185
+++ b/.bugs/2185
@@ -1,10 +1,20 @@
Title: Page reload with click on page title loads *.css files new
Component: multisite
-State: open
+Class: nastiness
+State: done
Date: 2014-09-25 16:31:49
Targetversion: future
-Class: nastiness
If you initiate a page reload on a view by clicking on the page title,
then all static web files are being reloaded. This is not neccessary
and create extensive page requests.
+
+2016-02-11 10:45:29: changed state open -> done
+This seems to be the standard behaviour for different situations in most browsers:
+
+a) Entering a new URL in the address bar
+b) reloading the page (e.g. F5, ctrl + r)
+
+In case of following a link this the css files are not loaded.
+
+Seems to be ok.
diff --git a/.bugs/2411 b/.bugs/2411
index 1b0cab8..823db7d 100644
--- a/.bugs/2411
+++ b/.bugs/2411
@@ -1,11 +1,13 @@
Title: Events of the last four hours: mouse hover help for icons
Component: multisite
-State: open
+Class: nastiness
+State: done
Date: 2015-11-16 14:08:07
Targetversion: future
-Class: nastiness
All event icons should have a hover help that explain what type
of event that is. For example light grey loud speaker means a
core notification (and not one to the end user). This need
explanation!
+
+2016-02-11 10:54:13: changed state open -> done
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 67664c4..7320eaf 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -2181,43 +2181,69 @@ multisite_painters["log_command"] = {
"columns" : ["log_command_name"],
"paint" : lambda row: ("nowrap", row["log_command_name"]),
}
+
+
def paint_log_icon(row):
img = None
log_type = row["log_type"]
if log_type == "SERVICE ALERT":
img = { 0: "ok", 1: "warn", 2:"crit", 3:"unknown" }.get(row["log_state"])
+ title = _("Service Alert")
+
elif log_type == "HOST ALERT":
img = { 0: "up", 1: "down", 2:"unreach" }.get(row["log_state"])
+ title = _("Host Alert")
+
elif "DOWNTIME" in log_type:
if row["log_state_type"] in [ "END", "STOPPED" ]:
img = "downtimestop"
+ title = _("Downtime stopped")
else:
img = "downtime"
+ title = _("Downtime")
+
elif log_type.endswith("NOTIFICATION"):
if row["log_command_name"] == "check-mk-notify":
img = "cmk_notify"
+ title = _("Core produced a notification")
else:
img = "notify"
+ title = _("User notification")
+
elif log_type == "EXTERNAL COMMAND":
img = "command"
+ title = _("External command")
+
elif "restarting..." in log_type:
img = "restart"
+ title = _("Core restarted")
+
elif "Reloading configuration" in log_type:
img = "reload"
+ title = _("Core configuration reloaded")
+
elif "starting..." in log_type:
img = "start"
+ title = _("Core started")
+
elif "shutdown..." in log_type or "shutting down" in log_type:
img = "stop"
+ title = _("Core stopped")
+
elif " FLAPPING " in log_type:
img = "flapping"
+ title = _("Flapping")
+
elif "ACKNOWLEDGE ALERT" in log_type:
if row["log_state_type"] == "STARTED":
img = "ack"
+ title = _("Acknowledged")
else:
img = "ackstop"
+ title = _("Stopped acknowledgement")
if img:
- return "icon", '<img class=icon src="images/alert_%s.png">' % img
+ return "icon", '<img class=icon src="images/alert_%s.png" title="%s">' % (img, title)
else:
return "icon", ""