From 596095e70074ce85cafa207e600a17c8fd173e8f Mon Sep 17 00:00:00 2001 From: qgarnier Date: Tue, 21 Nov 2017 11:09:20 +0100 Subject: [PATCH] enable kaminario --- storage/kaminario/restapi/custom/api.pm | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/storage/kaminario/restapi/custom/api.pm b/storage/kaminario/restapi/custom/api.pm index 4ea8dd4a8..022bfdc2d 100644 --- a/storage/kaminario/restapi/custom/api.pm +++ b/storage/kaminario/restapi/custom/api.pm @@ -129,18 +129,9 @@ sub get_performance { my ($self, %options) = @_; $self->settings(); - #my $content = $self->{http}->request(url_path => '/api/v2' . $options{path} . '&__resolution=' . $self->{resolution}, - # critical_status => '', warning_status => ''); - my $content = do { - local $/ = undef; - if (!open my $fh, "<", '/tmp/4.json') { - $self->{output}->add_option_msg(short_msg => "Could not open file toto : $!"); - $self->{output}->option_exit(); - } - <$fh>; - }; - - #my $response = $self->{http}->get_response(); + my $content = $self->{http}->request(url_path => '/api/v2' . $options{path} . '&__resolution=' . $self->{resolution}, + critical_status => '', warning_status => ''); + my $response = $self->{http}->get_response(); my $decoded; eval { @@ -151,10 +142,10 @@ sub get_performance { $self->{output}->option_exit(); } - #if ($response->code() != 200) { - # $self->{output}->add_option_msg(short_msg => "Connection issue: " . $decoded->{message}); - # $self->{output}->option_exit(); - #} + if ($response->code() != 200) { + $self->{output}->add_option_msg(short_msg => "Connection issue: " . $decoded->{message}); + $self->{output}->option_exit(); + } return $decoded; }