Agent crashes with item logrt if there are more then 65 log matches in a directory

XMLWordPrintable

    • Type: Problem report
    • Resolution: Fixed
    • Priority: Major
    • None
    • Affects Version/s: 1.8, 1.8.1, 1.8.2
    • Component/s: Agent (G)
    • None
    • Environment:
      RedHat ES 4 and ES 5, MySQL 5.1

      We've had an issue over the weekend where a few hosts that have item "logrt" assigned to them crashed. Looking at the agent log in debug mode, it shows that after the 64th file is processed (for logrt), one of the agent processes die. I noticed there is a hard limit of 64 in this section:
      zabbix_agent\logfiles.c

      /******************************************************************************

      • *
      • Function: init_logfiles *
      • *
      • Purpose: allocates memory for logfiles for the first time *
      • *
      • Parameters: logfiles - pointer to a new list of logfiles *
      • logfiles_alloc - number of logfiles memory was allocated for *
      • logfiles_num - number of already inserted logfiles (0) *
      • *
      • Return value: none *
      • *
      • Author: Dmitry Borovikov *
      • *
      • Comments: Assertion can be deleted later for convenience. *
      • *
        ******************************************************************************/
        static void init_logfiles(struct st_logfile **logfiles, int *logfiles_alloc, int *logfiles_num)
        {
        assert(logfiles && NULL == *logfiles);
        assert(logfiles_alloc && 0 == *logfiles_alloc);
        assert(logfiles_num && 0 == *logfiles_num);

      zabbix_log(LOG_LEVEL_DEBUG, "In init_logfiles()");

      *logfiles_alloc = 64;
      *logfiles = zbx_malloc(*logfiles, *logfiles_alloc * sizeof(struct st_logfile));
      }

      Is there a reason for this limit? I'd increase it, but I fear it would just be masking the issue.

            Assignee:
            Unassigned
            Reporter:
            Dan Rogers
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: