<div dir="ltr">Hey Guys,<br>
<br>
I am new to administer a Bind server and after a few problems i ran into
i need to monitor the zonefile transfers of my slave server.<br>
I have searched on google and nagios plugin sites but could not find anything that fits my needs entirely.<br>
<br>
Here is the Setup:<br>
- MS ActiveDirectory as primary Nameservers (not under my control)<br>
- 2 Bind server as slave for various zones (behind a loadbalancer)<br>
<br>
The problem i ran into, was that the zone transfer didn't work for some
reason and the zone we hold expired causing our mailgateway to stop
relaying mails :/<br>
<br>
As i sayed i googled around and as i could not find anything i hacked a nagios plugin myself ( you can find the code here <a href="https://github.com/seppovic/Nagios-plugins/blob/master/libexec/check_dns_zonetransfer.pl" target="_blank">https://github.com/seppovic/Nagios-plugins/blob/master/libexec/check_dns_zonetransfer.pl</a>). But i am curious if i took the right "route". These are my assumptions and a first approach:<br>
<br>
- read named.conf and get master servers<br>
- query soa of slave and get serial<br>
- query first master and get serial<br>
- if serial match:<br>
get zonefile modification time (not sure if this is significant) and compare it with localtime and "soa-expiretime"<br>
+ warn or crit on threshold<br>
(stat($zoneFile)[9] + $SOA_S->expire) - time<br>
- if master serial > slave serial<br>
create tempfile and check for how long it stays lower then masters serial<br>
+ warn or crit on threshold<br>
- else<br>
test next master<br>
on last master exit with error ( this should not become true ever, right?)<br>
<br>
<br>
A few problems i discovered:<br>
- sometimes have a higher serial then all masters have, is this normal
on an AD DNS? or am I doing something wrong i thought this could not
happen.<br>
- Some Zones nearly always reach expireation time. and i get a lot of
critical messages and a few hours/minutes before expireation it does the
update.<br>
<br>
i hope you can guide me a bit and tell me if this is what i want xD<br>
<br>
many thanks in advance<br>
seppovic</div>