diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | lib/Smokeping/probes/AnotherDNS.pm | 7 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,6 @@ +* AnotherDNS.pm: added option 'require_answers' for testing + recursive DNS servers. -- niko + 2006/7/9 -- released version 20060709_trunk 2006/7/8 -- released version 20060708_trunk diff --git a/lib/Smokeping/probes/AnotherDNS.pm b/lib/Smokeping/probes/AnotherDNS.pm index d4f0397..185426d 100644 --- a/lib/Smokeping/probes/AnotherDNS.pm +++ b/lib/Smokeping/probes/AnotherDNS.pm @@ -98,11 +98,12 @@ sub pingone ($) { $ready->recv( $buf, &Net::DNS::PACKETSZ ); my ($recvPacket, $err) = Net::DNS::Packet->new(\$buf); if (defined $recvPacket) { + my $recvHeader = $recvPacket->header(); + next if $recvHeader->ancount() < $target->{vars}{require_answers}; if (not $require_noerror) { push @times, $elapsed; } else { # Check the Response Code for the NOERROR. - my $recvHeader = $recvPacket->header(); if ($recvHeader->rcode() eq "NOERROR") { push @times, $elapsed; } @@ -143,6 +144,10 @@ DOC _doc => 'Only Count Answers with Response Status NOERROR.', _default => 0, }, + require_answers => { + _doc => 'Only Count Answers with answer count >= this value.', + _default => 0, + }, recordtype => { _doc => 'Record type to look up.', _default => 'A', |