#12681 added decimals in module windows

This commit is contained in:
Daniel Cebrian 2024-01-26 14:01:32 +01:00
parent cf500b6843
commit 139b924410
3 changed files with 5 additions and 5 deletions

View File

@ -3132,7 +3132,7 @@ sub module_freepercentdisk ($) {
return () unless defined ($Parts{$module->{'params'}}) and defined ($Parts{$module->{'params'}}{'avail'});
my $availp = sprintf("%.2f", $Parts{$module->{'params'}}{'avail'} * 100 / $Parts{$module->{'params'}}{'total'});
my $availp = sprintf("%d", $Parts{$module->{'params'}}{'avail'} * 100 / $Parts{$module->{'params'}}{'total'});
return ($availp);
}

View File

@ -188,7 +188,7 @@ Pandora_Wmi::getDiskFreeSpace (string disk_id) {
* @exception Pandora_Wmi_Exception Throwd if an error occured when reading
* from WMI database.
*/
unsigned long
double
Pandora_Wmi::getDiskFreeSpacePercent (string disk_id) {
CDhInitialize init;
CDispPtr wmi_svc, quickfixes;
@ -213,7 +213,7 @@ Pandora_Wmi::getDiskFreeSpacePercent (string disk_id) {
return 0;
}
return (unsigned long) (free_space * 100 / size);
return (free_space * 100 / size);
} NEXT_THROW (quickfix);
} catch (string errstr) {
pandoraLog ("getDiskFreeSpace error. %s", errstr.c_str ());

View File

@ -44,7 +44,7 @@ namespace Pandora_Wmi {
int isProcessRunning (string process_name);
int isServiceRunning (string service_name);
unsigned long getDiskFreeSpace (string disk_id);
unsigned long getDiskFreeSpacePercent (string disk_id);
double getDiskFreeSpacePercent (string disk_id);
int getCpuUsagePercentage (int cpu_id);
long getFreememory ();
long getFreememoryPercent ();