[apps::protocols::http::plugin] Unknown output with curl backend
Hi,
With 500 http error code, i have : UNKNOWN: 450 Timeout reached
I have same result with --opt-exit=critical and/or --change-exit=unknown=critical ( UNKNOWN: 450 Timeout reached )
I expect to get a critical on a 5xx error.
Best regards,
Hi, do you have any news for this fix ? Thanks
Hello,
I created a ticket to analyze this bug, you will be kept informed when this subject will move forward, thank you for your feedback.
Could you provide the complete command line and the result with --debug option ?
Hi,
The error only occurs if the time is greater than 5s.
/usr/lib/centreon/plugins//centreon_protocol_http.pl --plugin=apps::protocols::http::plugin --mode=response --hostname=127.0.0.1 --proto='https' --port='443' --hostname='*********' --urlpath='/' --method='GET' --warning='2' --critical='3' --warning-status='' --critical-status='%{http_code} < 200 or %{http_code} >= 300' --http-backend=curl --extra-stats --opt-exit=critical CRITICAL: 500 Internal Server Error, response time 4.244s | 'time'=4.244s;0:2;0:3;0; 'size'=0B;;;0; 'resolve'=13.214ms;;;0; 'connect'=13.214ms;;;0; 'tls'=23.119ms;;;0; 'processing'=4185.900ms;;;0; 'transfer'=13.214ms;;;0;
/usr/lib/centreon/plugins//centreon_protocol_http.pl --plugin=apps::protocols::http::plugin --mode=response --hostname=127.0.0.1 --proto='https' --port='443' --hostname='*********' --urlpath='/' --method='GET' --warning='2' --critical='3' --warning-status='' --critical-status='%{http_code} < 200 or %{http_code} >= 300' --http-backend=curl --extra-stats --opt-exit=critical CRITICAL: 450 Timeout reached, response time 5.012s | 'time'=5.012s;0:2;0:3;0; 'size'=0B;;;0; 'resolve'=0.911ms;;;0; 'connect'=0.911ms;;;0; 'tls'=12.426ms;;;0; 'processing'=-14.104ms;;;0; 'transfer'=0.911ms;;;0;
Which corresponds to this portion of code in the connector:
if ($self->{response_code} == 500) {
my $client_warning = $self->get_header(name => 'Client-Warning');
if (defined($client_warning) && $client_warning eq 'Internal response' && $self->{response_message} =~ /connection timed out/mi) {
$self->{response_code} = 450;
$self->{response_message} = 'Timeout reached';
}
}
Hi @gagzou,
In your last command results, you seem to have successfully obtained a CRITICAL status following your 450 HTTP response. Is it solved for you?
If not, as @garnier-quentin said, it would help us understand what is the issue if we had the output provided by the --debug option.
Hi, I think this issue relates to this older one.