Module: check_mk
Branch: master
Commit: 20955633d5a22f9c2250bbefca1d85f68083ca63
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=20955633d5a22f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Aug 1 11:57:54 2017 +0200
register_configvar(): need_restart only needed when different from config domain defaults
Change-Id: I7a12db4bbc8eaa5ca680ab0010de03c660d4b51d
---
web/htdocs/watolib.py | 9 ++++++---
web/plugins/wato/check_mk_configuration.py | 26 ++++++++++----------------
2 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 29c4c8f..8f06f87 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -3415,9 +3415,12 @@ def configvar_show_in_global_settings(varname):
return False
-# domain is one of "check_mk", "multisite" or "nagios"
-def register_configvar(group, varname, valuespec, domain="check_mk",
- need_restart=False, allow_reset=True, in_global_settings=True):
+# domain is one of the ConfigDomain classes
+def register_configvar(group, varname, valuespec, domain=None,
+ need_restart=None, allow_reset=True, in_global_settings=True):
+
+ if domain is None:
+ domain = ConfigDomainCore
# New API is to hand over the class via domain argument. But not all calls have been
# migrated. Perform the translation here.
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 5ce6558..ed26313 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -886,7 +886,6 @@ register_configvar(_("Site Management"),
optional_keys = False,
),
domain = ConfigDomainCACertificates,
- need_restart = True,
)
#.
@@ -1260,7 +1259,6 @@ register_configvar(group,
],
render_orientation = "vertical",
),
- need_restart = True
)
@@ -1272,7 +1270,7 @@ register_configvar(group,
"Note: This does <b>not</b> limit the time the agent needs to "
"generate its output."),
minvalue = 1.0),
- need_restart = True)
+)
register_configvar(group,
@@ -1283,7 +1281,7 @@ register_configvar(group,
"No hosts will be contacted, no DNS lookups will take place and data is read "
"from cache files that have been created during normal operation or have "
"been copied here from another monitoring site.")),
- need_restart = True)
+)
register_configvar(group,
"restart_locking",
@@ -1297,9 +1295,9 @@ register_configvar(group,
('abort', _("Abort with an error")),
('wait' , _("Wait until the other has finished") ),
(None , _("Disable locking") ),
- ]),
- need_restart = False
- )
+ ],
+ ),
+)
register_configvar(group,
"agent_simulator",
@@ -1308,8 +1306,7 @@ register_configvar(group,
help = _("When using stored SNMP walks you can place inline code generating "
"dynamic simulation data. This feature can be activated here. There "
"is a big chance that you will never need this feature...")),
- need_restart = True)
-
+)
register_configvar(group,
"delay_precompile",
@@ -1331,7 +1328,7 @@ register_configvar(group,
"checking a cluster. Per default this is enabled and set to 90 seconds. "
"If your check cycle is set to a larger value than one minute then "
"you should increase this accordingly.")),
- need_restart = True)
+)
register_configvar(group,
"piggyback_max_cachefile_age",
@@ -1339,7 +1336,7 @@ register_configvar(group,
help = _("The maximum age for piggy back data from another host to be valid for monitoring. "
"Older files are deleted before processing them. Please make sure that this age is "
"at least as large as you normal check interval for piggy hosts.")),
- need_restart = True)
+)
@@ -1351,7 +1348,7 @@ register_configvar(group,
"for the Check_MK output, giving information regarding the process times. "
"It provides the following fields: user_time, system_time, children_user_time "
"and children_system_time")),
- need_restart = True)
+)
register_configvar(group,
"use_dns_cache",
@@ -1367,7 +1364,6 @@ register_configvar(group,
"enabled it again. OMD based installations automatically update the cache once "
"a day."),
),
- need_restart = True
)
register_configvar(group,
@@ -1383,7 +1379,6 @@ register_configvar(group,
"SNMP mode is a feature which improves the performance for large installations and "
"only available via our subscription."),
),
- need_restart = True
)
register_configvar(group,
@@ -1397,7 +1392,6 @@ register_configvar(group,
"<i>Please note:</i> Only enable this for a short period, because it will "
"decrease the performance of your monitoring."),
),
- need_restart = True
)
group = _("Service discovery")
@@ -1419,7 +1413,7 @@ register_configvar(group,
"automatic rediscovery. Rules in that rule set will override the global "
"settings done here.") % "wato.py?mode=edit_ruleset&varname=periodic_discovery",
),
- need_restart = True)
+)
register_configvar(group,
"inventory_check_severity",
Module: check_mk
Branch: master
Commit: 30eb1fb938ab31962807a6a5df3059175b5ae656
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=30eb1fb938ab31…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 1 09:44:03 2017 +0200
Separated process name setting from set_cmdline() to set_procname()
Change-Id: I2723b0ca5fbdbc75abb148097f7a405a567d3db1
---
lib/daemon.py | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/lib/daemon.py b/lib/daemon.py
index b9323cf..e9efccd 100644
--- a/lib/daemon.py
+++ b/lib/daemon.py
@@ -101,18 +101,32 @@ def set_cmdline(cmdline):
Change the process name and process command line on of the running process
This works at least with Python 2.x on Linux
"""
- libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
-
argv = ctypes.POINTER(ctypes.c_char_p)()
argc = ctypes.c_int()
ctypes.pythonapi.Py_GetArgcArgv(ctypes.byref(argc), ctypes.byref(argv))
cmdlen = sum([len(argv[i]) for i in range(argc.value)]) + argc.value
new_cmdline = ctypes.c_char_p(cmdline.ljust(cmdlen, '\0'))
+ set_procname(cmdline)
+
+
+def set_procname(cmdline):
+ """
+ Change the process name of the running process
+ This works at least with Python 2.x on Linux
+ """
+ libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('c'))
+
+ #argv = ctypes.POINTER(ctypes.c_char_p)()
+
# replace the command line, which is available via /proc/<pid>/cmdline.
# This is .e.g used by ps
- libc.memcpy(argv.contents, new_cmdline, cmdlen)
+ #libc.memcpy(argv.contents, new_cmdline, cmdlen)
# replace the prctl name, which is available via /proc/<pid>/status.
# This is for example used by top and killall
- libc.prctl(15, new_cmdline, 0, 0, 0)
+ #libc.prctl(15, new_cmdline, 0, 0, 0)
+
+ name_buffer = ctypes.create_string_buffer(len(cmdline)+1)
+ name_buffer.value = cmdline
+ libc.prctl(15, ctypes.byref(name_buffer), 0, 0, 0)
Module: check_mk
Branch: master
Commit: 5046a4122d74ddf1cae21e545026c9efc82745b3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5046a4122d74dd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 1 14:11:31 2017 +0200
Fixed recently broken validation of contact group usage
Change-Id: I680a9a3953429ef40f2199715ec3dea37c9f212b
---
web/htdocs/watolib.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index b57447f..29c4c8f 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -8238,7 +8238,8 @@ def delete_group(name, group_type):
# Check if still used
usages = find_usages_of_group(name, group_type)
if usages:
- raise MKUserError(None, _("Unable to delete group. It is still in use"))
+ raise MKUserError(None, _("Unable to delete group. It is still in use by: %s") %
+ ", ".join([ e[0] for e in usages ]))
# Delete group
group = groups.pop(name)
@@ -8344,7 +8345,7 @@ def find_usages_of_contact_group(name):
# Used in default_user_profile?
domain, valuespec, need_restart, allow_reset, in_global_settings = configvars()['default_user_profile']
configured = global_config.get('default_user_profile', {})
- default_value = valuespec.default_value()
+ default_value = domain().default_globals()["default_user_profile"]
if (configured and name in configured['contactgroups']) \
or name in default_value['contactgroups']:
used_in.append(('%s' % (_('Default User Profile')),
@@ -8354,7 +8355,7 @@ def find_usages_of_contact_group(name):
if 'mkeventd_notify_contactgroup' in configvars():
domain, valuespec, need_restart, allow_reset, in_global_settings = configvars()['mkeventd_notify_contactgroup']
configured = global_config.get('mkeventd_notify_contactgroup')
- default_value = valuespec.default_value()
+ default_value = domain().default_globals()["mkeventd_notify_contactgroup"]
if (configured and name == configured) \
or name == default_value:
used_in.append(('%s' % (valuespec.title()),
Module: check_mk
Branch: master
Commit: 1c2c64c221ffa06964abcb19cc951df95a4c814f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1c2c64c221ffa0…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Wed Aug 9 13:31:39 2017 +0200
4813 All recipents of an email are visible in notifications
Notification multiplexing can now be used for HTML and ASCII emails.
By default it is enabled on new and existing Check_MK installations.
If notification multiplexing is enabled only one notification is generated
even if multiple recipients are going to be notified. Therefore, a
user can see and reply to all recipients of a notification.
Furthermore, the notification system will be more performant if graphs
are present in the notification the since only one notification is
generated. The notification multiplexing can be disabled in the section
Notification Method of a notification rule.
Change-Id: I5b0d6a59503c925cecb890787527b78a8db69f8f
---
.werks/4813 | 18 ++++
cmk_base/notify.py | 173 +++++++++++++++++++++++---------------
notifications/asciimail | 2 +
notifications/mail | 2 +
web/plugins/wato/notifications.py | 24 +++++-
5 files changed, 152 insertions(+), 67 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=1c2c64c221…