mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'ent-12681-16804-anadir-decimales-al-modulo-module_freepercentdisk' into 'develop'
Ent 12681 [#16804]Añadir decimales al modulo module_freepercentdisk See merge request artica/pandorafms!6882
This commit is contained in:
commit
db05fdb341
@ -48,7 +48,7 @@ Pandora_Module_Freedisk_Percent::Pandora_Module_Freedisk_Percent (string name, s
|
|||||||
|
|
||||||
void
|
void
|
||||||
Pandora_Module_Freedisk_Percent::run () {
|
Pandora_Module_Freedisk_Percent::run () {
|
||||||
long res;
|
double res;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Pandora_Module::run ();
|
Pandora_Module::run ();
|
||||||
@ -59,7 +59,7 @@ Pandora_Module_Freedisk_Percent::run () {
|
|||||||
try {
|
try {
|
||||||
res = Pandora_Wmi::getDiskFreeSpacePercent (this->disk_id);
|
res = Pandora_Wmi::getDiskFreeSpacePercent (this->disk_id);
|
||||||
|
|
||||||
this->setOutput (longtostr (res));
|
this->setOutput(std::to_string(res));
|
||||||
} catch (Pandora_Wmi::Pandora_Wmi_Exception e) {
|
} catch (Pandora_Wmi::Pandora_Wmi_Exception e) {
|
||||||
this->has_output = false;
|
this->has_output = false;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
@ -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…
x
Reference in New Issue
Block a user