From 74b8102732314d9061c5a977aa33850d0c392666 Mon Sep 17 00:00:00 2001 From: Shini31 Date: Fri, 17 Jul 2015 12:11:11 +0200 Subject: [PATCH] fix issues with OK state and change output --- apps/elasticsearch/mode/indices.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/elasticsearch/mode/indices.pm b/apps/elasticsearch/mode/indices.pm index c23baf50f..a7687963e 100644 --- a/apps/elasticsearch/mode/indices.pm +++ b/apps/elasticsearch/mode/indices.pm @@ -62,7 +62,7 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $self->{version} = '1.0'; + $self->{version} = '1.1'; $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, @@ -166,10 +166,12 @@ sub run { } } - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("One or some indices are in %s state", $map_states_indices{$exit})); + if ($exit ne 'OK') { + $self->{output}->output_add(severity => $exit, + short_msg => sprintf("Some indices are in wrong state")); + } - $self->{output}->display(force_long_output => 1); + $self->{output}->display(); $self->{output}->exit(); }