+ factorize some code

This commit is contained in:
garnier-quentin 2016-08-02 17:42:51 +02:00
parent 326e133e2c
commit cc2fcecfa3
35 changed files with 244 additions and 497 deletions

View File

@ -262,7 +262,7 @@ sub load_module {
for (@_) {
(my $file = "$_.pm") =~ s{::}{/}g;
require $file;
my $obj = $_->new($self->{logger});
my $obj = $_->new(logger => $self->{logger});
$self->{modules_registry}->{$obj->getCommandName()} = $obj;
}
}

View File

@ -18,6 +18,8 @@
package centreon::vmware::cmdalarmdatacenter;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
@ -25,20 +27,15 @@ use centreon::plugins::statefile;
use Digest::MD5 qw(md5_hex);
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'alarmdatacenter';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -62,12 +59,6 @@ sub initArgs {
$self->{manager}->{perfdata}->threshold_validate(label => 'critical', value => 0);
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,6 +18,8 @@
package centreon::vmware::cmdalarmhost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
@ -25,20 +27,15 @@ use centreon::plugins::statefile;
use Digest::MD5 qw(md5_hex);
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'alarmhost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -62,12 +59,6 @@ sub initArgs {
$self->{manager}->{perfdata}->threshold_validate(label => 'critical', value => 0);
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -0,0 +1,45 @@
# Copyright 2015 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package centreon::vmware::cmdbase;
use strict;
use warnings;
sub new {
my ($class, %options) = @_;
my $self = {};
bless $self, $class;
$self->{logger} = $options{logger};
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
1;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdcountvmhost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'countvmhost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -74,12 +71,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdcpuhost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'cpuhost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -76,12 +73,6 @@ sub initArgs {
$self->{manager}->{perfdata}->threshold_validate(label => 'critical', value => $options{arguments}->{critical});
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdcpuvm;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'cpuvm';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -80,12 +77,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmddatastorecountvm;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'datastorecountvm';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -74,12 +71,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,26 +18,23 @@
package centreon::vmware::cmddatastorehost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use File::Basename;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'datastorehost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -80,12 +77,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmddatastoreio;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'datastoreio';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -74,12 +71,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmddatastoreiops;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'datastoreiops';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -74,12 +71,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmddatastoresnapshot;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'datastoresnapshot';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -74,12 +71,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmddatastoreusage;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'datastoreusage';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -78,12 +75,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,26 +18,23 @@
package centreon::vmware::cmddatastorevm;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
use File::Basename;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'datastorevm';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -86,12 +83,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdgetmap;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'getmap';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -58,12 +55,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdhealthhost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'healthhost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -66,12 +63,6 @@ sub initArgs {
$self->{manager}->{perfdata}->threshold_validate(label => 'critical', value => 0);
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdlimitvm;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'limitvm';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -82,12 +79,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub display_verbose {
my ($self, %options) = @_;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdlistdatacenters;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'listdatacenters';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -58,12 +55,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdlistdatastores;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'listdatastores';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -58,12 +55,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdlistnichost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'listnichost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -58,12 +55,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;
my %nic_in_vswitch = ();

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdmaintenancehost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'maintenancehost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -70,12 +67,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdmemhost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'memhost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -76,12 +73,6 @@ sub initArgs {
$self->{manager}->{perfdata}->threshold_validate(label => 'critical', value => $options{arguments}->{critical});
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdmemvm;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'memvm';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -82,12 +79,6 @@ sub initArgs {
$self->{manager}->{perfdata}->threshold_validate(label => 'critical', value => $options{arguments}->{critical});
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,26 +18,22 @@
package centreon::vmware::cmdnethost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'nethost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -86,12 +82,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdservicehost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'servicehost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -64,12 +61,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdsnapshotvm;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'snapshotvm';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -74,12 +71,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdstatushost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'statushost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -64,12 +61,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdstatusvm;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'statusvm';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -64,12 +61,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdswaphost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'swaphost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -76,12 +73,6 @@ sub initArgs {
$self->{manager}->{perfdata}->threshold_validate(label => 'critical', value => $options{arguments}->{critical});
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdswapvm;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'swapvm';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -82,12 +79,6 @@ sub initArgs {
$self->{manager}->{perfdata}->threshold_validate(label => 'critical', value => $options{arguments}->{critical});
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdthinprovisioningvm;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'thinprovisioningvm';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -71,12 +68,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub display_verbose {
my ($self, %options) = @_;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdtimehost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'timehost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -74,12 +71,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmdtoolsvm;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'toolsvm';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -82,12 +79,6 @@ sub initArgs {
$self->{manager}->{output}->{plugin} = $options{arguments}->{identity};
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub display_verbose {
my ($self, %options) = @_;

View File

@ -18,25 +18,22 @@
package centreon::vmware::cmduptimehost;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'uptimehost';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -76,12 +73,6 @@ sub initArgs {
$self->{manager}->{perfdata}->threshold_validate(label => 'critical', value => $options{arguments}->{critical});
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;

View File

@ -18,6 +18,8 @@
package centreon::vmware::cmdvmoperationcluster;
use base qw(centreon::vmware::cmdbase);
use strict;
use warnings;
use centreon::vmware::common;
@ -25,20 +27,15 @@ use centreon::plugins::statefile;
use Digest::MD5 qw(md5_hex);
sub new {
my $class = shift;
my $self = {};
$self->{logger} = shift;
my ($class, %options) = @_;
my $self = $class->SUPER::new(%options);
bless $self, $class;
$self->{commandName} = 'vmoperationcluster';
bless $self, $class;
return $self;
}
sub getCommandName {
my $self = shift;
return $self->{commandName};
}
sub checkArgs {
my ($self, %options) = @_;
@ -72,12 +69,6 @@ sub initArgs {
}
}
sub set_connector {
my ($self, %options) = @_;
$self->{connector} = $options{connector};
}
sub run {
my $self = shift;