[apps::protocols::dns::plugin] mode request
Hello,
When the DNS server does not answer, it's always UNKNOWN in Centreon. Even if option "--opt-exit=CRITICAL" or "--change-exit=unknown=critical" is used.
It is CRITICAL when one of these option are set through command line : CRITICAL: DNS query failed: query timed out
but not in Centreon Web Interface : (Process Timeout) and service is UNKNOWN state.
Should you add a --timeout option ?
I have done a fix. Maybe it could help. If you execute it in command line, how long it takes ?
Hello Quentin,
Here is the duration :
time /usr/lib/centreon/plugins/centreon-plugins/src/centreon_plugins.pl --plugin=apps::protocols::dns::plugin --mode=request --nameservers=X.X.X.X --search=xxx.xxx.fr -expected-answer=X.X.X.X --warning=5 --critical=7 --change-exit=unknown=critical
CRITICAL: DNS query failed: query timed out
real 2m30.262s user 0m0.108s sys 0m0.023s
The service is still UNKNOWN with your last version in Centreon WEB Interface.
Hello :)
Can you tell us if you still encounter this issue? I had create an issue ticket in our backlog about this issue.
@ritouret by default centreon-engine timeouts after 60 seconds. So you need to set following parameters (for example):
--dns-options='udp_timeout=10' --dns-options='tcp_timeout=30'
I think 30 seconds is an eternity for a DNS resolution @garnier-quentin ;-) And the retries make it last more than 1 minute in my tests.
This combination makes the execution last only about 5-6 seconds and returns a critical:
centreon-engine@central-deb-24-04:~$ time /usr/lib/centreon/plugins/centreon_protocol_dns.pl --plugin apps::protocols::dns::plugin --mode request --nameservers=1.2.3.4 --search=toto.fr -expected-answer=3.4.5.6 --warning=5 --critical=7 --dns-options='udp_timeout=1' --dns-options='tcp_timeout=1' --dns-options='retry=1'
CRITICAL: DNS query failed: query timed out
real 0m5.172s
user 0m0.132s
sys 0m0.035s
Thanks to Quentin and Olivier