2008-07-31 Ramon Novoa <rnovoa@artica.es>

* 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".




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@989 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2008-07-31 10:31:58 +00:00
parent a1484deff0
commit f963e9813d
4 changed files with 21 additions and 8 deletions

View File

@ -1,3 +1,11 @@
2008-07-31 Ramon Novoa <rnovoa@artica.es>
* 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 <rnovoa@artica.es>
* win32/windows/pandora_wmi.cc: Fixed typo bug.

View File

@ -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;
}

View File

@ -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 ();

View File

@ -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);