Module: check_mk
Branch: master
Commit: 63cfd32c5669564109c8397ddd39c9f136be916c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=63cfd32c566956…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jun 4 08:39:38 2014 +0200
FIX LDAP: Improved slightly missleading logging of LDAP sync actions
In some situations a call to WATO issued by the user are causing LDAP syncs,
for example when a user starts the sync interactively or the cache lifetime
has exceeded. …
[View More]In the past, the name of the triggering user was logged
to the audit / pending log, which was a bit missleading. Now, the name
of the user is not logged anymore.
---
.werks/813 | 12 ++++++++++++
ChangeLog | 3 +++
web/htdocs/wato.py | 26 ++++++++++++++++----------
web/plugins/userdb/ldap.py | 8 +++++---
4 files changed, 36 insertions(+), 13 deletions(-)
diff --git a/.werks/813 b/.werks/813
new file mode 100644
index 0000000..3cb96eb
--- /dev/null
+++ b/.werks/813
@@ -0,0 +1,12 @@
+Title: LDAP: Improved slightly missleading logging of LDAP sync actions
+Level: 1
+Component: wato
+Version: 1.2.5i4
+Date: 1401863855
+Class: fix
+
+In some situations a call to WATO issued by the user are causing LDAP syncs,
+for example when a user starts the sync interactively or the cache lifetime
+has exceeded. In the past, the name of the triggering user was logged
+to the audit / pending log, which was a bit missleading. Now, the name
+of the user is not logged anymore.
diff --git a/ChangeLog b/ChangeLog
index abfe129..154f620 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
Multisite:
* 0934 FIX: Logwatch messages with class unknown ( 'u' ) now displayed as WARN...
+ WATO:
+ * 0813 FIX: LDAP: Improved slightly missleading logging of LDAP sync actions...
+
1.2.5i3:
Core & Setup:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 4caca4d..97a8e1c 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -4970,13 +4970,13 @@ def mode_changelog(phase):
def foreign_changes():
changes = {}
for t, linkinfo, user, action, text in parse_audit_log("pending"):
- if user != config.user_id:
+ if user != '-' and user != config.user_id:
changes.setdefault(user, 0)
changes[user] += 1
return changes
-def log_entry(linkinfo, action, message, logfilename):
+def log_entry(linkinfo, action, message, logfilename, user_id = None):
if type(message) == unicode:
message = message.encode("utf-8")
message = message.strip()
@@ -4991,16 +4991,21 @@ def log_entry(linkinfo, action, message, logfilename):
else:
link = ":" + linkinfo
+ if user_id == None:
+ user_id = config.user_id
+ elif user_id == '':
+ user_id = '-'
+
log_file = log_dir + logfilename
make_nagios_directory(log_dir)
f = create_user_file(log_file, "ab")
- f.write("%d %s %s %s %s\n" % (int(time.time()), link, config.user_id, action, message))
+ f.write("%d %s %s %s %s\n" % (int(time.time()), link, user_id, action, message))
-def log_audit(linkinfo, what, message):
+def log_audit(linkinfo, what, message, user_id = None):
if config.wato_use_git:
g_git_messages.append(message)
- log_entry(linkinfo, what, message, "audit.log")
+ log_entry(linkinfo, what, message, "audit.log", user_id)
# status is one of:
# SYNC -> Only sync neccessary
@@ -5011,13 +5016,13 @@ def log_audit(linkinfo, what, message):
# LOCALRESTART-> Called after inventory. In distributed mode, affected
# sites have already been marked for restart. Do nothing here.
# In non-distributed mode mark for restart
-def log_pending(status, linkinfo, what, message):
- log_audit(linkinfo, what, message)
+def log_pending(status, linkinfo, what, message, user_id = None):
+ log_audit(linkinfo, what, message, user_id)
need_sidebar_reload()
if not is_distributed():
if status != SYNC:
- log_entry(linkinfo, what, message, "pending.log")
+ log_entry(linkinfo, what, message, "pending.log", user_id)
cmc_rush_ahead()
@@ -5025,7 +5030,7 @@ def log_pending(status, linkinfo, what, message):
# the site is really affected. This needs to be optimized
# in future.
else:
- log_entry(linkinfo, what, message, "pending.log")
+ log_entry(linkinfo, what, message, "pending.log", user_id)
for siteid, site in config.sites.items():
changes = {}
@@ -5255,12 +5260,13 @@ def render_audit_log(log, what, with_filename = False, hilite_others=False):
even = "even"
for t, linkinfo, user, action, text in log:
even = even == "even" and "odd" or "even"
- hilite = hilite_others and config.user_id != user
+ hilite = hilite_others and user != '-' and config.user_id != user
htmlcode += '<tr class="data %s%d">' % (even, hilite and 2 or 0)
htmlcode += '<td class=nobreak>%s</td>' % render_linkinfo(linkinfo)
htmlcode += '<td class=nobreak>%s</td>' % fmt_date(float(t))
htmlcode += '<td class=nobreak>%s</td>' % fmt_time(float(t))
htmlcode += '<td class=nobreak>'
+ user = user == '-' and ('<i>%s</i>' % _('internal')) or user
if hilite:
htmlcode += '<img class=icon src="images/icon_foreign_changes.png" title="%s">' \
% _("This change has been made by another user")
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 7a27705..3627c55 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -1014,7 +1014,8 @@ def ldap_sync(add_to_changelog, only_username):
for user_id, user in users.items():
if user.get('connector') == 'ldap' and user_id not in ldap_users:
del users[user_id] # remove the user
- wato.log_pending(wato.SYNCRESTART, None, "edit-users", _("LDAP Connector: Removed user %s" % user_id))
+ wato.log_pending(wato.SYNCRESTART, None, "edit-users",
+ _("LDAP Connector: Removed user %s" % user_id), user_id = '')
for user_id, ldap_user in ldap_users.items():
if user_id in users:
@@ -1047,7 +1048,7 @@ def ldap_sync(add_to_changelog, only_username):
if mode_create:
wato.log_pending(wato.SYNCRESTART, None, "edit-users",
- _("LDAP Connector: Created user %s" % user_id))
+ _("LDAP Connector: Created user %s" % user_id), user_id = '')
else:
details = []
if added:
@@ -1066,7 +1067,8 @@ def ldap_sync(add_to_changelog, only_username):
if details:
wato.log_pending(wato.SYNCRESTART, None, "edit-users",
- _("LDAP Connector: Modified user %s (%s)") % (user_id, ', '.join(details)))
+ _("LDAP Connector: Modified user %s (%s)") % (user_id, ', '.join(details)),
+ user_id = '')
duration = time.time() - start_time
ldap_log('SYNC FINISHED - Duration: %0.3f sec' % duration)
[View Less]
Module: check_mk
Branch: master
Commit: eebf84a2b8162261dbb719fc69a78cdee3399460
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eebf84a2b81622…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jun 3 15:48:33 2014 +0200
nginx_status: New check for monitoring status information of the Nginx web server
Implemented a new check which uses the Nginx stub status module to monitoring inner
information of the Nginx process about number of active connections, …
[View More]connections per
second, requests per second and so on.
---
.werks/812 | 10 +++
ChangeLog | 1 +
agents/plugins/nginx_status | 119 +++++++++++++++++++++++++++++++
checkman/nginx_status | 77 ++++++++++++++++++++
checks/nginx_status | 112 +++++++++++++++++++++++++++++
pnp-templates/check_mk-nginx_status.php | 86 ++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 26 +++++++
7 files changed, 431 insertions(+)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=eebf84a2b8…
[View Less]
Module: check_mk
Branch: master
Commit: c411a6381b720984b0256ac45ec91bb916a0ed54
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c411a6381b7209…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jun 3 15:49:44 2014 +0200
Fixed werk version
---
.werks/812 | 2 +-
ChangeLog | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.werks/812 b/.werks/812
index f5c4e1b..a326220 100644
--- a/.werks/812
+++ b/.werks/812
@@ -1,7 +1,7 …
[View More]@@
Title: nginx_status: New check for monitoring status information of the Nginx web server
Level: 2
Component: checks
-Version: 1.2.5i3
+Version: 1.2.5i4
Date: 1401803233
Class: feature
diff --git a/ChangeLog b/ChangeLog
index 8158c18..abfe129 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
1.2.5i4:
+ Checks & Agents:
+ * 0812 nginx_status: New check for monitoring status information of the Nginx web server...
+
Multisite:
* 0934 FIX: Logwatch messages with class unknown ( 'u' ) now displayed as WARN...
@@ -73,11 +76,8 @@
* 0165 ups checks now supports also GE devices (Thanks to Andy Taylor)...
* 0928 runas: new plugin script to include and execute mrpe, local and plugin scripts as different user...
* 0929 windows agent: now able to include and execute additional local and plugin scripts as different user...
-<<<<<<< HEAD
* 0812 nginx_status: New check for monitoring status information of the Nginx web server...
-=======
* 0961 fast_lta_volumes: new check of capacity of volumes in FAST LTA Storage Systems...
->>>>>>> ad3197103fd23d053fa8941a5c23ecfbc34b1c8b
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
* 0786 FIX: zfsget: fixed compatibility with older Solaris agents...
* 0809 FIX: brocade_fcport: Fixed recently introduced problem with port speed detection
[View Less]
Module: check_mk
Branch: master
Commit: 201a1eb2c74447483c708ce541d0e755798d6b39
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=201a1eb2c74447…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jun 3 10:38:44 2014 +0200
Fixed file header of LogEntry.cc
---
livestatus/src/LogEntry.cc | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/livestatus/src/LogEntry.cc b/livestatus/src/LogEntry.cc
index 5d4783b..…
[View More]2706a20 100644
--- a/livestatus/src/LogEntry.cc
+++ b/livestatus/src/LogEntry.cc
@@ -4,24 +4,23 @@
// | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
// | | |___| | | | __/ (__| < | | | | . \ |
// | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
-// | |_____| |
-// | __ __ _ ____ |
-// | | \/ (_) ___ _ __ ___ / ___|___ _ __ ___ |
-// | | |\/| | |/ __| '__/ _ \ | | / _ \| '__/ _ \ |
-// | | | | | | (__| | | (_) | | |__| (_) | | | __/ |
-// | |_| |_|_|\___|_| \___/ \____\___/|_| \___| |
// | |
// | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
// +------------------------------------------------------------------+
//
-// This file is part of the Check_MK Micro Core. Copyright by Mathias
-// Kettner, Preysingstr. 74, 81667 München, Germany. All rights are
-// reserved. You may *not* redistribute or modify this software unless
-// you have a written permission of the owner. This file is *not*
-// available under GNU GPL. If you do not like this then please use a
-// different monitoring core.
+// This file is part of Check_MK.
+// The official homepage is at http://mathias-kettner.de/check_mk.
//
-// Please note: This software is experimental. Use at your own risk.
+// 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-
+// ails. 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.
#include <string.h>
#include <time.h>
[View Less]