Module: check_mk
Branch: master
Commit: bffd95d061f3e43447c7cc66338f6c6e49356797
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bffd95d061f3e4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Dec 14 14:11:35 2012 +0100
ldap: Fixed locking problem in page sync hook
---
checkman/uptime | 2 +-
web/htdocs/userdb.py | 2 ++
web/plugins/userdb/ldap.py | 10 ++++++----
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/checkman/uptime b/checkman/uptime
index 914133f..2fa4d95 100644
--- a/checkman/uptime
+++ b/checkman/uptime
@@ -12,5 +12,5 @@ perfdata:
The uptime in seconds.
inventory:
- One check per system is created if the agent has a action {<<<uptime>>>}.
+ One check per system is created if the agent has a section {<<<uptime>>>}.
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 51ca6b6..3533ff5 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -264,6 +264,8 @@ def split_dict(d, keylist, positive):
def save_users(profiles):
custom_values = user_attributes.keys()
+ file('/tmp/a', 'a').write('%d saving users (%s %r)\n' % (time.time(), html.req.myfile, html.req.vars))
+
# Keys not to put into contact definitions for Check_MK
non_contact_keys = [
"roles",
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index cf44790..44d8b6b 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -524,6 +524,10 @@ def ldap_login(username, password):
return result
def ldap_sync(add_to_changelog, only_username):
+ # Store time of the last sync. Don't store after sync since parallel
+ # requests to e.g. the page hook would cause duplicate calculations
+ file(g_ldap_sync_time_file, 'w').write('%s\n' % time.time())
+
ldap_connect()
# Unused at the moment, always sync all users
@@ -572,7 +576,8 @@ def ldap_sync(add_to_changelog, only_username):
users[user_id] = user # Update the user record
if mode_create:
- wato.log_pending(wato.SYNCRESTART, None, "edit-users", _("LDAP Connector: Created user %s" % user_id))
+ wato.log_pending(wato.SYNCRESTART, None, "edit-users",
+ _("LDAP Connector: Created user %s" % user_id))
else:
wato.log_pending(wato.SYNCRESTART, None, "edit-users",
_("LDAP Connector: Modified user %s (Added: %s, Removed: %s, Changed: %s)" %
@@ -580,9 +585,6 @@ def ldap_sync(add_to_changelog, only_username):
save_users(users)
- # Store time of the last sync
- file(g_ldap_sync_time_file, 'w').write('%s\n' % time.time())
-
# Calculates the attributes of the users which are locked for users managed
# by this connector
def ldap_locked_attributes():
Module: check_mk
Branch: master
Commit: ba65bee8b25d68fca8b4d41a593fd4fbe6f5ebbf
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ba65bee8b25d68…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Dec 14 14:08:01 2012 +0100
Added manpage for plesk_domains check
---
checkman/plesk_domains | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/checkman/plesk_domains b/checkman/plesk_domains
new file mode 100644
index 0000000..1a37050
--- /dev/null
+++ b/checkman/plesk_domains
@@ -0,0 +1,22 @@
+title: Dumps out the domains configured in Plesk
+agents: linux
+author: Lars Michelsen <lm(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ Plesk is a commercial webhosting management software. It allows you to
+ manage multiple independent webspace instances including domains and
+ so on.
+
+ This check simply outputs all domains configured in a local plesk
+ installation. It raises a {WARNING} state when no domain is configured,
+ otherwise the plugin is always reporting an {OK} state.
+
+ To make this check work you need to install the agent plugin
+ {plesk_domains} on the host wich runs Plesk in the
+ directory {/usr/lib/check_mk_agent/plugins}.
+
+inventory:
+ One check per system is created if the {plesk_domains} agent plugin
+ is installed and working (it outputs the {<<<plesk_domains>>>} section).
+
Module: check_mk
Branch: master
Commit: eba2b3fbbefc84eb5808a227ec051b058a73e9bf
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=eba2b3fbbefc84…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 13 10:41:16 2012 +0100
ldap: Working around import problems with dist-packages modules in mod_python environments
---
web/plugins/userdb/ldap.py | 24 +++++++++---------------
1 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 8942f77..cc2841e 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -27,21 +27,15 @@
import config, defaults
import time
-# FIXME: For some reason mod_python is missing /usr/lib/python2.7/dist-packages
-# in sys.path. Therefor the ldap module can not be found. Need to fix this!
-#import sys ; sys.path.append('/usr/lib/python2.7/dist-packages')
-#
-# details: /usr/lib/python2.7/site.py
-#
-# My assumption is that there is a problem during compilation/execution of mod_python.
-# When starting python as site user, the correct sys.path is set, when printing sys.path
-# from mod_python code for debugging, it misses a lot of paths.
-#
-# mod_python:
-# ['/omd/sites/event/local/share/check_mk/web/htdocs', '/omd/sites/event/share/check_mk/web/htdocs', '/omd/versions/2012.10.25.mk/lib/python', '/omd/sites/event/lib/python', '/omd/sites/event/local/lib/python', '/usr/lib/python2.7/', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload']
-#
-# >>> sys.path
-# ['', '/usr/local/lib/python2.7/dist-packages/pip-1.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/xhtml2pdf-0.0.4-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pyPdf-1.13-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/html5lib-0.95-py2.7.egg', '/usr/lib/python2.7/dist-packages/PIL', '/usr/local/lib/python2.7/dist-packages/pisa-3.0.33-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-installer', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']
+# For some reason mod_python is missing /usr/lib/python2.7/dist-packages
+# in sys.path. Therefor the ldap module can not be found at least on current
+# ubuntu and sles releases.
+# There seem to be some initialization problems with mod_pythan as the sys.path
+# is correct when excuting python from the command line as site user.
+# Try to workaround the problem now...
+import site, sys
+sys.path.extend(site.getsitepackages())
+
try:
# docs: http://www.python-ldap.org/doc/html/index.html
import ldap
Module: check_mk
Branch: master
Commit: df393444f26298ff224342e5c9b134eca3c3c188
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=df393444f26298…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 12 16:19:33 2012 +0100
Fixed syntax error
---
checks/mysql | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/checks/mysql b/checks/mysql
index 025a0c4..e4773c5 100644
--- a/checks/mysql
+++ b/checks/mysql
@@ -172,7 +172,7 @@ def inventory_mysql_connections(info):
def check_mysql_connections(item, params, info):
values = parse_mysql(info)
if 'Max_used_connections' not in values:
- return (3 'UNKNOWN - Connection information are missing')
+ return (3, 'UNKNOWN - Connection information are missing')
# The maximum number of connections that have been in use simultaneously
# since the server started.