#12681 added decimals in module windows
This commit is contained in:
parent
cf500b6843
commit
139b924410
|
@ -3132,7 +3132,7 @@ sub module_freepercentdisk ($) {
|
||||||
|
|
||||||
return () unless defined ($Parts{$module->{'params'}}) and defined ($Parts{$module->{'params'}}{'avail'});
|
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);
|
return ($availp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ Pandora_Wmi::getDiskFreeSpace (string disk_id) {
|
||||||
* @exception Pandora_Wmi_Exception Throwd if an error occured when reading
|
* @exception Pandora_Wmi_Exception Throwd if an error occured when reading
|
||||||
* from WMI database.
|
* from WMI database.
|
||||||
*/
|
*/
|
||||||
unsigned long
|
double
|
||||||
Pandora_Wmi::getDiskFreeSpacePercent (string disk_id) {
|
Pandora_Wmi::getDiskFreeSpacePercent (string disk_id) {
|
||||||
CDhInitialize init;
|
CDhInitialize init;
|
||||||
CDispPtr wmi_svc, quickfixes;
|
CDispPtr wmi_svc, quickfixes;
|
||||||
|
@ -202,7 +202,7 @@ Pandora_Wmi::getDiskFreeSpacePercent (string disk_id) {
|
||||||
dhCheck (dhGetValue (L"%o", &quickfixes, wmi_svc,
|
dhCheck (dhGetValue (L"%o", &quickfixes, wmi_svc,
|
||||||
L".ExecQuery(%T)",
|
L".ExecQuery(%T)",
|
||||||
query.c_str ()));
|
query.c_str ()));
|
||||||
|
|
||||||
FOR_EACH (quickfix, quickfixes, NULL) {
|
FOR_EACH (quickfix, quickfixes, NULL) {
|
||||||
dhGetValue (L"%e", &free_space, quickfix,
|
dhGetValue (L"%e", &free_space, quickfix,
|
||||||
L".FreeSpace");
|
L".FreeSpace");
|
||||||
|
@ -213,7 +213,7 @@ Pandora_Wmi::getDiskFreeSpacePercent (string disk_id) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (unsigned long) (free_space * 100 / size);
|
return (free_space * 100 / size);
|
||||||
} NEXT_THROW (quickfix);
|
} NEXT_THROW (quickfix);
|
||||||
} catch (string errstr) {
|
} catch (string errstr) {
|
||||||
pandoraLog ("getDiskFreeSpace error. %s", errstr.c_str ());
|
pandoraLog ("getDiskFreeSpace error. %s", errstr.c_str ());
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace Pandora_Wmi {
|
||||||
int isProcessRunning (string process_name);
|
int isProcessRunning (string process_name);
|
||||||
int isServiceRunning (string service_name);
|
int isServiceRunning (string service_name);
|
||||||
unsigned long getDiskFreeSpace (string disk_id);
|
unsigned long getDiskFreeSpace (string disk_id);
|
||||||
unsigned long getDiskFreeSpacePercent (string disk_id);
|
double getDiskFreeSpacePercent (string disk_id);
|
||||||
int getCpuUsagePercentage (int cpu_id);
|
int getCpuUsagePercentage (int cpu_id);
|
||||||
long getFreememory ();
|
long getFreememory ();
|
||||||
long getFreememoryPercent ();
|
long getFreememoryPercent ();
|
||||||
|
|
Loading…
Reference in New Issue