Hi Icinga Community,
The ITL command dns has a ‘-a’ parameter that allows for multiples of this flag.
dns_expected_answers Optional. The answer(s) to look for. A hostname must end with a dot. Multiple answers must be defined as array.
Also, this is documented in the command definitions: -
dns_expected_answers Optional ip address or host you expect the DNS server to return. Host must end with a dot (.). This option can be repeated multiple times (Returns OK if any value match). If multiple addresses are returned at once, you have to match the whole string of addresses separated with commas (sorted alphabetically).
I defined a service and added an array as a string for the -a variable ‘dns_expected_answers’ like this.
But the check fails:
DNS CRITICAL - expected ‘[10.70.55.23, ns2.services.somedomain.net]’ but got ‘10.70.55.23’
We use Directory for managing the commands/services/hosts etc.
I can execute the check manually on the server
/usr/lib64/nagios/plugins/check_dns -H ns2.services.somedomain.net -slocalhost -qA -a ns2.services.trakm8.net -a 10.70.55.23 -w1 -c5 DNS OK: 0.010 seconds response time. ns2.services.somedomain.net returns 10.70.55.23|time=0.009936s;1.000000;5.000000;0.000000
How do you define multiple ‘-a’ values for this check in icinga2 director?
Thank you in advance.