Fix #1467
This commit is contained in:
parent
8f008705f8
commit
2b3ca0c834
|
@ -126,6 +126,7 @@ sub get {
|
|||
$self->settings();
|
||||
my $response = $self->{http}->request(url_path => '/storeonceservices' . $options{path},
|
||||
critical_status => '', warning_status => '');
|
||||
|
||||
my $content;
|
||||
eval {
|
||||
$content = XMLin($response, ForceArray => $options{ForceArray}, KeyAttr => []);
|
||||
|
|
|
@ -148,15 +148,14 @@ sub new {
|
|||
bless $self, $class;
|
||||
|
||||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' },
|
||||
"critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' },
|
||||
"units:s" => { name => 'units', default => '%' },
|
||||
"free" => { name => 'free' },
|
||||
});
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' },
|
||||
"critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' },
|
||||
"units:s" => { name => 'units', default => '%' },
|
||||
"free" => { name => 'free' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
@ -194,15 +193,16 @@ sub manage_selection {
|
|||
next;
|
||||
}
|
||||
|
||||
my $total = (defined($entry->{properties}->{capacity})) ? $entry->{properties}->{capacity} * 1024 * 1024 * 1024 : $entry->{properties}->{localCapacityBytes};
|
||||
my $used = $total - (defined($entry->{properties}->{freeSpace})) ? $entry->{properties}->{freeSpace} * 1024 * 1024 * 1024 : $entry->{properties}->{localFreeBytes};
|
||||
my $total = defined($entry->{properties}->{capacity}) ? $entry->{properties}->{capacity} * 1024 * 1024 * 1024 : $entry->{properties}->{localCapacityBytes};
|
||||
my $used = $total - (defined($entry->{properties}->{freeSpace}) ? $entry->{properties}->{freeSpace} * 1024 * 1024 * 1024 : $entry->{properties}->{localFreeBytes});
|
||||
|
||||
$self->{cluster}->{$entry->{properties}->{serialNumber}} = {
|
||||
display => $entry->{properties}->{applianceName},
|
||||
health => $mapping_health_level{$entry->{properties}->{healthLevel}},
|
||||
total => $total,
|
||||
used => $used,
|
||||
dedup => $entry->{properties}->{dedupeRatio} };
|
||||
dedup => $entry->{properties}->{dedupeRatio}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,12 +95,11 @@ sub new {
|
|||
bless $self, $class;
|
||||
|
||||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"warning-status:s" => { name => 'warning_status', default => '%{is_online} == 1 and %{health} =~ /warning/i' },
|
||||
"critical-status:s" => { name => 'critical_status', default => '%{is_online} == 1 and %{health} =~ /critical/i' },
|
||||
});
|
||||
$options{options}->add_options(arguments => {
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"warning-status:s" => { name => 'warning_status', default => '%{is_online} == 1 and %{health} =~ /warning/i' },
|
||||
"critical-status:s" => { name => 'critical_status', default => '%{is_online} == 1 and %{health} =~ /critical/i' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
@ -155,7 +154,8 @@ sub manage_selection {
|
|||
is_online => $entry->{properties}->{isOnline} eq 'true' ? 1 : 0,
|
||||
used => $entry->{properties}->{diskBytes},
|
||||
dedup => $entry->{properties}->{dedupeRatio},
|
||||
num_items => $entry->{properties}->{numItems} };
|
||||
num_items => $entry->{properties}->{numItems}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,15 +95,14 @@ sub new {
|
|||
bless $self, $class;
|
||||
|
||||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"warning-nas-status:s" => { name => 'warning_nas_status', default => '%{health} =~ /warning/i' },
|
||||
"critical-nas-status:s" => { name => 'critical_nas_status', default => '%{health} =~ /critical/i' },
|
||||
"warning-share-status:s" => { name => 'warning_share_status', default => '%{health} =~ /warning/i' },
|
||||
"critical-share-status:s" => { name => 'critical_share_status', default => '%{health} =~ /critical/i' },
|
||||
});
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"warning-nas-status:s" => { name => 'warning_nas_status', default => '%{health} =~ /warning/i' },
|
||||
"critical-nas-status:s" => { name => 'critical_nas_status', default => '%{health} =~ /critical/i' },
|
||||
"warning-share-status:s" => { name => 'warning_share_status', default => '%{health} =~ /warning/i' },
|
||||
"critical-share-status:s" => { name => 'critical_share_status', default => '%{health} =~ /critical/i' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
|
|
@ -151,15 +151,14 @@ sub new {
|
|||
bless $self, $class;
|
||||
|
||||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' },
|
||||
"critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' },
|
||||
"units:s" => { name => 'units', default => '%' },
|
||||
"free" => { name => 'free' },
|
||||
});
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"warning-status:s" => { name => 'warning_status', default => '%{health} =~ /warning/' },
|
||||
"critical-status:s" => { name => 'critical_status', default => '%{health} =~ /critical/' },
|
||||
"units:s" => { name => 'units', default => '%' },
|
||||
"free" => { name => 'free' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
@ -204,7 +203,8 @@ sub manage_selection {
|
|||
replication_health => $mapping_health_level{$entry->{properties}->{repHealthLevel}},
|
||||
total => $entry->{properties}->{capacityBytes},
|
||||
used => $entry->{properties}->{capacityBytes} - $entry->{properties}->{freeBytes},
|
||||
dedup => $entry->{properties}->{dedupeRatio} };
|
||||
dedup => $entry->{properties}->{dedupeRatio}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue