fix datadomain unitialized value
This commit is contained in:
parent
df7ab970d2
commit
61b5858838
|
@ -74,10 +74,12 @@ sub custom_used_output {
|
|||
my ($used_value, $used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used});
|
||||
my ($free_value, $free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free});
|
||||
|
||||
return sprintf("Usage Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)",
|
||||
return sprintf(
|
||||
"Usage Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)",
|
||||
$total_value . " " . $total_unit,
|
||||
$used_value . " " . $used_unit, $self->{result_values}->{used_prct},
|
||||
$free_value . " " . $free_unit, $self->{result_values}->{free_prct});
|
||||
$free_value . " " . $free_unit, $self->{result_values}->{free_prct}
|
||||
);
|
||||
}
|
||||
|
||||
sub new {
|
||||
|
@ -119,8 +121,10 @@ sub manage_selection {
|
|||
nothing_quit => 1
|
||||
);
|
||||
if (!($self->{os_version} = storage::emc::DataDomain::lib::functions::get_version(value => $self->{results}->{$oid_sysDescr}->{$oid_sysDescr . '.0'}))) {
|
||||
$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();
|
||||
}
|
||||
|
|
|
@ -66,11 +66,8 @@ sub set_counters {
|
|||
sub prefix_repl_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
if ($self->{multiple} == 1) {
|
||||
return "Replication '" . $options{instance_value}->{display} . "' ";
|
||||
}
|
||||
return "Replication ";
|
||||
}
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
|
@ -78,9 +75,9 @@ sub new {
|
|||
bless $self, $class;
|
||||
|
||||
$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' },
|
||||
'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' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
@ -99,14 +96,18 @@ my $oid_replicationInfoEntry = '.1.3.6.1.4.1.19746.1.8.1.1.1';
|
|||
sub manage_selection {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{global} = {};
|
||||
$self->{results} = $options{snmp}->get_multiple_table(oids => [ { oid => $oid_sysDescr },
|
||||
my $snmp_result = $options{snmp}->get_multiple_table(
|
||||
oids => [
|
||||
{ oid => $oid_sysDescr },
|
||||
{ oid => $oid_replicationInfoEntry },
|
||||
],
|
||||
nothing_quit => 1);
|
||||
nothing_quit => 1
|
||||
);
|
||||
if (!($self->{os_version} = storage::emc::DataDomain::lib::functions::get_version(value => $self->{results}->{$oid_sysDescr}->{$oid_sysDescr . '.0'}))) {
|
||||
$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();
|
||||
}
|
||||
|
@ -139,15 +140,16 @@ sub manage_selection {
|
|||
replSyncedAsOfTime => { oid => '.1.3.6.1.4.1.19746.1.8.1.1.1.14' },
|
||||
};
|
||||
|
||||
foreach my $oid (keys %{$self->{results}->{$oid_replicationInfoEntry}}) {
|
||||
$self->{repl} = {};
|
||||
foreach my $oid (keys %{$snmp_result->{$oid_replicationInfoEntry}}) {
|
||||
next if ($oid !~ /^$mapping->{replState}->{oid}\.(.*)$/);
|
||||
my $instance = $1;
|
||||
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_replicationInfoEntry}, instance => $instance);
|
||||
$self->{repl}->{$instance} = { display => $result->{replSource} . '/' . $result->{replDestination},
|
||||
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result->{$oid_replicationInfoEntry}, instance => $instance);
|
||||
$self->{repl}->{$instance} = {
|
||||
display => $result->{replSource} . '/' . $result->{replDestination},
|
||||
state => $result->{replState},
|
||||
offset => (time() - $result->{replSyncedAsOfTime})
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -181,14 +183,9 @@ Can used special variables like: %{state}
|
|||
Set critical threshold for status (Default: '%{state} =~ /disabledNeedsResync|uninitialized/i').
|
||||
Can used special variables like: %{state}
|
||||
|
||||
=item B<--warning-*>
|
||||
=item B<--warning-*> B<--critical-*>
|
||||
|
||||
Threshold warning.
|
||||
Can be: 'offset'.
|
||||
|
||||
=item B<--critical-*>
|
||||
|
||||
Threshold critical.
|
||||
Thresholds.
|
||||
Can be: 'offset'.
|
||||
|
||||
=back
|
||||
|
|
Loading…
Reference in New Issue