mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-31 01:24:35 +02:00
Fix versa (#2313)
This commit is contained in:
parent
9a6a5c92a8
commit
546f6c777c
@ -341,11 +341,13 @@ sub manage_selection {
|
|||||||
device_health => {}
|
device_health => {}
|
||||||
};
|
};
|
||||||
|
|
||||||
my $total = centreon::plugins::misc::convert_bytes(
|
my ($total, $free);
|
||||||
|
if (defined($device->{Hardware}->{memory})) {
|
||||||
|
$total = centreon::plugins::misc::convert_bytes(
|
||||||
value => $device->{Hardware}->{memory},
|
value => $device->{Hardware}->{memory},
|
||||||
pattern => '([0-9\.]+)(.*)$'
|
pattern => '([0-9\.]+)(.*)$'
|
||||||
);
|
);
|
||||||
my $free = centreon::plugins::misc::convert_bytes(
|
$free = centreon::plugins::misc::convert_bytes(
|
||||||
value => $device->{Hardware}->{freeMemory},
|
value => $device->{Hardware}->{freeMemory},
|
||||||
pattern => '([0-9\.]+)(.*)$'
|
pattern => '([0-9\.]+)(.*)$'
|
||||||
);
|
);
|
||||||
@ -357,7 +359,9 @@ sub manage_selection {
|
|||||||
prct_used => 100 - ($free * 100 / $total),
|
prct_used => 100 - ($free * 100 / $total),
|
||||||
prct_free => ($free * 100 / $total)
|
prct_free => ($free * 100 / $total)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined($device->{Hardware}->{diskSize})) {
|
||||||
$total = centreon::plugins::misc::convert_bytes(
|
$total = centreon::plugins::misc::convert_bytes(
|
||||||
value => $device->{Hardware}->{diskSize},
|
value => $device->{Hardware}->{diskSize},
|
||||||
pattern => '([0-9\.]+)(.*)$'
|
pattern => '([0-9\.]+)(.*)$'
|
||||||
@ -374,6 +378,7 @@ sub manage_selection {
|
|||||||
prct_used => 100 - ($free * 100 / $total),
|
prct_used => 100 - ($free * 100 / $total),
|
||||||
prct_free => ($free * 100 / $total)
|
prct_free => ($free * 100 / $total)
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
foreach (@{$device->{alarmSummary}->{rows}}) {
|
foreach (@{$device->{alarmSummary}->{rows}}) {
|
||||||
$self->{devices}->{ $device->{name} }->{device_alarms}->{ lc($_->{firstColumnValue}) } = $_->{columnValues}->[0];
|
$self->{devices}->{ $device->{name} }->{device_alarms}->{ lc($_->{firstColumnValue}) } = $_->{columnValues}->[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user