-
Problem report
-
Resolution: Fixed
-
Trivial
-
5.0.0alpha2
-
None
-
Sprint 62 (Mar 2020)
-
0.125
Steps to reproduce:
- setup zabbix_agent2
- in zabbix_agent2.conf do configuration like HostMetadataItem=system.run[echo myHostMetadataItem]
- 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'