diff --git a/centreon-plugins/apps/elasticsearch/mode/cluster.pm b/centreon-plugins/apps/elasticsearch/mode/cluster.pm index a72dedd5f..b11d9b85e 100644 --- a/centreon-plugins/apps/elasticsearch/mode/cluster.pm +++ b/centreon-plugins/apps/elasticsearch/mode/cluster.pm @@ -44,9 +44,9 @@ sub new { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => '9200'}, + "port:s" => { name => 'port', default => 9200 }, "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path' }, + "urlpath:s" => { name => 'url_path', default => '/_cluster/health' }, "credentials" => { name => 'credentials' }, "username:s" => { name => 'username' }, "password:s" => { name => 'password' }, @@ -77,7 +77,6 @@ sub check_options { push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; } - $self->{option_results}->{url_path} = $self->{option_results}->{url_path} . "_cluster/health/"; $self->{http}->set_options(%{$self->{option_results}}); } @@ -176,7 +175,7 @@ Specify https if needed (Default: 'http') =item B<--urlpath> -Set path to get Elasticsearch information (Default: '/') +Set path to get Elasticsearch information (Default: '/_cluster/health') =item B<--credentials> diff --git a/centreon-plugins/apps/elasticsearch/mode/indices.pm b/centreon-plugins/apps/elasticsearch/mode/indices.pm index 42c4e5b63..0d510a2a1 100644 --- a/centreon-plugins/apps/elasticsearch/mode/indices.pm +++ b/centreon-plugins/apps/elasticsearch/mode/indices.pm @@ -51,9 +51,9 @@ sub new { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => '9200'}, + "port:s" => { name => 'port', default => 9200 }, "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path' }, + "urlpath:s" => { name => 'url_path', default => '/_cluster/health' }, "credentials" => { name => 'credentials' }, "username:s" => { name => 'username' }, "password:s" => { name => 'password' }, @@ -84,8 +84,7 @@ sub check_options { push @{$self->{overload_th}->{$section}}, {filter => $filter, status => $status}; } - $self->{option_results}->{url_path} = $self->{option_results}->{url_path} . "_cluster/health"; - $self->{option_results}->{get_param} = ['level=indices']; + $self->{option_results}->{get_param} = [ 'level=indices' ]; $self->{http}->set_options(%{$self->{option_results}}); } @@ -172,7 +171,7 @@ Specify https if needed (Default: 'http') =item B<--urlpath> -Set path to get Elasticsearch information (Default: '/') +Set path to get Elasticsearch information (Default: '/_cluster/health') =item B<--credentials> diff --git a/centreon-plugins/apps/elasticsearch/mode/nodescount.pm b/centreon-plugins/apps/elasticsearch/mode/nodescount.pm index d55e25f3c..1babb409a 100644 --- a/centreon-plugins/apps/elasticsearch/mode/nodescount.pm +++ b/centreon-plugins/apps/elasticsearch/mode/nodescount.pm @@ -36,9 +36,9 @@ sub new { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => '9200'}, + "port:s" => { name => 'port', default => 9200 }, "proto:s" => { name => 'proto' }, - "urlpath:s" => { name => 'url_path' }, + "urlpath:s" => { name => 'url_path', default => '/_cluster/stats' }, "credentials" => { name => 'credentials' }, "username:s" => { name => 'username' }, "password:s" => { name => 'password' }, @@ -64,7 +64,6 @@ sub check_options { $self->{output}->option_exit(); } - $self->{option_results}->{url_path} = $self->{option_results}->{url_path} . "_cluster/stats/"; $self->{http}->set_options(%{$self->{option_results}}); } @@ -141,7 +140,7 @@ Specify https if needed (Default: 'http') =item B<--urlpath> -Set path to get Elasticsearch information (Default: '/') +Set path to get Elasticsearch information (Default: '_cluster/stats') =item B<--credentials>