From ad11cdd3b886c4e4a88cd971f4b1609effb86681 Mon Sep 17 00:00:00 2001 From: Quentin Garnier Date: Fri, 6 Dec 2013 12:36:02 +0100 Subject: [PATCH] Fix #6309 --- connectors/vmware/centreon_esx_client.pl | 17 +++++++++++------ connectors/vmware/centreonesxd.pm | 2 +- connectors/vmware/lib/cmdlistdatastore.pm | 6 ------ connectors/vmware/lib/cmdlistnichost.pm | 6 ------ 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/connectors/vmware/centreon_esx_client.pl b/connectors/vmware/centreon_esx_client.pl index 2006ce79c..e39d0092a 100644 --- a/connectors/vmware/centreon_esx_client.pl +++ b/connectors/vmware/centreon_esx_client.pl @@ -6,7 +6,7 @@ use IO::Socket; use Getopt::Long; my $PROGNAME = $0; -my $VERSION = "1.5.2"; +my $VERSION = "1.5.3"; my %ERRORS = (OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3, DEPENDENT => 4); my $socket; my $separatorin = '~'; @@ -66,7 +66,6 @@ GetOptions( "nic=s" => \$OPTION{nic}, - "older=i" => \$OPTION{older}, "warn" => \$OPTION{warn}, "crit" => \$OPTION{crit}, @@ -772,30 +771,36 @@ sub listhost_get_str { } sub listdatastore_check_arg { + if (defined($OPTION{show_attributes})) { + print "name\n"; + } $OPTION{xml} = (defined($OPTION{xml}) ? 1 : 0); - $OPTION{show_attributes} = (defined($OPTION{show_attributes}) ? 1 : 0); return 0; } sub listdatastore_get_str { return join($separatorin, - ('listdatastore', $OPTION{vsphere}, $OPTION{xml}, $OPTION{show_attributes})); + ('listdatastore', $OPTION{vsphere}, $OPTION{xml})); } sub listnichost_check_arg { + if (defined($OPTION{show_attributes})) { + print "name\n"; + exit(0); + } + if (!defined($OPTION{'esx-host'})) { print "Option --esx-host is required\n"; print_usage(); exit $ERRORS{UNKNOWN}; } $OPTION{xml} = (defined($OPTION{xml}) ? 1 : 0); - $OPTION{show_attributes} = (defined($OPTION{show_attributes}) ? 1 : 0); return 0; } sub listnichost_get_str { return join($separatorin, - ('listnichost', $OPTION{vsphere}, $OPTION{'esx-host'}, $OPTION{xml}, $OPTION{show_attributes})); + ('listnichost', $OPTION{vsphere}, $OPTION{'esx-host'}, $OPTION{xml})); } sub getmap_check_arg { diff --git a/connectors/vmware/centreonesxd.pm b/connectors/vmware/centreonesxd.pm index 798e6e582..2818c24b4 100644 --- a/connectors/vmware/centreonesxd.pm +++ b/connectors/vmware/centreonesxd.pm @@ -20,7 +20,7 @@ BEGIN { use base qw(centreon::script); use vars qw(%centreonesxd_config); -my $VERSION = "1.5.2"; +my $VERSION = "1.5.3"; my %handlers = (TERM => {}, HUP => {}, CHLD => {}); my @load_modules = ('centreon::esxd::cmdcountvmhost', 'centreon::esxd::cmdcpuhost', diff --git a/connectors/vmware/lib/cmdlistdatastore.pm b/connectors/vmware/lib/cmdlistdatastore.pm index 6a470d5b6..959e9d013 100644 --- a/connectors/vmware/lib/cmdlistdatastore.pm +++ b/connectors/vmware/lib/cmdlistdatastore.pm @@ -29,17 +29,11 @@ sub checkArgs { sub initArgs { my $self = shift; $self->{xml} = (defined($_[0]) && $_[0] == 1) ? 1 : 0; - $self->{show_attributes} = (defined($_[1]) && $_[1] == 1) ? 1 : 0; } sub run { my $self = shift; - if ($self->{show_attributes} == 1) { - $self->{obj_esxd}->print_response(centreon::esxd::common::get_status(0) . "|name\n"); - return ; - } - my %filters = (); my @properties = ('summary'); diff --git a/connectors/vmware/lib/cmdlistnichost.pm b/connectors/vmware/lib/cmdlistnichost.pm index e129b188f..f41269b80 100644 --- a/connectors/vmware/lib/cmdlistnichost.pm +++ b/connectors/vmware/lib/cmdlistnichost.pm @@ -36,17 +36,11 @@ sub initArgs { my $self = shift; $self->{lhost} = $_[0]; $self->{xml} = (defined($_[1]) && $_[1] == 1) ? 1 : 0; - $self->{show_attributes} = (defined($_[2]) && $_[2] == 1) ? 1 : 0; } sub run { my $self = shift; my %nic_in_vswitch = (); - - if ($self->{show_attributes} == 1) { - $self->{obj_esxd}->print_response(centreon::esxd::common::get_status(0) . "|name\n"); - return ; - } my %filters = ('name' => $self->{lhost}); my @properties = ('config.network.pnic', 'config.network.vswitch', 'config.network.proxySwitch');