+ Enhance elastic search

This commit is contained in:
garnier-quentin 2015-07-21 13:47:53 +02:00
parent ee8703cbe9
commit eb84744474
2 changed files with 2 additions and 13 deletions

View File

@ -125,7 +125,6 @@ sub run {
my $jsoncontent = centreon::plugins::httplib::connect($self, query_form_get => $query_form_get, connection_exit => 'critical');
my $json = JSON->new;
my $webcontent;
eval {
@ -139,11 +138,9 @@ sub run {
$self->{output}->output_add(severity => 'OK',
short_msg => sprintf("All indices are in green state."));
my $exit = 'OK';
foreach my $indicename (sort (keys %{$webcontent->{indices}})) {
my $tmp_exit = $self->get_severity(section => 'indices', value => $webcontent->{indices}->{$indicename}->{status});
my $tmp_exit = $self->get_severity(section => 'indices', value => $webcontent->{indices}->{$indicename}->{status});
$exit = $self->{output}->get_most_critical(status => [ $tmp_exit, $exit ]);
if (!$self->{output}->is_status(value => $tmp_exit, compare => 'OK', litteral => 1)) {
$self->{output}->output_add(long_msg => sprintf("Indice %s status is in %s state",
@ -151,7 +148,7 @@ sub run {
}
}
if ($exit ne 'OK') {
if (!$self->{output}->is_status(value => $exit, compare => 'OK', litteral => 1)) {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Some indices are in wrong state"));
}

View File

@ -106,26 +106,18 @@ sub run {
);
$self->{output}->perfdata_add(label => "nodemasteronly",
value => $webcontent->{nodes}->{count}->{master_only},
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
min => 0,
);
$self->{output}->perfdata_add(label => "nodedataonly",
value => $webcontent->{nodes}->{count}->{data_only},
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
min => 0,
);
$self->{output}->perfdata_add(label => "nodemasterdata",
value => $webcontent->{nodes}->{count}->{master_data},
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
min => 0,
);
$self->{output}->perfdata_add(label => "nodeclient",
value => $webcontent->{nodes}->{count}->{client},
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
min => 0,
);
$self->{output}->display();