diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index a367340aba..3c9254e143 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,11 @@ +2008-07-31 Ramon Novoa + + * win32/pandora_windows_service.cc: Small fixes. + * win32/modules/pandora_module.cc: time() and localtime() are used + instead of GetSystemTime(). + * win32/pandora.h: Changed all instances of "Pandora" to + "Pandora FMS". + 2008-07-30 Ramon Novoa * win32/windows/pandora_wmi.cc: Fixed typo bug. diff --git a/pandora_agents/win32/modules/pandora_module.cc b/pandora_agents/win32/modules/pandora_module.cc index dbd897f645..eaadd126b0 100644 --- a/pandora_agents/win32/modules/pandora_module.cc +++ b/pandora_agents/win32/modules/pandora_module.cc @@ -318,7 +318,7 @@ Pandora_Module::getXml () { pandoraDebug ("%s getXML begin", module_name.c_str ()); - if (!this->has_output || (this->data_list && this->data_list->size () < 1)) { + if (!this->has_output || this->data_list == NULL) { return NULL; } diff --git a/pandora_agents/win32/pandora.h b/pandora_agents/win32/pandora.h index a34cdbe5e1..37447bb6ee 100644 --- a/pandora_agents/win32/pandora.h +++ b/pandora_agents/win32/pandora.h @@ -51,9 +51,9 @@ namespace Pandora { }; static const HKEY hkey = HKEY_LOCAL_MACHINE; - const char * const name = "PandoraAgent"; - const char * const display_name = "Pandora agent"; - const char * const description = "The Pandora Agent service"; + const char * const name = "PandoraFMSAgent"; + const char * const display_name = "Pandora FMS agent"; + const char * const description = "The Pandora FMS Agent service"; void setPandoraInstallDir (string dir); string getPandoraInstallDir (); diff --git a/pandora_agents/win32/pandora_windows_service.cc b/pandora_agents/win32/pandora_windows_service.cc index 361dd07687..bad9f92c5c 100644 --- a/pandora_agents/win32/pandora_windows_service.cc +++ b/pandora_agents/win32/pandora_windows_service.cc @@ -144,9 +144,10 @@ Pandora_Windows_Service::pandora_init () { TiXmlElement * Pandora_Windows_Service::getXmlHeader () { TiXmlElement *agent; - SYSTEMTIME st; char timestamp[20]; string value; + time_t ctime; + struct tm *ctime_tm = NULL; agent = new TiXmlElement ("agent_data"); @@ -158,9 +159,13 @@ Pandora_Windows_Service::getXmlHeader () { agent->SetAttribute ("version", getPandoraAgentVersion ()); - GetSystemTime(&st); - sprintf (timestamp, "%d-%02d-%02d %02d:%02d:%02d", st.wYear, st.wMonth, st.wDay, - st.wHour, st.wMinute, st.wSecond); + // Get current time + ctime = time(0); + ctime_tm = localtime(&ctime); + + sprintf (timestamp, "%d-%02d-%02d %02d:%02d:%02d", ctime_tm->tm_year + 1900, + ctime_tm->tm_mon + 1, ctime_tm->tm_mday, ctime_tm->tm_hour, + ctime_tm->tm_min, ctime_tm->tm_sec); agent->SetAttribute ("timestamp", timestamp);