Module: check_mk
Branch: master
Commit: e9bf12f727bdc617efaaf3075d24e6f8623c12a1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e9bf12f727bdc6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Feb 6 16:04:34 2014 +0100
FIX ntp, ntp.peers: avoid DNS lookups in NTP queries and avoid timeouts
The ntpq queries in the various Unix agents now call ntpq with the option
-n. This avoids DNS lookups. Note: the ntp.peers check will then display
IP addresses instead of host names. That check will fail if you do not
have fixed IP addresses.
---
.werks/708 | 11 +++++++++++
ChangeLog | 1 +
agents/check_mk_agent.aix | 2 +-
agents/check_mk_agent.freebsd | 2 +-
agents/check_mk_agent.hpux | 2 +-
agents/check_mk_agent.linux | 2 +-
agents/check_mk_agent.macosx | 2 +-
agents/check_mk_agent.solaris | 2 +-
8 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/.werks/708 b/.werks/708
new file mode 100644
index 0000000..fec1b47
--- /dev/null
+++ b/.werks/708
@@ -0,0 +1,11 @@
+Title: ntp, ntp.peers: avoid DNS lookups in NTP queries and avoid timeouts
+Level: 2
+Component: checks
+Version: 1.2.5i1
+Date: 1391698980
+Class: fix
+
+The ntpq queries in the various Unix agents now call ntpq with the option
+-n. This avoids DNS lookups. Note: the ntp.peers check will then display
+IP addresses instead of host names. That check will fail if you do not
+have fixed IP addresses.
diff --git a/ChangeLog b/ChangeLog
index 5a110a9..547cd20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -164,6 +164,7 @@
* 0579 FIX: veeam_client: fix for case when no StopTime section in agent output
* 0692 FIX: fileinfo: Avoid duplicate entries in Solaris agent...
* 0693 FIX: hpux_lvm: avoid problem when alternative vgdisplay is installed...
+ * 0708 FIX: ntp, ntp.peers: avoid DNS lookups in NTP queries and avoid timeouts...
Multisite:
* 0371 Added log class filter to hostsvcevents view
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index cc40d03..802f063 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -97,7 +97,7 @@ done
if which ntpq > /dev/null 2>&1 ; then
if [ $(lssrc -s xntpd|grep -c active) -gt 0 ] ; then
echo '<<<ntp>>>'
- ntpq -p | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
+ ntpq -np | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
fi
fi
diff --git a/agents/check_mk_agent.freebsd b/agents/check_mk_agent.freebsd
index b1627a0..f3398bb 100755
--- a/agents/check_mk_agent.freebsd
+++ b/agents/check_mk_agent.freebsd
@@ -229,7 +229,7 @@ fi
if which ntpq > /dev/null 2>&1 ; then
echo '<<<ntp>>>'
# remote heading, make first column space separated
- ntpq -p | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
+ ntpq -np | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
fi
diff --git a/agents/check_mk_agent.hpux b/agents/check_mk_agent.hpux
index 9f49eaa..f303c7c 100755
--- a/agents/check_mk_agent.hpux
+++ b/agents/check_mk_agent.hpux
@@ -107,7 +107,7 @@ fi
echo '<<<ntp>>>'
# remove heading, make first column space separated
-ntpq -p | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
+ntpq -np | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
# Kernel tunnables
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 241d01a..cf22b2e 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -346,7 +346,7 @@ fi
if type ntpq > /dev/null 2>&1 ; then
# remove heading, make first column space separated
- run_cached -s ntp 30 "waitmax 5 ntpq -p | sed -e 1,2d -e 's/^\(.\)/\1 /'
-e 's/^ /%/'"
+ run_cached -s ntp 30 "waitmax 5 ntpq -np | sed -e 1,2d -e 's/^\(.\)/\1 /'
-e 's/^ /%/'"
fi
if type nvidia-settings >/dev/null && [ -S /tmp/.X11-unix/X0 ]
diff --git a/agents/check_mk_agent.macosx b/agents/check_mk_agent.macosx
index 9209244..070c659 100755
--- a/agents/check_mk_agent.macosx
+++ b/agents/check_mk_agent.macosx
@@ -74,7 +74,7 @@ ps ax -o user,vsz,rss,pcpu,command | sed -e 1d -e 's/ *\([^ ]*\)
*\([^ ]*\) *\([
# NTP seems to be enabled as a default
echo '<<<ntp>>>'
- ntpq -pn | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
+ ntpq -npn | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
# TCP Conn stats
echo '<<<tcp_conn_stats>>>'
diff --git a/agents/check_mk_agent.solaris b/agents/check_mk_agent.solaris
index ef03a60..5ef0e78 100644
--- a/agents/check_mk_agent.solaris
+++ b/agents/check_mk_agent.solaris
@@ -195,7 +195,7 @@ ps -o comm $pszone | grep -w xntpd &>/dev/null
if [ $? -eq 0 ]
then
echo '<<<ntp>>>'
- ntpq -p | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
+ ntpq -np | sed -e 1,2d -e 's/^\(.\)/\1 /' -e 's/^ /%/'
fi