aboutsummaryrefslogtreecommitdiffstats
path: root/nagios-plugins/check_etc_hosts
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2012-01-31 18:56:39 +0000
committerPetter Reinholdtsen <pere@hungry.com>2012-01-31 18:56:39 +0000
commit5471251a4825782e023a3cbba4762ca652b7cb17 (patch)
treef3f9f59d2a7283ba675c81d8b060d4b50384fe65 /nagios-plugins/check_etc_hosts
parentc29db339548e574516b9c037e0c4788c5d92fe56 (diff)
downloadsitesummary-5471251a4825782e023a3cbba4762ca652b7cb17.tar.gz
sitesummary-5471251a4825782e023a3cbba4762ca652b7cb17.tar.bz2
sitesummary-5471251a4825782e023a3cbba4762ca652b7cb17.tar.xz
Add support in nagios plugin check_etc_hosts for ignoring entires tagged '# NAGIOSIGNORE'.
Diffstat (limited to 'nagios-plugins/check_etc_hosts')
-rwxr-xr-xnagios-plugins/check_etc_hosts4
1 files changed, 3 insertions, 1 deletions
diff --git a/nagios-plugins/check_etc_hosts b/nagios-plugins/check_etc_hosts
index b7f7268..48cb356 100755
--- a/nagios-plugins/check_etc_hosts
+++ b/nagios-plugins/check_etc_hosts
@@ -5,7 +5,8 @@
#
# Check /etc/hosts, and make sure the content matches the information
# in DNS. Lookup IP, and check if the names listed in /etc/hosts
-# maches the one in DNS.
+# maches the one in DNS. It will ignore entries with '# NAGIOSIGNORE'
+# at the end.
use vars qw($use_perl_resolver $debug $returnvalue $nagiosmsg);
@@ -222,6 +223,7 @@ sub check_etc_hosts {
chomp;
s/\#.+//; # Skip comments
next if (/^\s*$/); # Skip empty lines
+ next if (/# NAGIOSIGNORE$/); # Skip lines marked to be ignored
print "Testing $_\n" if $debug;