diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2012-01-31 18:56:39 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2012-01-31 18:56:39 +0000 |
commit | 5471251a4825782e023a3cbba4762ca652b7cb17 (patch) | |
tree | f3f9f59d2a7283ba675c81d8b060d4b50384fe65 /nagios-plugins/check_etc_hosts | |
parent | c29db339548e574516b9c037e0c4788c5d92fe56 (diff) | |
download | sitesummary-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-x | nagios-plugins/check_etc_hosts | 4 |
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; |