Merge branch 'ent-621-automonitorizacion-del-servidor-usa-comandos-de-otro-sistema-operativo-2' into 'develop'

Fixed disk_free on Windows automonitorization

See merge request artica/pandorafms!1169
This commit is contained in:
vgilc 2017-12-07 16:34:43 +01:00
commit 2031baf2b4
1 changed files with 2 additions and 2 deletions

View File

@ -887,14 +887,14 @@ sub disk_free ($) {
# Check relative path # Check relative path
my $unit; my $unit;
if ($target =~ m/^([a-zA-Z]):/gi) { if ($target =~ m/^([a-zA-Z]):/gi) {
$unit = $1/(1024*1024); $unit = $1;
} else { } else {
return; return;
} }
# Get the free space of unit found # Get the free space of unit found
my $all_disk_info = `wmic logicaldisk get caption, freespace`; my $all_disk_info = `wmic logicaldisk get caption, freespace`;
if ($all_disk_info =~ m/$unit:\D*(\d+)/gmi){ if ($all_disk_info =~ m/$unit:\D*(\d+)/gmi){
return $1; return $1/(1024*1024);
} }
return; return;
} }