diff --git a/apps/monitoring/alyvix/restapi/custom/api.pm b/apps/monitoring/alyvix/restapi/custom/api.pm index 0b311cfa7..1ea38b2f6 100644 --- a/apps/monitoring/alyvix/restapi/custom/api.pm +++ b/apps/monitoring/alyvix/restapi/custom/api.pm @@ -76,7 +76,7 @@ sub check_options { $self->{port} = (defined($self->{option_results}->{port})) ? $self->{option_results}->{port} : 80; $self->{proto} = (defined($self->{option_results}->{proto})) ? $self->{option_results}->{proto} : 'http'; $self->{url_path} = (defined($self->{option_results}->{url_path})) ? $self->{option_results}->{url_path} : '/v0/'; - $self->{timeout} = (defined($self->{option_results}->{timeout})) ? $self->{option_results}->{timeout} : 10; + $self->{timeout} = (defined($self->{option_results}->{timeout}) && $self->{option_results}->{timeout} =~ /^(\d+)$/) ? $1 : 30; $self->{api_username} = (defined($self->{option_results}->{api_username})) ? $self->{option_results}->{api_username} : undef; $self->{api_password} = (defined($self->{option_results}->{api_password})) ? $self->{option_results}->{api_password} : undef; $self->{unknown_http_status} = (defined($self->{option_results}->{unknown_http_status})) ? $self->{option_results}->{unknown_status} : '%{http_code} < 200 or %{http_code} >= 300'; diff --git a/centreon/plugins/backend/http/curl.pm b/centreon/plugins/backend/http/curl.pm index 76510d499..7c091e62f 100644 --- a/centreon/plugins/backend/http/curl.pm +++ b/centreon/plugins/backend/http/curl.pm @@ -301,7 +301,7 @@ sub request { $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_VERBOSE'), parameter => 1); } - if (defined($options{request}->{timeout})) { + if (defined($options{request}->{timeout}) && $options{request}->{timeout} =~ /\d/) { $self->curl_setopt(option => $self->{constant_cb}->(name => 'CURLOPT_TIMEOUT'), parameter => $options{request}->{timeout}); } if (defined($options{request}->{cookies_file})) {