diff --git a/storage/emc/DataDomain/mode/filesystem.pm b/storage/emc/DataDomain/mode/filesystem.pm index 82c448107..90f8b9266 100644 --- a/storage/emc/DataDomain/mode/filesystem.pm +++ b/storage/emc/DataDomain/mode/filesystem.pm @@ -42,10 +42,10 @@ sub set_counters { perfdatas => [ { value => 'used', label => 'used', cast_int => 1, unit => 'B', min => 0, max => 'total', threshold_total => 'total', - label_extra_instance => 1, instance_use => 'display' }, - ], + label_extra_instance => 1, instance_use => 'display' } + ] } - }, + } ]; } @@ -91,9 +91,9 @@ sub new { 'name' => { name => 'use_name' }, 'filesystem:s' => { name => 'filesystem' }, 'regexp' => { name => 'use_regexp' }, - 'regexp-isensitive' => { name => 'use_regexpi' }, + 'regexp-isensitive' => { name => 'use_regexpi' } }); - + return $self; } diff --git a/storage/emc/DataDomain/mode/hardware.pm b/storage/emc/DataDomain/mode/hardware.pm index 37d880a4b..fefe31de7 100644 --- a/storage/emc/DataDomain/mode/hardware.pm +++ b/storage/emc/DataDomain/mode/hardware.pm @@ -90,9 +90,8 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - }); + $options{options}->add_options(arguments => { + }); return $self; } @@ -103,8 +102,10 @@ sub get_version { my $oid_sysDescr = '.1.3.6.1.2.1.1.1.0'; # 'Data Domain OS 5.4.1.1-411752' 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.'); + $self->{output}->output_add( + severity => 'UNKNOWN', + short_msg => 'Cannot get DataDomain OS version.' + ); $self->{output}->display(); $self->{output}->exit(); } diff --git a/storage/emc/DataDomain/mode/replication.pm b/storage/emc/DataDomain/mode/replication.pm index 9a468cc68..5d420ebc1 100644 --- a/storage/emc/DataDomain/mode/replication.pm +++ b/storage/emc/DataDomain/mode/replication.pm @@ -38,7 +38,7 @@ sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ - { name => 'repl', type => 1, cb_prefix_output => 'prefix_repl_output', message_multiple => 'All replications are ok' }, + { name => 'repl', type => 1, cb_prefix_output => 'prefix_repl_output', message_multiple => 'All replications are ok' } ]; $self->{maps_counters}->{repl} = [ @@ -48,18 +48,18 @@ sub set_counters { output_use => 'state', closure_custom_calc => $self->can('custom_status_calc'), closure_custom_perfdata => sub { return 0; }, - closure_custom_threshold_check => \&catalog_status_threshold, + closure_custom_threshold_check => \&catalog_status_threshold } }, { label => 'offset', set => { key_values => [ { name => 'offset' }, { name => 'display' } ], output_template => 'last time peer sync : %s seconds ago', perfdatas => [ - { label => 'offset', value => 'offset', template => '%s', - label_extra_instance => 1, instance_use => 'display' }, - ], + { label => 'offset', template => '%s', + label_extra_instance => 1, instance_use => 'display' } + ] } - }, + } ]; } @@ -77,7 +77,7 @@ sub new { $options{options}->add_options(arguments => { 'unknown-status:s' => { name => 'unknown_status', default => '' }, 'warning-status:s' => { name => 'warning_status', default => '%{state} =~ /initializing|recovering/i' }, - 'critical-status:s' => { name => 'critical_status', default => '%{state} =~ /disabledNeedsResync|uninitialized/i' }, + 'critical-status:s' => { name => 'critical_status', default => '%{state} =~ /disabledNeedsResync|uninitialized/i' } }); return $self; @@ -99,11 +99,12 @@ sub manage_selection { my $snmp_result = $options{snmp}->get_multiple_table( oids => [ { oid => $oid_sysDescr }, - { oid => $oid_replicationInfoEntry }, + { oid => $oid_replicationInfoEntry } ], nothing_quit => 1 ); - if (!($self->{os_version} = storage::emc::DataDomain::lib::functions::get_version(value => $self->{results}->{$oid_sysDescr}->{$oid_sysDescr . '.0'}))) { + + if (!($self->{os_version} = storage::emc::DataDomain::lib::functions::get_version(value => $snmp_result->{$oid_sysDescr}->{$oid_sysDescr . '.0'}))) { $self->{output}->output_add( severity => 'UNKNOWN', short_msg => 'Cannot get DataDomain OS version.' @@ -111,7 +112,12 @@ sub manage_selection { $self->{output}->display(); $self->{output}->exit(); } - + + if (scalar(keys %{$snmp_result->{$oid_replicationInfoEntry}}) <= 0) { + $self->{output}->add_option_msg(short_msg => 'no replication informations'); + $self->{output}->option_exit(); + } + my ($oid_replSource, $oid_replDestination, $oid_replState); my %map_state = ( 1 => 'enabled', 2 => 'disabled', 3 => 'disabledNeedsResync', @@ -137,7 +143,7 @@ sub manage_selection { replState => { oid => $oid_replState, map => \%map_state }, replSource => { oid => $oid_replSource }, replDestination => { oid => $oid_replDestination }, - replSyncedAsOfTime => { oid => '.1.3.6.1.4.1.19746.1.8.1.1.1.14' }, + replSyncedAsOfTime => { oid => '.1.3.6.1.4.1.19746.1.8.1.1.1.14' } }; $self->{repl} = {};