aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2012-01-31 19:12:37 +0000
committerPetter Reinholdtsen <pere@hungry.com>2012-01-31 19:12:37 +0000
commit59cfdfe5e99d650eed446f3f562fc316424c26f3 (patch)
treea9e020506d1d40a0133496e7f0a27671d8bedb37
parent1691c9257c8d5f94d78d68f376205c200c5445ed (diff)
downloadsitesummary-59cfdfe5e99d650eed446f3f562fc316424c26f3.tar.gz
sitesummary-59cfdfe5e99d650eed446f3f562fc316424c26f3.tar.bz2
sitesummary-59cfdfe5e99d650eed446f3f562fc316424c26f3.tar.xz
Add support in nagios plugins check_etc_hosts and check_etc_resolv
for ignoring entires tagged '# NAGIOSIGNORE'.
-rw-r--r--debian/changelog4
-rwxr-xr-xnagios-plugins/check_etc_resolv4
2 files changed, 5 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index cbf2b02..7d9df45 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,7 @@
sitesummary (0.1.2) UNRELEASED; urgency=low
- * Add support in nagios plugin check_etc_hosts for ignoring entires
- tagged '# NAGIOSIGNORE'.
+ * Add support in nagios plugins check_etc_hosts and check_etc_resolv
+ for ignoring entires tagged '# NAGIOSIGNORE'.
* Drop Nagios check for user count, as the check do not check anything
useful, and the default nrpe setup do not allow us to raise the
warning levels.
diff --git a/nagios-plugins/check_etc_resolv b/nagios-plugins/check_etc_resolv
index 18ac87d..185cf39 100755
--- a/nagios-plugins/check_etc_resolv
+++ b/nagios-plugins/check_etc_resolv
@@ -3,7 +3,8 @@
# Author: Petter Reinholdtsen <pere@hungry.com>
# Date: 2001-11-09
#
-# Check /etc/resolv.conf, and make sure the name servers listed are working.
+# Check /etc/resolv.conf, and make sure the name servers listed are
+# working. It will ignore entries with '# NAGIOSIGNORE' at the end.
use Socket;
@@ -101,6 +102,7 @@ sub check_etc_resolv_conf {
chomp;
s/\#.+//; # Skip comments
next if (/^\s*$/); # Skip empty lines
+ next if (/# NAGIOSIGNORE$/); # Skip lines marked to be ignored
if (/^nameserver\s+(\S+)/) {
$count++;
local ($error) = test_dns_server($1);