I like to have short alert thresholds for my DNS servers, but don't want
to get alerted when the serial takes a little while to sync up. I
modified dns.monitor to take an '-soa no' arg to disable the soa checks.
I setup a separate service group that runs with the soa checks and a
longer "alertafter" interval to let me know of serial number problems.
--- dns.monitor Sun Jun 24 18:54:19 2001
+++ dns.monitor.soa Fri Feb 1 16:21:08 2002
@@ -53,10 +53,12 @@
my($Program) = basename($0);
my(@Zones) = ();
my($Master) = undef;
+my($soa) = undef;
my(%OptVars) = ("master" => \$Master,
+ "soa" => \$soa,
"zone" => \@Zones);
-if (!GetOptions(\%OptVars, "master=s", "zone=s@")) {
+if (!GetOptions(\%OptVars, "master=s", "soa=s", "zone=s@")) {
print STDERR "Problems with Options, sorry\n";
exit 1;
}
@@ -163,6 +165,9 @@
}
$Serial = ($soa_req->answer)[0]->serial;
+ if ( $soa eq "no" ) {
+ # nothing
+ } else {
# Now, foreach server given on the command line, get the serial number from
# the SOA and compare it to the master.
$error_cnt = 0;
@@ -198,6 +203,8 @@
next;
}
}
+ }
+
if ($error_cnt == 0) {
return(undef, undef);
} else {
--
There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult. -C.A.R. Hoare