aboutsummaryrefslogtreecommitdiffstats
path: root/nagios-plugins/check_etc_resolv
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 /nagios-plugins/check_etc_resolv
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'.
Diffstat (limited to 'nagios-plugins/check_etc_resolv')
-rwxr-xr-xnagios-plugins/check_etc_resolv4
1 files changed, 3 insertions, 1 deletions
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);