2009-09-23 Ramon Novoa <rnovoa@artica.es>

* windows/pandora_wmi.h, modules/pandora_module_inventory.cc: Changed
          the format of the inventory XML.

        * main.cc: Execute the agent and exit when compiled with debugging
          enabled.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1968 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2009-09-23 07:04:04 +00:00
parent b5172144cf
commit 3efe31ea0f
4 changed files with 18 additions and 14 deletions

View File

@ -1,3 +1,11 @@
2009-09-23 Ramon Novoa <rnovoa@artica.es>
* windows/pandora_wmi.h, modules/pandora_module_inventory.cc: Changed
the format of the inventory XML.
* main.cc: Execute the agent and exit when compiled with debugging
enabled.
2009-09-22 Ramon Novoa <rnovoa@artica.es>
* debug_new.h, fast_mutex.h,

View File

@ -132,16 +132,22 @@ main (int argc, char *argv[]) {
return 1;
}
}
#ifdef __DEBUG__
service->pandora_init ();
service->pandora_run ();
#else
if (process) {
cout << "Pandora agent is now running" << endl;
service->pandora_init ();
while (1) {
service->pandora_run ();
Sleep (service->interval / 1000);
Sleep (service->interval * 1000);
}
} else {
service->run ();
}
#endif
delete service;

View File

@ -354,28 +354,18 @@ Pandora_Module_Inventory::getXml() {
inventory_list_element = new TiXmlElement ("datalist");
}
data_element = new TiXmlElement ("data");
element = new TiXmlElement ("value");
try {
data_clean = strreplace (this->getDataOutput (data),
"%", "%%" );
} catch (Output_Error e) {
delete element;
delete data_element;
continue;
}
text = new TiXmlText (data_clean);
element->InsertEndChild (*text);
data_element->InsertEndChild (*element);
data_element->InsertEndChild (*text);
delete text;
delete element;
element = new TiXmlElement ("timestamp");
text = new TiXmlText (data->getTimestamp ());
element->InsertEndChild (*text);
data_element->InsertEndChild (*element);
delete text;
delete element;
inventory_list_element->InsertEndChild (*data_element);
delete data_element;
}

View File

@ -40,7 +40,7 @@ namespace Pandora_Wmi {
*/
class Pandora_Wmi_Exception : public Pandora_Exception { };
const string inventory_field_separator = "#$|$#";
const string inventory_field_separator = ";";
int isProcessRunning (string process_name);
int isServiceRunning (string service_name);
unsigned long getDiskFreeSpace (string disk_id);