Module: check_mk
Branch: master
Commit: dd604222bb9e1ac1429935b6a7645a4276e14536
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dd604222bb9e1a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 17 15:19:50 2013 +0100
Added FOREACH_SERVICE capability to leaf nodes
---
.bugs/785 | 16 ++++++++++++++--
ChangeLog | 3 +++
web/htdocs/bi.py | 6 +++++-
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/.bugs/785 b/.bugs/785
index 07683d9..8f28356 100644
--- a/.bugs/785
+++ b/.bugs/785
@@ -1,9 +1,9 @@
Title: FOREACH_SERVICE in a leaf node does not work for direct host/services
Component: bi
-State: open
+Class: bug
+State: done
Date: 2012-07-26 16:05:16
Targetversion: 1.2.2
-Class: bug
If you use FOREACH_SERVICE within an inner node then you cannot
directly add leaf nodes. The following produces an error:
@@ -14,3 +14,15 @@ aggregation_rules[...] = (
( FOREACH_SERVICE, ALL_HOSTS, ".*", "$1$", HOST_STATE ),
]
)
+
+2013-01-17 15:19:06: changed state open -> done
+1. added FOREACH_SERVICE for leaf nodes
+2. the following works for me now:
+
+(FOREACH_SERVICE, "localhost", "fs_(.*)", "filesystem", [ "localhost", "$1$" ] ),
+(FOREACH_SERVICE, "localhost", "fs_(.*)", "localhost", "fs_$1$"),
+(FOREACH_SERVICE, "localhost", "fs_(.*)", "localhost", "fs_$1$" ),
+(FOREACH_SERVICE, "localhost", "fs_(.*)", "localhost", HOST_STATE ),
+(FOREACH_SERVICE, "(.*)", "fs_(.*)", "$1$", HOST_STATE ),
+
+Some of the rules are senseless but should work in general.
diff --git a/ChangeLog b/ChangeLog
index 86173bb..dc1685a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,9 @@
* FIX: Fixed displaying of tag selections when creating a rule in the ruleeditor
* FIX: Rulesets are always cloned in the same folder
+ BI:
+ * Added FOREACH_SERVICE capability to leaf nodes
+
1.2.1i4:
Core:
* Better exception handling when executing "Check_MK"-Check. Printing python
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index c8b5c16..ad13490 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -736,7 +736,11 @@ def compile_aggregation_rule(aggr_type, rule, args, lvl):
new_elements = new_new_elements
elif type(node[-1]) != list:
- if node[0] in [ config.FOREACH_HOST, config.FOREACH_CHILD, config.FOREACH_PARENT ]:
+ if node[0] in [
+ config.FOREACH_HOST,
+ config.FOREACH_CHILD,
+ config.FOREACH_PARENT,
+ config.FOREACH_SERVICE ]:
# Handle case that leaf elements also need to be iterable via FOREACH_HOST
# 1: config.FOREACH_HOST
# 2: (['waage'], '(.*)')
Module: check_mk
Branch: master
Commit: 1b56dd316654076e4d74a3d7d78e36feb6fc9be2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1b56dd31665407…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 17 14:02:36 2013 +0100
Fixed wrong infos in doku
---
.bugs/881 | 7 +++++--
checkman/fileinfo.groups | 4 ++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/.bugs/881 b/.bugs/881
index 8f79cc3..46d324c 100644
--- a/.bugs/881
+++ b/.bugs/881
@@ -1,9 +1,9 @@
Title: Manpage of fileinfo outdated
Component: docu
-State: open
+Class: bug
+State: done
Date: 2012-11-22 12:21:55
Targetversion: 1.2.2
-Class: bug
The man page of fileinfo is not uptodate: The linux agent now
supports fileinfo. Also the configuration of that should be
@@ -11,3 +11,6 @@ described here.
The man page of fileinfo.groups: do we really have regular expressions?
It does not seem to work...
+
+2013-01-17 14:02:22: changed state open -> done
+Has just been fixed.
diff --git a/checkman/fileinfo.groups b/checkman/fileinfo.groups
index edf48bb..8fcbc12 100644
--- a/checkman/fileinfo.groups
+++ b/checkman/fileinfo.groups
@@ -1,5 +1,5 @@
title: Check age, size and count of a group of files
-agents: windows
+agents: windows, linux
author: Bastian Kuhn <bk(a)mathias-kettner.de>
license: GPL
distribution: check_mk
@@ -23,7 +23,7 @@ item:
examples:
fileinfo_groups = [
- ([("Auth_group",r"/var/log/auth.*")], ALL_HOSTS),
+ ([("Auth_group",r"/var/log/auth*")], ALL_HOSTS),
([("Message_group", r"/var/log/messages*")], ['test2'], ALL_HOSTS),
]
Module: check_mk
Branch: master
Commit: a677423faf897e15f79179e800d684c8138af098
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a677423faf897e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 17 13:59:51 2013 +0100
Added linux related infos to fileinfo manpage
---
checkman/fileinfo | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/checkman/fileinfo b/checkman/fileinfo
index 2b8ed98..506362d 100644
--- a/checkman/fileinfo
+++ b/checkman/fileinfo
@@ -1,5 +1,5 @@
title: Check age and size of files
-agents: windows
+agents: windows, linux
author: Mathias Kettner <mk(a)mathias-kettner.de>
license: GPL
distribution: check_mk
@@ -15,14 +15,20 @@ description:
as the agent needs to know the information about
which files need to be sent.
- Currently only the Windows agent supports this type
- of check. Configuration is done in {check_mk.ini} in
- the section {[fileinfo]}. Put one or more entries
- of the format {path = C:\Some Dir\*.log} into this
+ Currently the linux and windows agents supports this type
+ of check.
+
+ For windows, the configuration is done in {check_mk.ini} in
+ the section {[fileinfo]}. Put one or more entries of the
+ format {path = C:\Some Dir\*.log} into this
section. The agent will send all files that match
the pattern. Wildcards are only allowed in the
filename part, not in the directory path.
+ For linux, the configuration is done via {fileinfo.cfg} located
+ in the {$MK_CONFDIR} (usually {/etc/check_mk/fileinfo.cfg}).
+ To add files to the check, simply add one path pattern per line.
+
item:
The complete path name of the file as sent by
the agent (this is case sensitive even when monitoring
Module: check_mk
Branch: master
Commit: 1aee94e80c947bf3ab0fd5c4f43d6900bd2fb985
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1aee94e80c947b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 17 13:08:43 2013 +0100
FIX: LDAP: Fixed encoding problem of ldap retrieved usernames
---
ChangeLog | 1 +
web/htdocs/userdb.py | 3 +++
web/plugins/userdb/ldap.py | 4 ++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e09e3fe..f009631 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
contactgroup sync plugin enabled
* FIX: LDAP: OpenLDAP - Changed default filter for users
* FIX: LDAP: OpenLDAP - Using uniqueMember instead of member when searching for groups of a user
+ * FIX: LDAP: Fixed encoding problem of ldap retrieved usernames
* LDAP: Role sync plugin validates the given group DNs with the group base dn now
* LDAP: Using roles defined in default user profile in role sync plugin processing
* LDAP: Improved error handling in case of misconfigurations
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 843994c..2699f6c 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -472,6 +472,9 @@ def hook_login(username, password):
# False -> failed
if result not in [ False, None ]:
username = result
+ if type(username) != str:
+ raise MKInternalError(_("The username returned by the %s "
+ "connector is not of type string (%r).") % (connector['id'], username))
# Check wether or not the user exists (and maybe create it)
create_non_existing_user(connector['id'], username)
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index bc5469a..b812658 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -35,7 +35,7 @@ except:
pass
from lib import *
-g_ladp_user_cache = {}
+g_ldap_user_cache = {}
g_ldap_group_cache = {}
# File for storing the time of the last success event
@@ -571,7 +571,7 @@ def ldap_login(username, password):
# authentication which should be rebound again after trying this.
try:
ldap_bind(user_dn, password)
- result = username
+ result = username.encode('utf-8')
except:
result = False
Module: check_mk
Branch: master
Commit: b8c1e0365c03bc40967094b8c8290fd8dc331a72
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b8c1e0365c03bc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 17 12:24:08 2013 +0100
FIX: megaraid_bbu - Handle missing charge information (ignoring them)
---
ChangeLog | 1 +
checks/megaraid_bbu | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b00924e..e09e3fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
* Logwatch: unknown eventlog level ('u') from windows agent treated as warning
* FIX: logwatch_ec: Added state undefined as priority
* Add: mailman_lists - New check to gather statistics of mailman mailinglists
+ * FIX: megaraid_bbu - Handle missing charge information (ignoring them)
Multisite:
* FIX: Fixed rendering of dashboard globes in opera
diff --git a/checks/megaraid_bbu b/checks/megaraid_bbu
index be2f9b2..dda2c4c 100644
--- a/checks/megaraid_bbu
+++ b/checks/megaraid_bbu
@@ -79,8 +79,10 @@ def check_megaraid_bbu(item, _no_params, info):
broken = []
state = 0
# get current charge level
- charge = (", Charge is %s" % controller['Relative State of Charge'])
-
+ if 'Relative State of Charge' not in controller:
+ charge = ", No charge information were reported for this controller"
+ else:
+ charge = ", Charge is %s" % controller['Relative State of Charge']
# verify defined important parameters to current level
for varname, (refvalue, refstate) in megaraid_bbu_refvalues.items():
Module: check_mk
Branch: master
Commit: f4133ad90e954f3062294f1969d565cd4d828bab
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f4133ad90e954f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 17 12:11:07 2013 +0100
Updated bug entries #0823
---
.bugs/823 | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/823 b/.bugs/823
index 4e28cf2..5d23984 100644
--- a/.bugs/823
+++ b/.bugs/823
@@ -1,8 +1,11 @@
Title: Cloned ruleset apears always in Main Directory
Component: wato
-State: open
+Class: bug
+State: done
Date: 2013-01-11 16:11:04
Targetversion: 1.2.2
-Class: bug
If a rule is cloned, the new rule always is created in the Main Directory
+
+2013-01-17 12:11:02: changed state open -> done
+Has just been fixed.
Module: check_mk
Branch: master
Commit: 67d7cf697cc4440ac875ddcb3a4f9ec63149cf64
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=67d7cf697cc444…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 17 11:55:31 2013 +0100
Add: mailman_lists - New check to gather statistics of mailman mailinglists
---
.bugs/757 | 2 +-
ChangeLog | 1 +
agents/plugins/mailman_lists | 30 ++++++++++++++++++++++++++++++
checkman/mailman_lists | 16 ++++++++++++++++
checks/mailman_lists | 42 ++++++++++++++++++++++++++++++++++++++++++
5 files changed, 90 insertions(+), 1 deletions(-)
diff --git a/.bugs/757 b/.bugs/757
index d647c09..da907dd 100644
--- a/.bugs/757
+++ b/.bugs/757
@@ -2,7 +2,7 @@ Title: Compilation of livecheck with dietlibc broken on SLES11SP1/2
Component: livecheck
State: open
Date: 2012-05-25 10:28:46
-Targetversion: 1.2.2
+Targetversion: future
Class: nastiness
Generally we should enable compiling livecheck with dietlibc in
diff --git a/ChangeLog b/ChangeLog
index 3936fd7..40ed03c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
* Add: fileinfo is now supported by the solaris agent. Thanks to Daniel Roettgermann
* Logwatch: unknown eventlog level ('u') from windows agent treated as warning
* FIX: logwatch_ec: Added state undefined as priority
+ * Add: mailman_lists - New check to gather statistics of mailman mailinglists
Multisite:
* FIX: Fixed rendering of dashboard globes in opera
diff --git a/agents/plugins/mailman_lists b/agents/plugins/mailman_lists
new file mode 100755
index 0000000..9371082
--- /dev/null
+++ b/agents/plugins/mailman_lists
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+# encoding: utf-8
+# This Check_MK-Agent plugin gathers information about mailinglists hosted
+# by the local mailman instance.
+
+# Needed if you have located your mailman python modules not in default
+# python module paths
+import sys
+sys.path.append("/usr/local/mailman")
+
+# Set to True to filter out all "hidden" mailinglists
+only_advertised = True
+
+from Mailman import Utils, MailList
+
+# 1. list memberships
+print '<<<mailman_lists>>>'
+total_members = set([])
+for name in sorted(Utils.list_names()):
+ mlist = MailList.MailList(name, lock=0)
+ if only_advertised and not mlist.advertised:
+ continue
+
+ rmembers = mlist.getRegularMemberKeys()
+ dmembers = mlist.getDigestMemberKeys()
+ members = rmembers + dmembers
+ total_members.update(members)
+
+ print '%s %d' % (name, len(members))
+print 'TOTAL %d' % len(total_members)
diff --git a/checkman/mailman_lists b/checkman/mailman_lists
new file mode 100644
index 0000000..73252d3
--- /dev/null
+++ b/checkman/mailman_lists
@@ -0,0 +1,16 @@
+title: Monitor mailinglist statistics of Mailman
+agents: linux
+author: Lars Michelsen <lm(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check gathers statistics of Mailinglists hosted with Mailman.
+ Currently the check monitors only the number of subscribed members
+ but might be extended by other statistic information.
+
+ To make this check work, you have to install the mailman_lists
+ agent plugin on your the host running mailman.
+
+inventory:
+ Each mailinglist results in one service. The service is named by
+ the internal name of the mailinglist
diff --git a/checks/mailman_lists b/checks/mailman_lists
new file mode 100644
index 0000000..a3dee84
--- /dev/null
+++ b/checks/mailman_lists
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 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-
+# 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.
+
+def inventory_mailman_lists(info):
+ return [ (i[0], None) for i in info ]
+
+def check_mailman_lists(item, params, info):
+ for line in info:
+ name, num_members = line[0], saveint(line[1])
+ if name == item:
+ return (0, 'OK - %d members subcribed' % (num_members), [('count', num_members)])
+ return (3, 'UNKNOWN - List could not be found in agent output')
+
+check_info["mailman_lists"] = {
+ "check_function" : check_mailman_lists,
+ "inventory_function" : inventory_mailman_lists,
+ "service_description" : "Mailinglist %s",
+ "has_perfdata" : True,
+}