From 754b59594326e45439a042907cc0da212eff7c60 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 20 Jan 2016 16:13:40 +0100 Subject: [PATCH] + Fix datadomain modes --- storage/emc/DataDomain/mode/filesystem.pm | 16 ++++++++-------- storage/emc/DataDomain/mode/hardware.pm | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/storage/emc/DataDomain/mode/filesystem.pm b/storage/emc/DataDomain/mode/filesystem.pm index f2e97a929..521e25d1b 100644 --- a/storage/emc/DataDomain/mode/filesystem.pm +++ b/storage/emc/DataDomain/mode/filesystem.pm @@ -33,7 +33,7 @@ sub set_counters { { name => 'fs', type => 1, cb_prefix_output => 'prefix_fs_output', message_multiple => 'All filesystems are ok.' }, ]; - $self->{maps_counters}->{ap} = [ + $self->{maps_counters}->{fs} = [ { label => 'usage', set => { key_values => [ { name => 'free' }, { name => 'used' }, { name => 'display' } ], closure_custom_calc => $self->can('custom_used_calc'), @@ -104,10 +104,10 @@ my ($oid_fileSystemResourceName, $oid_fileSystemSpaceUsed, $oid_fileSystemSpaceA sub add_result { my ($self, %options) = @_; - $self->{filesystem_id_selected}->{$options{instance}} = {}; - $self->{filesystem_id_selected}->{$options{instance}}->{display} = $self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemResourceName . '.' . $options{instance}}; - $self->{filesystem_id_selected}->{$options{instance}}->{free} = int($self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemSpaceAvail . '.' . $options{instance}} * 1024 * 1024 * 1024); - $self->{filesystem_id_selected}->{$options{instance}}->{used} = int($self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemSpaceUsed . '.' . $options{instance}} * 1024 * 1024 * 1024); + $self->{fs}->{$options{instance}} = {}; + $self->{fs}->{$options{instance}}->{display} = $self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemResourceName . '.' . $options{instance}}; + $self->{fs}->{$options{instance}}->{free} = int($self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemSpaceAvail . '.' . $options{instance}} * 1024 * 1024 * 1024); + $self->{fs}->{$options{instance}}->{used} = int($self->{results}->{$oid_fileSystemSpaceEntry}->{$oid_fileSystemSpaceUsed . '.' . $options{instance}} * 1024 * 1024 * 1024); } sub manage_selection { @@ -161,7 +161,7 @@ sub manage_selection { } } - if (scalar(keys %{$self->{filesystem_id_selected}}) <= 0 && !defined($options{disco})) { + if (scalar(keys %{$self->{fs}}) <= 0 && !defined($options{disco})) { if (defined($self->{option_results}->{device})) { $self->{output}->add_option_msg(short_msg => "No filesystem found '" . $self->{option_results}->{filesystem} . "'."); } else { @@ -183,8 +183,8 @@ sub disco_show { # $options{snmp} = snmp object $self->{snmp} = $options{snmp}; $self->manage_selection(disco => 1); - foreach (sort keys %{$self->{filesystem_id_selected}}) { - $self->{output}->add_disco_entry(name => $self->{filesystem_id_selected}->{$_}->{display}, + foreach (sort keys %{$self->{fs}}) { + $self->{output}->add_disco_entry(name => $self->{fs}->{$_}->{display}, deviceid => $_); } } diff --git a/storage/emc/DataDomain/mode/hardware.pm b/storage/emc/DataDomain/mode/hardware.pm index cd0f8b77b..99261289f 100644 --- a/storage/emc/DataDomain/mode/hardware.pm +++ b/storage/emc/DataDomain/mode/hardware.pm @@ -102,7 +102,7 @@ sub get_version { my ($self, %options) = @_; my $oid_sysDescr = '.1.3.6.1.2.1.1.1.0'; # 'Data Domain OS 5.4.1.1-411752' - my $result = $self->{snmp}->get_leef(oids => [ $oid_sysDescr ]); + my $result = $options{snmp}->get_leef(oids => [ $oid_sysDescr ]); if (!($self->{os_version} = storage::emc::DataDomain::lib::functions::get_version(value => $result->{$oid_sysDescr}))) { $self->{output}->output_add(severity => 'UNKNOWN', short_msg => 'Cannot get DataDomain OS version.');