Module: check_mk
Branch: master
Commit: af9456e0d66c53ffc5e1fcbbc099b9cacf4161d5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=af9456e0d66c53…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 20 12:39:52 2012 +0100
Fixed typo
---
.bugs/648 | 7 +++++--
web/htdocs/wato.py | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/.bugs/648 b/.bugs/648
index e8de827..a5ed7c8 100644
--- a/.bugs/648
+++ b/.bugs/648
@@ -1,9 +1,9 @@
Title: WATO API in multisite.mk einbinden
Component: multisite
-State: open
+Class: nastiness
+State: wontfix
Date: 2012-02-08 10:34:20
Targetversion: future
-Class: nastiness
Momentan muss man ziemliche Verrenkungen machen um aus der multisite.mk auf die
WATO API zugreifen zu können.
@@ -22,3 +22,6 @@ import wato
wato.load_plugins()
ausreichen.
+
+2012-02-20 12:34:58: changed state open -> wontfix
+this is kind of a hack. wont implement that.
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 1080098..aea6e16 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -6849,7 +6849,7 @@ def mode_edit_user(phase):
# Roles
html.write("<tr><td class=legend colspan=2>")
html.write(_("Roles<br><i>By assigning roles to a user he obtains permissions. "
- "If a user has more then one role, he gets the maximum of all "
+ "If a user has more than one role, he gets the maximum of all "
"permissions of his roles. "
"Users without any role have no permissions to use Multisite at all "
"but still can be monitoring contacts and receive notifications.</i>"))
Module: check_mk
Branch: master
Commit: 17d19fff6002e7d5274b57e316b172a7bb295197
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=17d19fff6002e7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 20 14:10:40 2012 +0100
FIX: Multisite authed users without permission to multisite are
automatically logged out after showing the error messag
---
ChangeLog | 2 ++
web/htdocs/index.py | 5 +++++
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 25e3b1a..7c114de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -51,6 +51,8 @@
* FIX: Fixed wrong redirection after login in some cases
* FIX: Fixed missing stats grouping in alert statistics view
* FIX: Fixed preview table styling in view editor
+ * FIX: Multisite authed users without permission to multisite are
+ automatically logged out after showing the error message
BI:
* New column (painter) for simplistic box display of tree.
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index 25916e5..4c13de4 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -284,6 +284,11 @@ def handler(req, profiling = True):
reason += _("<b>You do not have any roles.</b> ")
reason += _("If you think this is an error, "
"please ask your administrator to check the permissions configuration.")
+
+ if config.auth_type == 'cookie':
+ reason += _('<p>You have been logged out. Please reload the page to re-authenticate.</p>')
+ login.del_auth_cookie()
+
raise MKAuthException(reason)
# General access allowed. Now connect to livestatus
Module: check_mk
Branch: master
Commit: 8ef0d2849f2a6e2ef649c473039da5ed2712ab7c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8ef0d2849f2a6e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Feb 20 13:45:04 2012 +0100
fix check includes, add node_info to check API
---
ChangeLog | 2 +
modules/check_mk.py | 8 ++++--
modules/check_mk_base.py | 48 +++++++++++++++++++++++++++++++++++++++------
3 files changed, 48 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 308cc2c..2f0d46a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
* FIX: fix handling of prefix-tag rules (+), needed for WATO
* FIX: handle buggy SNMP devices with non-consecutive OIDS
(such as BINTEC routers)
+ * Check API allows a check to get node information
+ * FIX: fix problem with check includes in subchecks
WATO:
* More checks are configurable via WATO now
diff --git a/modules/check_mk.py b/modules/check_mk.py
index e283474..73a27e9 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2067,7 +2067,8 @@ def make_inventory(checkname, hostnamelist, check_only=False, include_state=Fals
try:
inventory = inventory_function(checkname, info) # inventory is a list of pairs (item, current_value)
except Exception, ee:
- raise e # raise original exception
+ # Let the first exception happen again
+ inventory_function(info)
if inventory == None: # tolerate if function does no explicit return
inventory = []
@@ -2422,8 +2423,9 @@ no_inventory_possible = None
# check table
filenames = []
for check_type in needed_check_types:
+ basename = check_type.split(".")[0]
# Add library files needed by check (also look in local)
- for lib in check_info[check_type].get("includes", []):
+ for lib in set(check_includes.get(basename, [])):
if local_checks_dir and os.path.exists(local_checks_dir + "/" + lib):
to_add = local_checks_dir + "/" + lib
else:
@@ -4505,7 +4507,7 @@ if __name__ == "__main__":
missing.append(node)
if len(missing) == 0:
if opt_verbose:
- sys.stdout.write("All nodes of %s specified, dropping checks of %s, too.\n" % (clust, clust))
+ sys.stdout.write("All nodes of %s specified, dropping checks of %s, too.\n" % (clust, node))
remove_autochecks_of(clust, checknames)
else:
sys.stdout.write("Warning: %s is part of cluster %s, but you didn't specify %s as well.\nChecks on %s will be kept.\n" %
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index ddd71a0..5856bb0 100755
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -249,8 +249,15 @@ def submit_check_mk_aggregation(hostname, status, output):
# and thus do no network activity at all...
def get_host_info(hostname, ipaddress, checkname):
- nodes = nodes_of(hostname)
+ # If the check want's the node info, we add an additional
+ # column (as the first column) with the name of the node
+ # or None (in case of non-clustered nodes). On problem arises,
+ # if we deal with subchecks. We assume that all subchecks
+ # have the same setting here. If not, let's raise an exception.
+ add_nodeinfo = check_info.get(checkname, {}).get("node_info", False)
+
+ nodes = nodes_of(hostname)
if nodes != None:
info = []
at_least_one_without_exception = False
@@ -263,7 +270,10 @@ def get_host_info(hostname, ipaddress, checkname):
# try the other node.
try:
ipaddress = lookup_ipaddress(node)
- info += get_realhost_info(node, ipaddress, checkname, cluster_max_cachefile_age)
+ new_info = get_realhost_info(node, ipaddress, checkname, cluster_max_cachefile_age)
+ if add_nodeinfo:
+ new_info = [ [node] + line for line in new_info ]
+ info += new_info
at_least_one_without_exception = True
except MKAgentError, e:
if str(e) != "": # only first error contains text
@@ -281,7 +291,11 @@ def get_host_info(hostname, ipaddress, checkname):
raise MKAgentError(", ".join(exception_texts))
return info
else:
- return get_realhost_info(hostname, ipaddress, checkname, check_max_cachefile_age)
+ info = get_realhost_info(hostname, ipaddress, checkname, check_max_cachefile_age)
+ if add_nodeinfo:
+ return [ [ None ] + line for line in info ]
+ else:
+ return info
# Gets info from a real host (not a cluster). There are three possible
# ways: TCP, SNMP and external command. This function raises
@@ -731,11 +745,13 @@ def check_unimplemented(checkname, params, info):
def convert_check_info():
for check_type, info in check_info.items():
+ basename = check_type.split(".")[0]
+
if type(info) != dict:
+ # Convert check declaration from old style to new API
check_function, service_description, has_perfdata, inventory_function = info
if inventory_function == no_inventory_possible:
inventory_function = None
- basename = check_type.split(".")[0]
check_info[check_type] = {
"check_function" : check_function,
@@ -750,17 +766,35 @@ def convert_check_info():
"snmp_scan_function" :
snmp_scan_functions.get(check_type,
snmp_scan_functions.get(basename)),
- "includes" : check_includes.get(check_type, []),
"default_levels_variable" : check_default_levels.get(check_type),
+ "node_info" : False,
}
else:
- # Make sure that all keys are present
+ # Check does already use new API. Make sure that all keys are present,
+ # extra check-specific information into file-specific variables.
info.setdefault("inventory_function", None)
info.setdefault("group", None)
info.setdefault("snmp_info", None)
info.setdefault("snmp_scan_function", None)
- info.setdefault("includes", [])
info.setdefault("default_levels_variable", None)
+ info.setdefault("node_info", False)
+
+ # Include files are related to the check file (= the basename),
+ # not to the (sub-)check. So we keep them in check_includes.
+ check_includes.setdefault(basename, [])
+ check_includes[basename] += info.get("includes", [])
+
+ # Make sure that setting for node_info of check and subcheck matches
+ for check_type, info in check_info.iteritems():
+ if "." in check_type:
+ base_check = check_type.split(".")[0]
+ if base_check not in check_info:
+ if info["node_info"]:
+ raise MKGeneralException("Invalid check implementation: node_info for %s is True, but base check %s not defined" %
+ (check_type, base_check))
+ elif check_info[base_check]["node_info"] != info["node_info"]:
+ raise MKGeneralException("Invalid check implementation: node_info for %s and %s are different." % (
+ (base_check, check_type)))
# Now gather snmp_info and snmp_scan_function back to the
# original arrays. Note: these information is tied to a "agent section",
Module: check_mk
Branch: master
Commit: 66cdb2d05075e3e7494ec581062bc0aa4becd719
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=66cdb2d05075e3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 20 12:23:16 2012 +0100
Updated bug entries #0656
---
.bugs/656 | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/.bugs/656 b/.bugs/656
new file mode 100644
index 0000000..5c1dbcb
--- /dev/null
+++ b/.bugs/656
@@ -0,0 +1,27 @@
+Title: Commands help texts
+Component: multisite
+State: open
+Date: 2012-02-20 11:13:34
+Targetversion: future
+Class: feature
+
+Create help texts for commands in the views. Add them as context helps
+
+Custom notification:
+
+ Sends a test notification with the given text for all selected items.
+ This can be used to notify admins about an issue regarding the selected
+ hosts or services.
+ Selecting the forced option the notifications will be sent out ignoring
+ time restrictions.
+ Using the broadcast option you can send out notifications to all contacts
+ (escalated and non-escalated).
+
+Acknowledge:
+
+ When a service problem is acknowledged, future notifications about problems
+ are temporarily disabled until the service changes from its current state.
+ If you want acknowledgement to disable notifications until the service recovers,
+ check the 'Sticky Acknowledgement' checkbox.
+
+In general: Take a look at the nagios cgis there are useful texts for the commands.
Module: check_mk
Branch: master
Commit: 422473596f3ddd8b1f256def9da8fca413258714
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=422473596f3ddd…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Feb 20 10:59:06 2012 +0100
WATO: FIX: honor site disabling in replication module
---
ChangeLog | 1 +
web/htdocs/wato.py | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 74edc23..480b481 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,7 @@
* FIX: Do not use None$ as item when creating new rules
* FIX: Do load *all* users from htpasswd, so passwords from
users not created via WATO will not be lost.
+ * FIX: honor site disabling in replication module
Checks & Agents:
* hpux_if: fix missing default parameter errors
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index c922a97..c302414 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5821,10 +5821,10 @@ def mode_edit_site(phase):
"that URL will be fetched by the Apache server of the local "
"site itself, whilst the URL-Prefix is used by your local Browser.")))
html.text_input("multisiteurl", site.get("multisiteurl", ""), size=60)
- html.checkbox("insecure", site.get("insecure", False))
- html.write(_('Ignore SSL certificate errors<br>'
- '<i>This might be needed to make the synchronization accept problems with '
- 'SSL certificates when using an SSL secured connection.</i>'))
+ html.write("<br><br>")
+ html.checkbox("insecure", site.get("insecure", False), label = _('Ignore SSL certificate errors'))
+ html.write('<br><i>This might be needed to make the synchronization accept problems with '
+ 'SSL certificates when using an SSL secured connection.</i>')
html.write("</td></tr>")
html.write("<tr><td colspan=2 class=buttons>")
html.button("save", _("Save"))
@@ -5982,7 +5982,7 @@ def is_distributed(sites = None):
if sites == None:
sites = config.sites
for site in sites.values():
- if site.get("replication"):
+ if site.get("replication") and not site.get("disabled"):
return True
return False
Module: check_mk
Branch: master
Commit: 856d5d6722a9ae43e7f090a58abd070de455381d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=856d5d6722a9ae…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 20 10:37:37 2012 +0100
Extended ping_level number of packets description
---
web/plugins/wato/check_parameters.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 11a4aa4..134f4cf 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -61,7 +61,9 @@ register_rule(group,
( "packets",
Integer(
title = _("Number of packets"),
- help = _("Number ICMP echo request packets to send to the target host"),
+ help = _("Number ICMP echo request packets to send to the target host on each "
+ "check execution. All packets are sent directly on check execution. Afterwards "
+ "the check waits for the incoming packets."),
minvalue = 1,
maxvalue = 20,
)),