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

zabbix_agent2 HostMetadata too long

XMLWordPrintable

    • Sprint 62 (Mar 2020)
    • 0.125

      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'

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

              Created:
              Updated:
              Resolved: