From 71a95ac60d3cfc408ce6dd6fe69eac063065a737 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 17 Jan 2020 14:43:54 +0100 Subject: [PATCH] add TEXT dns search --- centreon-plugins/apps/protocols/dns/lib/dns.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/centreon-plugins/apps/protocols/dns/lib/dns.pm b/centreon-plugins/apps/protocols/dns/lib/dns.pm index 721864bfb..59ae923aa 100644 --- a/centreon-plugins/apps/protocols/dns/lib/dns.pm +++ b/centreon-plugins/apps/protocols/dns/lib/dns.pm @@ -33,6 +33,7 @@ my %map_search_field = ( A => 'address', PTR => 'name', CNAME => 'cname', + TXT => 'txtdata', ); sub search { @@ -51,12 +52,9 @@ sub search { if ($reply) { foreach my $rr ($reply->answer) { if (!defined($search_type)) { - if ($rr->type eq 'A') { - push @results, $rr->address; - } - if ($rr->type eq 'PTR') { - push @results, $rr->name; - } + push @results, $rr->address if ($rr->type eq 'A'); + push @results, $rr->name if ($rr->type eq 'PTR'); + push @results, $rr->txtdata if ($rr->type eq 'TXT'); next; }