[ZBX-17755] Macros for SNMP agent credentials are not expanded when testing items Created: 2020 May 16  Updated: 2020 May 19  Resolved: 2020 May 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F), Server (S)
Affects Version/s: 5.0.0
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Vince Valenti Assignee: Oleksii Zagorskyi
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 18.04.4, Net-SNMP 5.7.3, PHP 7.2.24


Issue Links:
Duplicate
duplicates ZBX-17394 Test item from UI doesn't work with m... Closed

 Description   

Steps to reproduce:

  1. Configure a host to use a macro for its SNMP community, e.g. {$SNMP_COMMUNITY}.
  2. On the item configuration page, click Test.
  3. Click either the Get value button or the Get value and test button.
  4. You will receive an error message since the macros are not expanded.

Result:

For SNMPv1 and SNMPv2c, the error message is:

Timeout while connecting to "address".

For SNMPv3, the error message is:

Cannot connect to "address": Unknown user name.

Expected:

I would expect this to successfully retrieve the value from the device.

This does work correctly if you specify the SNMP credentials directly on the host object without using macros.

I have captured traffic from the Zabbix server and verified that the SNMPv3 security name, for example, is an empty string.



 Comments   
Comment by Vince Valenti [ 2020 May 16 ]

Oops, I was mistaken about the empty string in the packet capture. It is actually just using the literal {$SNMP_COMMUNITY} or {$SNMP_SECURITYNAME}.

Comment by Oleksii Zagorskyi [ 2020 May 19 ]

Looks like duplicate of ZBX-17394.

Closing.

Generated at Fri Jun 06 20:42:27 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.