2006-07-14 Esteban Sanchez <estebans@artica.es>

* modules/pandora_module_factory.cc: Removed unnecessary debug.

        * windows/pandora_wmi.cc: Removed graphical exceptions to be executed when something happens with disphelper library. Get a string when retrieving the FreeSpace field on getDiskFreeSpace(), it solves a bug when the free space was a huge amount.

        * bin/PandoraAgent.exe: Updated to the new commit.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@138 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Esteban Sanchez 2006-07-17 09:13:46 +00:00
parent 6c9eadf9c5
commit 138bfc06a1
4 changed files with 26 additions and 26 deletions

View File

@ -1,3 +1,14 @@
2006-07-14 Esteban Sanchez <estebans@artica.es>
* modules/pandora_module_factory.cc: Removed unnecessary debug.
* windows/pandora_wmi.cc: Removed graphical exceptions to be executed
when something happens with disphelper library. Get a string when
retrieving the FreeSpace field on getDiskFreeSpace(), it solves a bug
when the free space was a huge amount.
* bin/PandoraAgent.exe: Updated to the new commit.
2006-07-12 Esteban Sanchez <estebans@artica.es>
* modules/pandora_module_freememory.[cc,h]: Added to repository.

View File

@ -147,7 +147,6 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
module_freedisk);
} else if (module_freememory != "") {
pandoraDebug ("Freememory");
module = new Pandora_Module_Freememory (module_name);
} else if (module_cpuusage != "") {

View File

@ -52,8 +52,6 @@ Pandora_Wmi::isProcessRunning (string process_name) {
string name;
int result = 0;
dhToggleExceptions (TRUE);
struct QFix {
CDhStringA name, description, state;
};
@ -91,8 +89,6 @@ Pandora_Wmi::isServiceRunning (string service_name) {
CDispPtr wmi_svc, quickfixes;
string name, state;
dhToggleExceptions (TRUE);
struct QFix {
CDhStringA name, state;
};
@ -136,20 +132,18 @@ long
Pandora_Wmi::getDiskFreeSpace (string disk_id) {
CDhInitialize init;
CDispPtr wmi_svc, quickfixes;
string id;
dhToggleExceptions (TRUE);
string id, space_str;
int space;
struct QFix {
CDhStringA id;
long free_space;
CDhStringA id, free_space;
};
try {
dhCheck (dhGetObject (getWmiStr (L"."), NULL, &wmi_svc));
dhCheck (dhGetValue (L"%o", &quickfixes, wmi_svc,
L".ExecQuery(%S)",
L"SELECT * FROM Win32_LogicalDisk "));
L"SELECT DeviceID, FreeSpace FROM Win32_LogicalDisk "));
FOR_EACH (quickfix, quickfixes, NULL) {
QFix fix = { 0 };
@ -160,10 +154,18 @@ Pandora_Wmi::getDiskFreeSpace (string disk_id) {
id = fix.id;
if (disk_id == id) {
dhGetValue (L"%d", &fix.free_space, quickfix,
dhGetValue (L"%s", &fix.free_space, quickfix,
L".FreeSpace");
return fix.free_space / 1024 / 1024;
space_str = fix.free_space;
try {
space = Pandora_Strutils::strtoint (space_str);
} catch (Pandora_Exception e) {
throw Pandora_Wmi_Error ();
}
return space / 1024 / 1024;
}
} NEXT_THROW (quickfix);
@ -180,8 +182,6 @@ Pandora_Wmi::getCpuUsagePercentage (int cpu_id) {
CDispPtr wmi_svc, quickfixes;
string id, cpu_id_str;
dhToggleExceptions (TRUE);
cpu_id_str = "CPU";
cpu_id_str += Pandora_Strutils::inttostr (cpu_id);
@ -225,8 +225,6 @@ Pandora_Wmi::getFreememory () {
CDhInitialize init;
CDispPtr wmi_svc, quickfixes;
dhToggleExceptions (TRUE);
struct QFix {
long free_memory;
};
@ -258,8 +256,6 @@ Pandora_Wmi::getOSName () {
CDispPtr wmi_svc, quickfixes;
string ret;
dhToggleExceptions (TRUE);
struct QFix {
CDhStringA name, state, description;
};
@ -292,8 +288,6 @@ Pandora_Wmi::getOSVersion () {
CDispPtr wmi_svc, quickfixes;
string ret;
dhToggleExceptions (TRUE);
struct QFix {
CDhStringA name, state, description;
};
@ -325,9 +319,7 @@ Pandora_Wmi::getOSBuild () {
CDhInitialize init;
CDispPtr wmi_svc, quickfixes;
string ret;
dhToggleExceptions (TRUE);
struct QFix {
CDhStringA name, state, description;
};
@ -360,8 +352,6 @@ Pandora_Wmi::getSystemName () {
CDispPtr wmi_svc, quickfixes;
string ret;
dhToggleExceptions (TRUE);
struct QFix {
CDhStringA name, state, description;
};