ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-10248

zabbix[host,,items] and zabbix[host,,items_unsupported] processed by server or proxy?

    Details

      Description

      This issue is about the feature implemented under ZBXNEXT-2760. It introduced two new items: ''zabbix[host,,items]'' and ''zabbix[host,,items_unsupported]''.

      Unfortunately, it is unclear whether these items should be processed by server or proxy, and the specification at https://www.zabbix.org/wiki/Docs/specs/ZBXNEXT-2760 does not touch on the issue.

      For instance, we have the following function in dbconfig.c:

      /******************************************************************************
       *                                                                            *
       * Function: is_item_processed_by_server                                      *
       *                                                                            *
       * ...                                                                        *
       *                                                                            *
       * Comments: list of the items, always processed by server                    *
       *           ,------------------+--------------------------------------,      *
       *           | type             | key                                  |      *
       *           +------------------+--------------------------------------+      *
       *           | Zabbix internal  | zabbix[host,,maintenance]            |      *
       *           | Zabbix internal  | zabbix[proxy,<proxyname>,lastaccess] |      *
       *           | Zabbix aggregate | *                                    |      *
       *           | Calculated       | *                                    |      *
       *           '------------------+--------------------------------------'      *
       *                                                                            *
       ******************************************************************************/
      

      Note that both items are not on the list. However, comments in checks_internal.c say that these items should be processed by Zabbix server:

      else if (0 == strcmp(tmp, "items"))	/* zabbix["host",,"items"] */
      {
      	/* this item is always processed by server */
      	if (NULL != (tmp = get_rparam(&request, 1)) && '\0' != *tmp)
      	{
      		error = zbx_strdup(error, "Invalid second parameter.");
      		goto out;
      	}
      
      	SET_UI64_RESULT(result, DCget_item_count(item->host.hostid));
      }
      else if (0 == strcmp(tmp, "items_unsupported"))	/* zabbix["host",,"items_unsupported"] */
      {
      	/* this item is always processed by server */
      	if (NULL != (tmp = get_rparam(&request, 1)) && '\0' != *tmp)
      	{
      		error = zbx_strdup(error, "Invalid second parameter.");
      		goto out;
      	}
      
      	SET_UI64_RESULT(result, DCget_item_unsupported_count(item->host.hostid));
      }
      

      In addition to this inconsistency, it is a bit unclear which daemon should process these items. On the one hand, they should be processed by proxy, because the proxy may be offline and at that time only proxy knows which items are currently supported and which are not. On the other hand, they should be processed by server, because calculated and aggregate items are not sent to proxy and so proxy does not know about them.

        Activity

        Hide
        Oleksiy Zagorskyi added a comment -

        I'd leave to process them by server, as it's more correct approach.

        Show
        Oleksiy Zagorskyi added a comment - I'd leave to process them by server, as it's more correct approach.
        Hide
        Andris Zeila added a comment -

        Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-10248

        Show
        Andris Zeila added a comment - Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-10248
        Hide
        Aleksandrs Saveljevs added a comment - - edited

        How was it fixed? What was the logic behind the fix?

        Andris Zeila by executing zabbix[host,,items*] on server rather than proxy

        Show
        Aleksandrs Saveljevs added a comment - - edited How was it fixed? What was the logic behind the fix? Andris Zeila by executing zabbix [host,,items*] on server rather than proxy
        Hide
        Aleksandrs Saveljevs added a comment - - edited

        (1) There is the following warning when compiled with clang:

        dbconfig.c:581:73: warning: '&&' within '||' [-Wlogical-op-parentheses]
                                                if (0 != strcmp(arg3, "maintenance") && 0 != strcmp(arg3, "items") &&
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
        dbconfig.c:581:73: note: place parentheses around the '&&' expression to silence this warning
                                                if (0 != strcmp(arg3, "maintenance") && 0 != strcmp(arg3, "items") &&
                                                                                                                   ^
        1 warning generated.
        

        Aleksandrs Saveljevs RESOLVED in r58677.

        Andris Zeila Reviewed, thanks.
        CLOSED

        Show
        Aleksandrs Saveljevs added a comment - - edited (1) There is the following warning when compiled with clang: dbconfig.c:581:73: warning: '&&' within '||' [-Wlogical-op-parentheses] if (0 != strcmp(arg3, "maintenance") && 0 != strcmp(arg3, "items") && ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ dbconfig.c:581:73: note: place parentheses around the '&&' expression to silence this warning if (0 != strcmp(arg3, "maintenance") && 0 != strcmp(arg3, "items") && ^ 1 warning generated. Aleksandrs Saveljevs RESOLVED in r58677. Andris Zeila Reviewed, thanks. CLOSED
        Hide
        Andris Zeila added a comment - - edited

        Released in:

        • pre-3.0.2rc1 r58748
        • pre-3.1.0 r58749
        Show
        Andris Zeila added a comment - - edited Released in: pre-3.0.2rc1 r58748 pre-3.1.0 r58749

          People

          • Assignee:
            Unassigned
            Reporter:
            Aleksandrs Saveljevs
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: