Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-23049

Macro {ITEM.LOG.TIME} is expanded when macro {ITEM.LOG.xxxxxxxxx} is misspelled.

XMLWordPrintable

    • Sprint 102 (Jul 2023)
    • 0.125

      When macro {ITEM.LOG.SEVERITY} was wrongly set to macro {ITEM.LOG.SERVERITY}, the time was displayed.

      Below is the 6.0 source, with an else at the end, which is determined to be the macro {ITEM.LOG.TIME}.

      static int	get_history_log_value(const char *m, const DB_TRIGGER *trigger, char **replace_to, int N_functionid,
      		int clock, int ns, const char *tz)
      {
      	zbx_uint64_t	itemid;
      	int		ret, request;
      	if (0 == strcmp(m, MVAR_ITEM_LOG_AGE))
      	{
      		request = ZBX_REQUEST_ITEM_LOG_AGE;
      	}
      	else if (0 == strcmp(m, MVAR_ITEM_LOG_DATE))
      	{
      		request = ZBX_REQUEST_ITEM_LOG_DATE;
      	}
      	else if (0 == strcmp(m, MVAR_ITEM_LOG_EVENTID))
      	{
      		request = ZBX_REQUEST_ITEM_LOG_EVENTID;
      	}
      	else if (0 == strcmp(m, MVAR_ITEM_LOG_NSEVERITY))
      	{
      		request = ZBX_REQUEST_ITEM_LOG_NSEVERITY;
      	}
      	else if (0 == strcmp(m, MVAR_ITEM_LOG_SEVERITY))
      	{
      		request = ZBX_REQUEST_ITEM_LOG_SEVERITY;
      	}
      	else if (0 == strcmp(m, MVAR_ITEM_LOG_SOURCE))
      	{
      		request = ZBX_REQUEST_ITEM_LOG_SOURCE;
      	}
      	else	/* MVAR_ITEM_LOG_TIME */
      		request = ZBX_REQUEST_ITEM_LOG_TIME;
      	zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __func__);
      
      
      
      	if (SUCCEED == (ret = zbx_db_trigger_get_itemid(trigger, N_functionid, &itemid)))
      		ret = DBget_history_log_value(itemid, replace_to, request, clock, ns, tz);
      
      	zabbix_log(LOG_LEVEL_DEBUG, "End of %s():%s", __func__, zbx_result_string(ret));
      
      	return ret;
      }
      

            kprutkovs Konstantins Prutkovs
            kazuo.ito Kazuo Ito
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: