Module: check_mk
Branch: master
Commit: 0da523e0dd549680e22fbe52e895f9a1d6eb6912
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0da523e0dd5496…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Thu Apr 2 12:04:32 2015 +0200
winperf_if FIX: in some cases IFs on (at least) HP-servers disappeared for no apparent reason
---
checks/winperf_if | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/checks/winperf_if b/checks/winperf_if
index 20af278..2ee7edc 100644
--- a/checks/winperf_if
+++ b/checks/winperf_if
@@ -137,6 +137,14 @@ def convert_winperf_if(info):
found_match = False
+ # we need to ignore data on interfaces in the optional
+ # wmic section which are marked as non-existing, since
+ # it may happen that there are non-existing interfaces
+ # with the same nic_name as an active one (at least on HP
+ # hardware)
+ if as_dict["NetConnectionStatus"] == "4":
+ continue
+
# Exact match
if nic_name in nic_names:
found_match = True
Module: check_mk
Branch: master
Commit: dff254ba429aaf596a0dd968e5651ef1c1b158b6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dff254ba429aaf…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Apr 2 10:43:57 2015 +0200
#2187 FIX Avoid CLOSE_WAIT sockets for agent connection in case of timeouts
In case of agent timeouts (per default this is set to 60 seconds) when using
keep alive mode (as the CMC does) socket connections could be left over
in <tt>CLOSE_WAIT</tt> state. This is due to a file descriptor not being
closed correctly by Python. This has been fixed.
---
.werks/2187 | 13 +++++++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 22 ++++++++++++++++------
3 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/.werks/2187 b/.werks/2187
new file mode 100644
index 0000000..4f24a4a
--- /dev/null
+++ b/.werks/2187
@@ -0,0 +1,13 @@
+Title: Avoid CLOSE_WAIT sockets for agent connection in case of timeouts
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1427964139
+
+In case of agent timeouts (per default this is set to 60 seconds) when using
+keep alive mode (as the CMC does) socket connections could be left over
+in <tt>CLOSE_WAIT</tt> state. This is due to a file descriptor not being
+closed correctly by Python. This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index d56ee58..6f11239 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@
* 2016 FIX: Fixed service discovery / monitoring on hosts which have only piggyback data (e.g. ESX VMs)...
* 2089 FIX: Debug mode shows details about errors in autochecks as expected now
* 2093 FIX: Fixed handling of check_mk commandline parameter "-c"
+ * 2187 FIX: Avoid CLOSE_WAIT sockets for agent connection in case of timeouts...
Checks & Agents:
* 1665 agent_netapp: New special agent for NetApp monitoring via Web-API...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 94d52c1..90100a2 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -764,17 +764,27 @@ def get_agent_info_tcp(hostname, ipaddress, port = None):
pass # some old Python versions lack settimeout(). Better ignore than fail
vverbose("Connecting via TCP to %s:%d.\n" % (ipaddress, port))
s.connect((ipaddress, port))
+ # Immediately close sending direction. We do not send any data
+ # s.shutdown(socket.SHUT_WR)
try:
s.setblocking(1)
except:
pass
output = ""
- while True:
- out = s.recv(4096, socket.MSG_WAITALL)
- if out and len(out) > 0:
- output += out
- else:
- break
+ try:
+ while True:
+ out = s.recv(4096, socket.MSG_WAITALL)
+ if out and len(out) > 0:
+ output += out
+ else:
+ break
+ except Exception, e:
+ # Python seems to skip closing the socket under certain
+ # conditions, leaving open filedescriptors and sockets in
+ # CLOSE_WAIT. This happens one a timeout (ALERT signal)
+ s.close()
+ raise
+
s.close()
if len(output) == 0: # may be caused by xinetd not allowing our address
raise MKAgentError("Empty output from agent at TCP port %d" % port)
Module: check_mk
Branch: master
Commit: 0d8626ef59fb49988d4ce2976c71942d85267917
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0d8626ef59fb49…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 1 14:18:56 2015 +0200
#2186 check_mk_agent.aix: use GNU df in order to exclude NFS for filesystem monitoring
If the <tt>df</tt> command from the GNU <tt>coreutils</tt> is present at
<tt>/usr/opt/freeware/bin/df</tt> then that is being used instead of the
AIX <tt>df</tt> command. This avoids a hanging agent in case of hanging
NFS mounts.
---
.werks/2186 | 12 ++++++++++++
ChangeLog | 1 +
agents/check_mk_agent.aix | 7 ++++++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/2186 b/.werks/2186
new file mode 100644
index 0000000..a7cf334
--- /dev/null
+++ b/.werks/2186
@@ -0,0 +1,12 @@
+Title: check_mk_agent.aix: use GNU df in order to exclude NFS for filesystem monitoring
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1427890642
+Class: feature
+
+If the <tt>df</tt> command from the GNU <tt>coreutils</tt> is present at
+<tt>/usr/opt/freeware/bin/df</tt> then that is being used instead of the
+AIX <tt>df</tt> command. This avoids a hanging agent in case of hanging
+NFS mounts.
diff --git a/ChangeLog b/ChangeLog
index 537c6a7..d56ee58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -153,6 +153,7 @@
* 2184 statgrab_mem: converted to the same logic as the other memory checks...
NOTE: Please refer to the migration notes!
* 2185 canon_pages: added support for b/w A4 and color A4/A3 counters
+ * 2186 check_mk_agent.aix: use GNU df in order to exclude NFS for filesystem monitoring...
* 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...
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index 8744752..0edfa08 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -116,7 +116,12 @@ echo Version: 1.2.7i1
echo AgentOS: aix
echo '<<<df>>>'
-df -kP | sed 's/ / - /' | grep -v ^/proc | grep -v ^Filesystem | grep -v :
+if [ -x /usr/opt/freeware/bin/df ] ; then
+ excludefs="-x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs"
+ /usr/opt/freeware/bin/df -PTlk $excludefs | sed 1d
+else
+ df -kP | sed 's/ / - /' | grep -v ^/proc | grep -v ^Filesystem | grep -v :
+fi
# Check for hanging NFS mounts. This needs a GNU stat installed in the PATH
if type stat >/dev/null 2>&1 ; then
Module: check_mk
Branch: master
Commit: f5f73b5db3397c55a78711f855bf77b0e955358d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f5f73b5db3397c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 1 10:06:26 2015 +0200
Fix: info now None if sections missing and extra_sections are defined
---
modules/check_mk_base.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 7ac6737..94d52c1 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -289,7 +289,7 @@ def apply_parse_function(info, section_name):
def get_info_for_check(hostname, ipaddress, section_name, max_cachefile_age=None, ignore_check_interval=False):
info = apply_parse_function(get_host_info(hostname, ipaddress, section_name, max_cachefile_age, ignore_check_interval), section_name)
- if section_name in check_info and check_info[section_name]["extra_sections"]:
+ if info != None and section_name in check_info and check_info[section_name]["extra_sections"]:
info = [ info ]
for es in check_info[section_name]["extra_sections"]:
try: