Ad Widget

Collapse

PATCH: Correction for Win32 Agent dying uncontrollably. (1.1Beta12)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bcheese
    Junior Member
    • Jun 2006
    • 26

    #1

    PATCH: Correction for Win32 Agent dying uncontrollably. (1.1Beta12)

    There has been discusison on the forum for errors dealing with the retrieving of event logs on Win32 servers. Below is a patch which fixes the error where a NULL is being passed into your ASM strcpy command. This will provide a short term ability to get users working. I have attached a copy of a new binary which has this patch applied.

    Code:
    --- eventlog.cpp	Fri Jun 02 14:04:45 2006
    +++ eventlog.cpp.patch	Fri Jun 02 12:23:13 2006
    @@ -246,12 +246,18 @@
     					MAX_MSG_LENGTH,                     /* maximum size of the message buffer */
     					aInsertStrs);                       /* array of insert strings for the message */
     
    -				strcpy(pMessage,msgBuf);                        // copy message
    -				err = 0;
    +				LOG_DEBUG_INFO("s",msgBuf);
     
    -				/* Free the buffer that FormatMessage allocated for us. */
    -				if(msgBuf) LocalFree((HLOCAL) msgBuf);
    +				if (msgBuf)
    +				{
    +					strcpy(pMessage,msgBuf);                        // copy message
    +					err = 0;
    +
    +					/* Free the buffer that FormatMessage allocated for us. */
    +					LocalFree((HLOCAL) msgBuf);
    +				}
     				FreeLibrary(hLib);
    +
     			}
     		}
    Attached Files
    Last edited by bcheese; 02-06-2006, 06:47.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Many thanks for the patch! Applied.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • RohrbaGe
      Senior Member
      • Aug 2005
      • 167

      #3
      pachted agent

      Hi,

      on my test system 1.1b12 on Suse 9.2 and a Windows 2003 server
      I installed this agent.

      I can confirm, that the agent is not dieing any more direct after start,
      even if I have the hostname=xxx in the config file.

      But the event log is not coming to the zabbix server.

      Restarting of the zabbix_server and/or the agent does not helped


      Regards
      Gerald

      Comment

      Working...