Fix versa (#2313)
This commit is contained in:
parent
0440d7d632
commit
04cc894573
|
@ -341,39 +341,44 @@ sub manage_selection {
|
||||||
device_health => {}
|
device_health => {}
|
||||||
};
|
};
|
||||||
|
|
||||||
my $total = centreon::plugins::misc::convert_bytes(
|
my ($total, $free);
|
||||||
value => $device->{Hardware}->{memory},
|
if (defined($device->{Hardware}->{memory})) {
|
||||||
pattern => '([0-9\.]+)(.*)$'
|
$total = centreon::plugins::misc::convert_bytes(
|
||||||
);
|
value => $device->{Hardware}->{memory},
|
||||||
my $free = centreon::plugins::misc::convert_bytes(
|
pattern => '([0-9\.]+)(.*)$'
|
||||||
value => $device->{Hardware}->{freeMemory},
|
);
|
||||||
pattern => '([0-9\.]+)(.*)$'
|
$free = centreon::plugins::misc::convert_bytes(
|
||||||
);
|
value => $device->{Hardware}->{freeMemory},
|
||||||
$self->{devices}->{ $device->{name} }->{device_memory} = {
|
pattern => '([0-9\.]+)(.*)$'
|
||||||
display => $device->{name},
|
);
|
||||||
total => $total,
|
$self->{devices}->{ $device->{name} }->{device_memory} = {
|
||||||
free => $free,
|
display => $device->{name},
|
||||||
used => $total - $free,
|
total => $total,
|
||||||
prct_used => 100 - ($free * 100 / $total),
|
free => $free,
|
||||||
prct_free => ($free * 100 / $total)
|
used => $total - $free,
|
||||||
};
|
prct_used => 100 - ($free * 100 / $total),
|
||||||
|
prct_free => ($free * 100 / $total)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
$total = centreon::plugins::misc::convert_bytes(
|
if (defined($device->{Hardware}->{diskSize})) {
|
||||||
value => $device->{Hardware}->{diskSize},
|
$total = centreon::plugins::misc::convert_bytes(
|
||||||
pattern => '([0-9\.]+)(.*)$'
|
value => $device->{Hardware}->{diskSize},
|
||||||
);
|
pattern => '([0-9\.]+)(.*)$'
|
||||||
$free = centreon::plugins::misc::convert_bytes(
|
);
|
||||||
value => $device->{Hardware}->{freeDisk},
|
$free = centreon::plugins::misc::convert_bytes(
|
||||||
pattern => '([0-9\.]+)(.*)$'
|
value => $device->{Hardware}->{freeDisk},
|
||||||
);
|
pattern => '([0-9\.]+)(.*)$'
|
||||||
$self->{devices}->{ $device->{name} }->{device_disk} = {
|
);
|
||||||
display => $device->{name},
|
$self->{devices}->{ $device->{name} }->{device_disk} = {
|
||||||
total => $total,
|
display => $device->{name},
|
||||||
free => $free,
|
total => $total,
|
||||||
used => $total - $free,
|
free => $free,
|
||||||
prct_used => 100 - ($free * 100 / $total),
|
used => $total - $free,
|
||||||
prct_free => ($free * 100 / $total)
|
prct_used => 100 - ($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…
Reference in New Issue