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

zabbix_agent2 HostMetadata too long

    XMLWordPrintable

    Details

    • Team:
      Team A
    • Sprint:
      Sprint 62 (Mar 2020)
    • Story Points:
      0.125

      Description

      Steps to reproduce:

      1. setup zabbix_agent2
      2. in zabbix_agent2.conf do configuration like HostMetadataItem=system.run[echo myHostMetadataItem]
      3. start zabbix_agent2

      Result:
      We observe in zabbix_agent2.log regularly appearing entries

      2020/02/24 17:11:28.280543 the returned value of "system.run[echo HostMetadataItem]" item specified by "HostMetadataItem" configuration parameter is too long, using first 15 characters 

      Expected:
      the records should not appear

       

      the problem located in serverconnector.go

      if a.HostMetadata, n = agent.CutAfterN(a.HostMetadata, hostMetadataLen); n != hostMetadataLen {
        log.Warningf("the returned value of \"%s\" item specified by \"HostMetadataItem\" configuration parameter"+
        " is too long, using first %d characters", c.options.HostMetadataItem, n)        
      } 

      As proposal - we should return a 'error' from CutAfterN() and check the 'error' instead of 'n != hostMetadataLen'

        Attachments

          Activity

            People

            Assignee:
            esneiders Eriks Sneiders
            Reporter:
            MVekslers Michael Veksler
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: