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:
parent
9242489157
commit
4f98c4c950
|
@ -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>
|
2007-09-07 Raul Mateos <raulofpandora@gmail.com>
|
||||||
|
|
||||||
* installer/Pandora_Windows_Agent-1.3.0 Beta2-Setup.exe: Updated
|
* installer/Pandora_Windows_Agent-1.3.0 Beta2-Setup.exe: Updated
|
||||||
|
|
Binary file not shown.
|
@ -62,7 +62,7 @@ Pandora_Wmi::isProcessRunning (string process_name) {
|
||||||
string query;
|
string query;
|
||||||
|
|
||||||
query = "SELECT * FROM Win32_Process WHERE Name=\"" + process_name + "\"";
|
query = "SELECT * FROM Win32_Process WHERE Name=\"" + process_name + "\"";
|
||||||
cout << "Query: " << query << endl;
|
|
||||||
try {
|
try {
|
||||||
dhCheck (dhGetObject (getWmiStr (L"."), NULL, &wmi_svc));
|
dhCheck (dhGetObject (getWmiStr (L"."), NULL, &wmi_svc));
|
||||||
dhCheck (dhGetValue (L"%o", &quickfixes, wmi_svc,
|
dhCheck (dhGetValue (L"%o", &quickfixes, wmi_svc,
|
||||||
|
@ -93,6 +93,7 @@ Pandora_Wmi::isServiceRunning (string service_name) {
|
||||||
CDispPtr wmi_svc, quickfixes;
|
CDispPtr wmi_svc, quickfixes;
|
||||||
string query;
|
string query;
|
||||||
char *state;
|
char *state;
|
||||||
|
string str_state;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
query = "SELECT * FROM Win32_Service WHERE Name = \"" + service_name + "\"";
|
query = "SELECT * FROM Win32_Service WHERE Name = \"" + service_name + "\"";
|
||||||
|
@ -106,8 +107,8 @@ Pandora_Wmi::isServiceRunning (string service_name) {
|
||||||
FOR_EACH (quickfix, quickfixes, NULL) {
|
FOR_EACH (quickfix, quickfixes, NULL) {
|
||||||
dhGetValue (L"%s", &state, quickfix,
|
dhGetValue (L"%s", &state, quickfix,
|
||||||
L".State");
|
L".State");
|
||||||
|
str_state = state;
|
||||||
retval = (state == "Running") ? 1 : 0;
|
retval = (str_state == "Running") ? 1 : 0;
|
||||||
dhFreeString (state);
|
dhFreeString (state);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -210,8 +211,6 @@ Pandora_Wmi::getCpuUsagePercentage (int cpu_id) {
|
||||||
return load_percentage;
|
return load_percentage;
|
||||||
} NEXT_THROW (quickfix);
|
} NEXT_THROW (quickfix);
|
||||||
} catch (string errstr) {
|
} catch (string errstr) {
|
||||||
cout << query << endl;
|
|
||||||
cout << errstr << endl;
|
|
||||||
pandoraLog ("getCpuUsagePercentage error. %s", errstr.c_str ());
|
pandoraLog ("getCpuUsagePercentage error. %s", errstr.c_str ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue