2007-09-06 Esteban Sanchez <estebans@artica.es>

* windows/pandora_wmi.cc: Fixed an error when detecting running
        services. Removed unuseful output.

        * bin/PandoraAgent.exe: Updated to last commit.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@652 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Esteban Sanchez 2007-09-11 16:47:26 +00:00
parent 15093c2bb1
commit f09e5b0cf8
3 changed files with 13 additions and 7 deletions

View File

@ -1,3 +1,10 @@
2007-09-11 Esteban Sanchez <estebans@artica.es>
* windows/pandora_wmi.cc: Fixed an error when detecting running
services. Removed unuseful output.
* bin/PandoraAgent.exe: Updated to last commit.
2007-09-07 Raul Mateos <raulofpandora@gmail.com>
* installer/Pandora_Windows_Agent-1.3.0 Beta2-Setup.exe: Updated

View File

@ -62,7 +62,7 @@ Pandora_Wmi::isProcessRunning (string process_name) {
string query;
query = "SELECT * FROM Win32_Process WHERE Name=\"" + process_name + "\"";
cout << "Query: " << query << endl;
try {
dhCheck (dhGetObject (getWmiStr (L"."), NULL, &wmi_svc));
dhCheck (dhGetValue (L"%o", &quickfixes, wmi_svc,
@ -93,6 +93,7 @@ Pandora_Wmi::isServiceRunning (string service_name) {
CDispPtr wmi_svc, quickfixes;
string query;
char *state;
string str_state;
int retval;
query = "SELECT * FROM Win32_Service WHERE Name = \"" + service_name + "\"";
@ -106,10 +107,10 @@ Pandora_Wmi::isServiceRunning (string service_name) {
FOR_EACH (quickfix, quickfixes, NULL) {
dhGetValue (L"%s", &state, quickfix,
L".State");
retval = (state == "Running") ? 1 : 0;
str_state = state;
retval = (str_state == "Running") ? 1 : 0;
dhFreeString (state);
return retval;
} NEXT_THROW (quickfix);
} catch (string errstr) {
@ -166,7 +167,7 @@ Pandora_Wmi::getDiskFreeSpace (string disk_id) {
} catch (Pandora_Exception e) {
throw Pandora_Wmi_Exception ();
}
return space / 1024 / 1024;
} NEXT_THROW (quickfix);
} catch (string errstr) {
@ -210,8 +211,6 @@ Pandora_Wmi::getCpuUsagePercentage (int cpu_id) {
return load_percentage;
} NEXT_THROW (quickfix);
} catch (string errstr) {
cout << query << endl;
cout << errstr << endl;
pandoraLog ("getCpuUsagePercentage error. %s", errstr.c_str ());
}