How to tell (in a script) if a zone failed to load?

Treptow, Craig Treptow.Craig at principal.com
Wed Jul 25 19:28:47 UTC 2001


I have added this to my logging section:

        channel load_file {
        file "/usr/local/named/logs/named.load.zone" versions 5 size 1M;
        print-time yes;
        print-category no;
        print-severity yes;
        };

This provides entries in the log file like:

25-Jul-2001 12:26:50.699 warning: master zone "net.principal.com" (IN) rejected due to errors (serial 2001072503)
25-Jul-2001 12:29:51.811 info: master zone "net.principal.com" (IN) loaded (serial 2001072504)

This should be pretty easy to deal with programmatically.  

Perhaps you can expand on this to do what you want??

Craig

-----Original Message-----
From: phil-news-nospam at ipal.net [mailto:phil-news-nospam at ipal.net]
Sent: Wednesday, July 25, 2001 12:54 PM
To: comp-protocols-dns-bind at moderators.isc.org
Subject: How to tell (in a script) if a zone failed to load?


How can I tell, from the script that restarts bind, if a zone file
has failed to load?  It is not practical to actually do a test
query of every zone.  The syslog on the machine is huge, and while
grepping it might be feasible, know what patterns to look for are
the problem.  There are error messages for zones that failed to
load and error messages for zones that loaded OK.  I'd like to
find a programmable way to determine if a zone has failed.  The
purpose for this is so that the script will call a halt to trying
to restart any other bind servers, and alert the admin who started
it all that there is a problem.

I can't use named-checkzone because it only does one zone at a time.
And named-checkconf doesn't actually follow the config file into all
the zones.  It would be useful (very useful) to have a program that
can do a _full_ integrity check starting at the config file and
going through everything involved, including all zone files that
are configured, and all other checks that would cause any kind of
failure in starting the server.

-- 
-----------------------------------------------------------------
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| phil-nospam at ipal.net | Texas, USA | http://phil.ipal.org/     |
-----------------------------------------------------------------


More information about the bind-users mailing list