summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Smokeping/probes/AnotherDNS.pm7
1 files changed, 6 insertions, 1 deletions
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',