Module: check_mk
Branch: master
Commit: e3a221fc51ef1e468e5ac17d10fa1bb98e8a9fd6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e3a221fc51ef1e…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Mon Oct 12 13:41:35 2015 +0200
werk 2658 cherry picked
---
.werks/2658 | 12 ++++++++++++
ChangeLog | 1 +
checks/logwatch | 16 +++++++++++++++-
3 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/.werks/2658 b/.werks/2658
new file mode 100644
index 0000000..024a335
--- /dev/null
+++ b/.werks/2658
@@ -0,0 +1,12 @@
+Title: logwatch: unacknowledged messages exceeding the max size are now dropped, even if they were already stored due to a previous bug
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1444649368
+
+A previous modification to the logwatch check caused the internal message buffer
+(var/check_mk/logwatch) to become bloated, causing high cpu load and memory usage.
+This change now auto-corrects those files for those affected.
diff --git a/ChangeLog b/ChangeLog
index f73bafc..6027ccf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -219,6 +219,7 @@
* 2675 FIX: checkpoint_connections checkpoint_packets: Fixed wrong discovered services on non checkpoint devices
* 2657 FIX: windows agent: fixed failure to resolve named performance counters...
* 2676 FIX: cisco_asa_failover: Failover state is not treated as warning state anymore...
+ * 2658 FIX: logwatch: unacknowledged messages exceeding the max size are now dropped, even if they were already stored due to a previous bug...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce unhandled exceptions...
diff --git a/checks/logwatch b/checks/logwatch
index 39ed09d..65c7d98 100644
--- a/checks/logwatch
+++ b/checks/logwatch
@@ -339,6 +339,16 @@ check_info['logwatch.groups'] = {
precompile_params['logwatch.groups'] = logwatch_group_precompile
#.
+
+# truncate a file near the specified offset while keeping lines intact
+def truncate_by_line(filename, offset):
+ f = open(filename, 'r+')
+ f.seek(offset)
+ f.readline() # ensures we don't cut inside a line
+ f.truncate()
+ f.close()
+
+
def check_logwatch_generic(item, params, loglines, found, groups=False):
# Create directories, if neccessary
try:
@@ -470,9 +480,13 @@ def check_logwatch_generic(item, params, loglines, found, groups=False):
logwatch_file.seek(0)
skip_reclassification = False
- if skip_reclassification and os.path.getsize(logfile) > logwatch_max_filesize:
+ logfile_size = os.path.getsize(logfile)
+ if skip_reclassification and logfile_size > logwatch_max_filesize:
# early out: without reclassification the file wont shrink and if it is already at
# the maximum size, all input is dropped anyway
+ if logfile_size > logwatch_max_filesize * 2:
+ # if the file is far too large, truncate it
+ truncate_by_line(logfile, logwatch_max_filesize)
return (2, "unacknowledged messages have exceeded max size, "
"new messages are dropped (limit %d Bytes)" % logwatch_max_filesize)
Module: check_mk
Branch: master
Commit: de78194e58a4464ecd9bfc523718605083574f7a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=de78194e58a446…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 12 13:32:54 2015 +0200
#2674 Added native support for monitoring via IPv6
Check_MK is now providing native support for monitoring IPv6 and even dual-stack hosts.
This has been implemented in a clean and straight forward way. For each host you can
choose which address family shal be used for communication with this host. By default
Check_MK is still using only IPv4, but now you can change it to IPv6 for monitoring
IPv6 only hosts. In WATO this is done by configuring the host attribute <i>IP Address Family</i>.
You can even configure one host to be monitored via IPv4 and IPv6 at the same time. In
this situation you need to decide which of the both address families is the primary one.
The primary address family is the one which is used for regular monitoring tasks
(communication with the agent or SNMP). The secondary address family is only being
pinged by default. For the secondary address family a dedicated PING service named
(PING v4 or PING v6) is added to the dual-stack hosts.
By default the primary address family is IPv4 for all dual-stack hosts. In WATO this
can be changed by configuring the rule set <i>Primary IP address family of dual-stack hosts</i>.
In some cases you want to perform active checks to check the avilability of a service,
e.g. HTTP, using both IPv4 and IPv6. For this case you can add two active checks to
the dual-stack host, one having IPv6 enabled and one without having it enabled for
using IPv4. But each active check needs to support IPv6 on its own. For the moment
the only check working vith IPv6 is <tt>check_http</tt>.
This is the default and recommended way for monitoring dual-stack hosts. You use one
address family for monitoring the whole system and the other one is just being pinged.
Note: If you use the Check_MK Enterprise Edition togehter with the Micro Core,
the Smart PING mechanism is not used for IPv6 hosts at the moment. This mechanism has
a slightly slower performance, but if you don't have too many IPv6 hosts, this should
be OK for the beginning.
The basic implementation for IPv6 monitoring has been done. But there are several
components in the Check_MK environment left which need to be extended to be fully
compatible with IPv6. Some of them are:
LI: Parent scanning (check_mk --scan-parents)
LI: WATO - Host-Diagnose
LI: WATO - Most active checks
LI: Event Console
LI: Notification Forwarding
LI: Livestatus Proxy
LI: Several active checks
LI: Most special agents
LI: The Check_MK Appliance
---
.f12 | 15 --
.werks/2621 | 9 +
.werks/2674 | 51 +++++
ChangeLog | 2 +
agents/cfg_examples/xinetd.conf | 2 +
agents/cfg_examples/xinetd_caching.conf | 2 +
check_mk_templates.cfg | 3 +
checks/check_http | 15 +-
modules/automation.py | 8 +-
modules/check_mk.py | 334 ++++++++++++++++++++++------
modules/check_mk_base.py | 5 +-
modules/config.py | 4 +-
modules/discovery.py | 14 +-
modules/inventory.py | 2 +-
modules/snmp.py | 3 +-
web/htdocs/wato.py | 247 ++++++++++++++------
web/plugins/views/builtin.py | 2 +-
web/plugins/views/painters.py | 72 +++++-
web/plugins/views/sorters.py | 2 +
web/plugins/visuals/filters.py | 116 +++++++++-
web/plugins/wato/active_checks.py | 14 ++
web/plugins/wato/builtin_attributes.py | 24 +-
web/plugins/wato/check_mk_configuration.py | 15 ++
23 files changed, 772 insertions(+), 189 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=de78194e58…
Module: check_mk
Branch: master
Commit: b8f2cea79ce59ad02e73666a7a2f3e9f4f72a177
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b8f2cea79ce59a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 12 09:43:09 2015 +0200
#2676 FIX cisco_asa_failover: Failover state is not treated as warning state anymore
The Cisco ASA cluster is operating as expected and in practice, it does not really
matter which of the cluster members is the primary one. So the failover state, where
the secondary device is the active one, is not treated as warning anymore.
---
.werks/2676 | 11 +++++++++++
ChangeLog | 1 +
checks/cisco_asa_failover | 4 ++--
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/2676 b/.werks/2676
new file mode 100644
index 0000000..ba82368
--- /dev/null
+++ b/.werks/2676
@@ -0,0 +1,11 @@
+Title: cisco_asa_failover: Failover state is not treated as warning state anymore
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1444635713
+Class: fix
+
+The Cisco ASA cluster is operating as expected and in practice, it does not really
+matter which of the cluster members is the primary one. So the failover state, where
+the secondary device is the active one, is not treated as warning anymore.
diff --git a/ChangeLog b/ChangeLog
index 8fee803..66e1a8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -216,6 +216,7 @@
* 2622 FIX: postfix_mailq: Fixed exception when postfix is installed but not configured properly
* 2675 FIX: checkpoint_connections checkpoint_packets: Fixed wrong discovered services on non checkpoint devices
* 2657 FIX: windows agent: fixed failure to resolve named performance counters...
+ * 2676 FIX: cisco_asa_failover: Failover state is not treated as warning state anymore...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce unhandled exceptions...
diff --git a/checks/cisco_asa_failover b/checks/cisco_asa_failover
index 8c16433..0f4e565 100644
--- a/checks/cisco_asa_failover
+++ b/checks/cisco_asa_failover
@@ -68,8 +68,8 @@ def check_cisco_asa_failover(_no_item, _no_params, info):
or (unit_type == "secondary" and device_state == 10):
state = 0
elif device_state in [ 9, 10 ] and other_device_state in [ 9, 10 ]:
- state = 1
- details = "The cluster is in failover state"
+ state = 0
+ details = "The cluster is in failover state (Secondary device is active)"
elif device_state == 4:
state = 2
details = "The device reports an error state"