From 927477365e8e8f6a29bfacae141585edce0f1c13 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Thu, 3 Nov 2016 11:03:15 +0100 Subject: [PATCH] + add centreon hardware --- centreon/plugins/templates/hardware.pm | 34 +++++++++++++++----------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/centreon/plugins/templates/hardware.pm b/centreon/plugins/templates/hardware.pm index d01a5e600..763d4323c 100644 --- a/centreon/plugins/templates/hardware.pm +++ b/centreon/plugins/templates/hardware.pm @@ -245,21 +245,8 @@ sub exec_components { } } -sub run { +sub display { my ($self, %options) = @_; - - $self->{loaded} = 0; - $self->call_object_callback(method_name => $self->{cb_hook1}, %options); - - $self->load_components(%options); - if ($self->{loaded} == 0) { - $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); - $self->{output}->option_exit(); - } - - $self->call_object_callback(method_name => $self->{cb_hook2}, %options); - $self->exec_components(%options); - $self->call_object_callback(method_name => $self->{cb_hook3}, %options); my $total_components = 0; my $display_by_component = ''; @@ -283,6 +270,25 @@ sub run { $self->{output}->output_add(severity => $self->{no_components}, short_msg => 'No components are checked.'); } +} + +sub run { + my ($self, %options) = @_; + + $self->{loaded} = 0; + $self->call_object_callback(method_name => $self->{cb_hook1}, %options); + + $self->load_components(%options); + if ($self->{loaded} == 0) { + $self->{output}->add_option_msg(short_msg => "Wrong option. Cannot find component '" . $self->{option_results}->{component} . "'."); + $self->{output}->option_exit(); + } + + $self->call_object_callback(method_name => $self->{cb_hook2}, %options); + $self->exec_components(%options); + $self->call_object_callback(method_name => $self->{cb_hook3}, %options); + + $self->display(); $self->call_object_callback(method_name => $self->{cb_hook4}, %options);