centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
311 stars 274 forks source link

apps::protocols::dns::plugin - Building array of nameservers #4359

Closed benhartwich closed 1 year ago

benhartwich commented 1 year ago

Hi,

how can I build an array at centreon plugin to have different nameservers at the command line, e.g.:

./centreon_plugins.pl --plugin=apps::protocols::dns::plugin --mode=request --nameservers=8.8.8.8 1.1.1.1 208.67.222.220 --search-type=A --search=heise.de

I´ve tried [ ], "" , ; but nothing works. Any hint appreciated!

garnier-quentin commented 1 year ago

It should be like that:

--nameservers='8.8.8.8' --nameservers='1.1.1.1' --nameservers='208.67.222.220'

I could add a system with coma also: --nameservers=8.8.8.8,1.1.1.1,208.67.222.220

benhartwich commented 1 year ago

Thanks - with coma it doesn´t work:

./centreon_plugins.pl --plugin=apps::protocols::dns::plugin --mode=request --nameservers=8.8.8.8,1.1.1.1 --search-type=A --search=heise.de

unresolvable name: 8.8.8.8,1.1.1.1 at /home/nagios/centreon-plugins/src/apps/protocols/dns/lib/dns.pm line 92. CRITICAL: DNS query failed: no nameservers

With single --nameservers Attributes it seems to work. Thanks!

garnier-quentin commented 1 year ago

Yes it won't work with coma but i could add it.

benhartwich commented 1 year ago

Ah ok, sorry, missunderstood - yes, this would be great!

garnier-quentin commented 1 year ago

https://github.com/centreon/centreon-plugins/pull/4362