Module: check_mk
Branch: master
Commit: 54ace4c21f15be87a5cd5b80f06bfc60b3000bf5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=54ace4c21f15be…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Mar 20 10:54:09 2015 +0100
#2062 grouped interfaces: additional information in check output and new port state 'degraded'
Grouped interfaces now clearly show that they are grouped together by listing all
group members and their state in the check output.
Additionally the new port state <i>degraded</i> has been introduced.
A grouped interface is set to this port state if not all of its members are <i>up</i>.
If all members of a group are <i>down</i>, the grouped interface is also considered <i>down</i>, as usual.
C+:
CRIT - Group Status (degraded)(!!), Members: [QLogic 1 10GbE Adapter 2 (down), QLogic 1 10GbE Adapter (up)] 10.00 Gbit/s (wrong speed, expected: 20.00 Gbit/s)(!), in: 0.00 B/s, out: 0.00 B/s
C-:
---
.werks/2062 | 19 +++++++
ChangeLog | 2 +
checks/if.include | 80 ++++++++++++++++++----------
web/plugins/wato/check_mk_configuration.py | 1 +
web/plugins/wato/check_parameters.py | 1 +
5 files changed, 75 insertions(+), 28 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=54ace4c21f…
Module: check_mk
Branch: master
Commit: 2fe4bbbce8cf1e26a2e43f9e187663d4abcc5ba5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2fe4bbbce8cf1e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 20 09:51:36 2015 +0100
#2152 FIX apache_status: Fixed plugin to work on CentOS/RedHat 5.x
The agent plugin was not compatible with Python 2.4. This has been fixed now.
---
.werks/2152 | 10 ++++++++++
ChangeLog | 3 ++-
agents/plugins/apache_status | 12 ++++++++----
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/.werks/2152 b/.werks/2152
new file mode 100644
index 0000000..a9899bd
--- /dev/null
+++ b/.werks/2152
@@ -0,0 +1,10 @@
+Title: apache_status: Fixed plugin to work on CentOS/RedHat 5.x
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1426841453
+
+The agent plugin was not compatible with Python 2.4. This has been fixed now.
diff --git a/ChangeLog b/ChangeLog
index 954860a..0b30266 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -131,8 +131,8 @@
* 1231 mssql_counters.file_sizes: It's now possible to set levels for Filesizes
* 2104 aix_if: new agent section and check...
NOTE: Please refer to the migration notes!
+ * 2061 DB2 monitoring: Additional checks for AIX (and presumably linux)...
* 2105 mbg_lantime_ng_refclock: new check for Meinberg LANTIME clocks supporting the new MBG-LANTIME-NG MIB
- * 2061 DB2 monitoring: Additional checks for aix (and presumably linux)...
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
@@ -268,6 +268,7 @@
* 2059 FIX: ucs_bladecenter_if: fixed exception when fibrechannel interfaces were not configured...
* 1233 FIX: Fixed fileinfo check for solaris in case of missing files
* 1236 FIX: multipath: Now show correct error in case of removed multipaths instead of check crash
+ * 2152 FIX: apache_status: Fixed plugin to work on CentOS/RedHat 5.x...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/agents/plugins/apache_status b/agents/plugins/apache_status
index de7b187..f06b05d 100755
--- a/agents/plugins/apache_status
+++ b/agents/plugins/apache_status
@@ -41,15 +41,19 @@
# It is also possible to override or extend the ssl_ports variable to make the
# check contact other ports than 443 with HTTPS requests.
-import os, sys, urllib2, re
+import os, sys, urllib2, re, socket
config_dir = os.getenv("MK_CONFDIR", "/etc/check_mk")
config_file = config_dir + "/apache_status.conf"
-timeout = 5
if not os.path.exists(config_file):
config_file = config_dir + "/apache_status.cfg"
+# We have to deal with socket timeouts. Python > 2.6
+# supports timeout parameter for the urllib2.urlopen method
+# but we are on a python 2.5 system here which seem to use the
+# default socket timeout. We are local here so set it to 1 second.
+socket.setdefaulttimeout(5.0)
# None or list of (proto, ipaddress, port) tuples.
# proto is 'http' or 'https'
@@ -129,13 +133,13 @@ for server in servers:
# Try to fetch the status page for each server
try:
request = urllib2.Request(url, headers={"Accept" : "text/plain"})
- fd = urllib2.urlopen(request, timeout=timeout)
+ fd = urllib2.urlopen(request)
except urllib2.URLError, e:
if 'SSL23_GET_SERVER_HELLO:unknown protocol' in str(e):
# HACK: workaround misconfigurations where port 443 is used for
# serving non ssl secured http
url = 'http://%s:%s/server-status?auto' % (address, port)
- fd = urllib2.urlopen(url, timeout=timeout)
+ fd = urllib2.urlopen(url)
else:
raise
Resulted in ruleset mixup during core reload
Message-ID: <550bdc5b.9xm6rVxN89kCqWbt%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 8daa56a64c45b2e6e2b0afd89f08a39f9398d427
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8daa56a64c45b2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 20 09:37:37 2015 +0100
Fixed reseting of global caches; Resulted in ruleset mixup during core reload
---
modules/check_mk.py | 27 ++++++++++++++++++---------
modules/check_mk_base.py | 20 +++++++++++---------
2 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 37b434c..31103fc 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -453,11 +453,14 @@ def collect_hosttags():
parts = taggedhost.split("|")
hosttags[parts[0]] = parts[1:]
+
+g_hosttag_taglist_cache = {}
+g_global_caches.append('g_hosttag_taglist_cache')
+
# Check if a host fullfills the requirements of a tags
# list. The host must have all tags in the list, except
# for those negated with '!'. Those the host must *not* have!
# New in 1.1.13: a trailing + means a prefix match
-g_hosttag_taglist_cache = {}
def hosttags_match_taglist(hosttags, required_tags):
try:
cache_id = tuple(hosttags)+tuple(required_tags)
@@ -875,7 +878,6 @@ def host_of_clustered_service(hostname, servicedesc):
# | Code for computing the table of checks of a host. |
# '----------------------------------------------------------------------'
-
# Returns check table for a specific host
# Format: (checkname, item) -> (params, description)
@@ -1087,6 +1089,8 @@ def get_datasource_program(hostname, ipaddress):
# Variables needed during the renaming of hosts (see automation.py)
ignore_ip_lookup_failures = False
failed_ip_lookups = []
+g_dns_cache = {}
+g_global_caches.append('g_dns_cache')
# Determine the IP address of a host
def lookup_ipaddress(hostname):
@@ -1145,6 +1149,7 @@ def lookup_ipaddress(hostname):
g_dns_cache[hostname] = None
raise
+g_global_caches.append('g_ip_lookup_cache')
def init_ip_lookup_cache():
global g_ip_lookup_cache
if g_ip_lookup_cache is None:
@@ -1568,6 +1573,8 @@ def service_deps(hostname, servicedesc):
g_converted_host_rulesets_cache = {}
+g_global_caches.append('g_converted_host_rulesets_cache')
+
def convert_host_ruleset(ruleset):
new_rules = []
if len(ruleset) == 1 and ruleset[0] == "":
@@ -1721,8 +1728,9 @@ def convert_pattern(pattern):
def convert_pattern_list(patterns):
return tuple([ convert_pattern(p) for p in patterns ])
-
g_hostlist_match_cache = {}
+g_global_caches.append('g_hostlist_match_cache')
+
def all_matching_hosts(tags, hostlist):
cache_id = tuple(tags), tuple(hostlist)
try:
@@ -1743,6 +1751,8 @@ def all_matching_hosts(tags, hostlist):
g_converted_service_rulesets_cache = {}
+g_global_caches.append('g_converted_service_rulesets_cache')
+
def convert_service_ruleset(ruleset):
new_rules = []
for rule in ruleset:
@@ -1771,8 +1781,10 @@ def convert_service_ruleset(ruleset):
return new_rules
-# Compute outcome of a service rule set that has an item
g_extraconf_servicelist_cache = {}
+g_global_caches.append('g_extraconf_servicelist_cache')
+
+# Compute outcome of a service rule set that has an item
def service_extra_conf(hostname, service, ruleset):
try:
ruleset = g_converted_service_rulesets_cache[id(ruleset)]
@@ -5075,13 +5087,10 @@ def copy_globals():
for varname, value in globals().items():
# Some global caches are allowed to change.
if varname not in [ "g_service_description", "g_multihost_checks",
- "g_check_table_cache", "g_singlehost_checks",
+ "g_singlehost_checks",
"g_nodesof_cache", "g_compiled_regexes", "vars_before_config",
"g_initial_times", "g_keepalive_initial_memusage",
- "g_dns_cache", "g_ip_lookup_cache",
- "g_converted_host_rulesets_cache", "g_converted_service_rulesets_cache",
- "g_extraconf_servicelist_cache", "g_hostlist_match_cache",
- "g_hosttag_taglist_cache" ] \
+ "g_global_caches" ] + g_global_caches \
and type(value).__name__ not in [ "function", "module", "SRE_Pattern" ]:
global_saved[varname] = copy.copy(value)
return global_saved
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 6db4bb2..4b0c130 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -79,22 +79,15 @@ except NameError:
# are need to be reset in keepalive mode after a configuration change has
# been signalled.
def reset_global_caches():
- global g_check_table_cache
- g_check_table_cache = {} # per-host-checktables
global g_singlehost_checks
g_singlehost_checks = None # entries in checks used by just one host
global g_multihost_checks
g_multihost_checks = None # entries in checks used by more than one host
- global g_nodesof_cache
- g_nodesof_cache = {} # Nodes of cluster hosts
- global g_dns_cache
- g_dns_cache = {}
global g_ip_lookup_cache
g_ip_lookup_cache = None # permanently cached ipaddresses from ipaddresses.cache
- global g_converted_rulesets_cache
- g_converted_rulesets_cache = {}
-reset_global_caches()
+ for cachevar_name in g_global_caches:
+ globals()[cachevar_name] = {}
# Prepare colored output if stdout is a TTY. No colors in pipe, etc.
if sys.stdout.isatty():
@@ -176,7 +169,16 @@ g_broken_snmp_hosts = set([])
g_broken_agent_hosts = set([])
g_timeout = None
g_compiled_regexes = {}
+g_global_caches = []
+
+# global variables used to cache temporary values that need to
+# be reset after a configuration change.
+g_check_table_cache = {} # per-host-checktables
+g_global_caches.append('g_check_table_cache')
+g_nodesof_cache = {} # Nodes of cluster hosts
+g_global_caches.append('g_nodesof_cache')
+reset_global_caches()
# variables set later by getopt. These are defined here since in precompiled
# mode the module check_mk.py is not present and we need all options to be
Module: check_mk
Branch: master
Commit: a9ecd140b8b937c562b1d58ff53ac2fc85222e2c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a9ecd140b8b937…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Mar 20 08:41:37 2015 +0100
fixed werk syntax
---
.werks/2061 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.werks/2061 b/.werks/2061
index 415c48b..07f6f46 100644
--- a/.werks/2061
+++ b/.werks/2061
@@ -20,7 +20,7 @@ The plugin output is processed by the following new checks
<tr><td>db2_bp_hitratios</td><td>Bufferpool Hitratios</td><td></td></tr>
<tr><td>db2_connections</td><td>Number of database connections</td><td>X</td></tr>
<tr><td>db2_counters</td><td>Deadlocks and Lockwaits per Second</td><td>X</td></tr>
-<tr><td>db2_logsize</td><td>Size and growth of database logfile</td>X<td></td></tr>
+<tr><td>db2_logsize</td><td>Size and growth of database logfile</td><td>X</td></tr>
<tr><td>db2_tablespaces</td><td>Size and growth of tablespaces</td><td>X</td></tr>
<tr><td>db2_sort_overflow</td><td>Percentual sort overflow</td><td>X</td></tr>
<tr><td>db2_version</td><td>Displays DB2 version</td><td></td></tr>