aboutsummaryrefslogtreecommitdiffstats
path: root/nagios-plugins/check_etc_hosts
diff options
context:
space:
mode:
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;