(plugin) apps::protocols::dns - option --nameservers can use coma (#4362)
This commit is contained in:
parent
41fc4eeefe
commit
0072f02e85
|
@ -77,11 +77,20 @@ sub connect {
|
||||||
my %dns_options = ();
|
my %dns_options = ();
|
||||||
|
|
||||||
if (defined($self->{option_results}->{nameservers})) {
|
if (defined($self->{option_results}->{nameservers})) {
|
||||||
$dns_options{nameservers} = [@{$self->{option_results}->{nameservers}}];
|
foreach my $ns (@{$self->{option_results}->{nameservers}}) {
|
||||||
|
my @entries = split(/,/, $ns);
|
||||||
|
foreach my $name (@entries) {
|
||||||
|
next if ($name eq '');
|
||||||
|
$dns_options{nameservers} = [] if (!defined($dns_options{nameservers}));
|
||||||
|
push @{$dns_options{nameservers}}, $name;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (defined($self->{option_results}->{searchlist})) {
|
if (defined($self->{option_results}->{searchlist})) {
|
||||||
$dns_options{searchlist} = [@{$self->{option_results}->{searchlist}}];
|
$dns_options{searchlist} = [@{$self->{option_results}->{searchlist}}];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $option (@{$self->{option_results}->{dns_options}}) {
|
foreach my $option (@{$self->{option_results}->{dns_options}}) {
|
||||||
next if ($option !~ /^(.+?)=(.+)$/);
|
next if ($option !~ /^(.+?)=(.+)$/);
|
||||||
$dns_options{$1} = $2;
|
$dns_options{$1} = $2;
|
||||||
|
|
|
@ -163,7 +163,7 @@ perl centreon_plugins.pl --plugin=apps::protocols::dns::plugin --mode=request --
|
||||||
|
|
||||||
=item B<--nameservers>
|
=item B<--nameservers>
|
||||||
|
|
||||||
Set nameserver to query (can be multiple).
|
Set nameserver to query (can use option multiple times or separated values by coma).
|
||||||
The system configuration is used by default.
|
The system configuration is used by default.
|
||||||
|
|
||||||
=item B<--searchlist>
|
=item B<--searchlist>
|
||||||
|
|
Loading…
Reference in New Issue