centreon-plugins icon indicating copy to clipboard operation
centreon-plugins copied to clipboard

[apps::protocols::http::plugin] Unknown output with curl backend

Open gagzou opened this issue 2 years ago • 7 comments

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,

gagzou avatar Feb 04 '24 16:02 gagzou

Hi, do you have any news for this fix ? Thanks

gagzou avatar Mar 02 '24 21:03 gagzou

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.

lucie-tirand avatar Jul 03 '24 08:07 lucie-tirand

Could you provide the complete command line and the result with --debug option ?

garnier-quentin avatar Jul 03 '24 09:07 garnier-quentin

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;

gagzou avatar Jul 16 '24 10:07 gagzou

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';
          }
      }

gagzou avatar Jul 16 '24 10:07 gagzou

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.

omercier avatar Jul 25 '24 07:07 omercier

Hi, I think this issue relates to this older one.

omercier avatar Jul 30 '24 11:07 omercier