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

weird behavior of function count(), numeric items, and empty patterns

XMLWordPrintable

      Let's look at evaluate_COUNT() and the following lines in particular:

      if (NULL != arg2 && '\0' == *arg2 && (0 != numeric_search || OP_LIKE == op))
      	zbx_free(arg2);
      
      ...
      
      for (i = 0; i < values.values_num; i++)
      {
      	if (NULL == arg2 || ...)
      	{
      		count++;
      	}
      }
      

      These lines mean that if we are doing a count() on numeric items and the second argument is empty, we will always count existing values.

      For instance, the following triggers will always fire, regardless of item value:

      {Zabbix server:numeric.count(#1,,eq)} <> 0
      {Zabbix server:numeric.count(#1,,lt)} <> 0
      

            Unassigned Unassigned
            asaveljevs Aleksandrs Saveljevs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: