[ZBX-8094] SNMP Macro replace issue Created: 2014 Apr 15  Updated: 2017 May 30  Resolved: 2014 Apr 16

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 2.2.2
Fix Version/s: None

Type: Incident report Priority: Minor
Reporter: Little Martian Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: macro, oid, snmp
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Red Hat Enterprise Linux 5, Zabbix 2.2.1 (revision 40808)


Attachments: XML File zbx_export_hosts.xml     XML File zbx_export_templates.xml    

 Description   

I'm trying to monitor some SNMP items using Template level macros combined with item level values. When server replaces macros, some values appear in the generated oid string that are not referrence anywere.

Example:
Template Macros: {$BASE_OID} -> .1.3.6.1.4.1.11.2.29.2.5.3, {$REAUTHREQ} -> 1.6.0
Item definition: SNMP OID -> {$BASE_OID}.2.{$AUTHREQ} (does not works ok)

Item resulted string should be: .1.3.6.1.4.1.11.2.29.2.5.3.2.1.6.0, actual string: .1.3.6.1.4.1.11.2.29.2.5.3.10.2.1.6.0

Log:
13559:20140415:202340.530 In substitute_key_macros() data:'ReAuthReq-SCP1'
13559:20140415:202340.530 End of substitute_key_macros():SUCCEED data:'ReAuthReq-SCP1'
13559:20140415:202340.530 In substitute_simple_macros() data:'161'
13559:20140415:202340.530 In substitute_simple_macros() data:'public'
13559:20140415:202340.530 In substitute_key_macros() data:'{$BASE_OID}.2.{$REAUTHREQ}'
13557:20140415:202340.530 get value from agent result: '1510657536'
13559:20140415:202340.530 In substitute_simple_macros() data:'{$BASE_OID}.2.{$REAUTHREQ}'
13559:20140415:202340.530 In DCget_user_macro() macro:'{$BASE_OID}'
13557:20140415:202340.530 End of get_value():SUCCEED
13557:20140415:202340.531 In activate_host() hostid:10106 itemid:24880 type:0
13557:20140415:202340.531 End of activate_host()
13559:20140415:202340.530 In DCget_host_macro() macro:'{$BASE_OID}'
13559:20140415:202340.531 In DCget_host_macro() macro:'{$BASE_OID}'
13559:20140415:202340.531 End of DCget_host_macro():SUCCEED
13559:20140415:202340.531 End of DCget_host_macro():SUCCEED
13559:20140415:202340.531 End of DCget_user_macro()
13559:20140415:202340.531 In DCget_user_macro() macro:'{$REAUTHREQ}'
13557:20140415:202340.531 End of get_values():1
13559:20140415:202340.531 In DCget_host_macro() macro:'{$REAUTHREQ}'
13557:20140415:202340.531 In DCconfig_get_poller_nextcheck() poller_type:0
13559:20140415:202340.531 In DCget_host_macro() macro:'{$REAUTHREQ}'
13559:20140415:202340.531 End of DCget_host_macro():SUCCEED
13559:20140415:202340.531 End of DCget_host_macro():SUCCEED
13559:20140415:202340.531 End of DCget_user_macro()
13557:20140415:202340.531 End of DCconfig_get_poller_nextcheck():1397582620
13559:20140415:202340.531 End substitute_simple_macros() data:'.1.3.6.1.4.1.11.2.29.2.5.3.10.2.1.6.0'
13557:20140415:202340.531 In get_values()
13559:20140415:202340.531 End of substitute_key_macros():SUCCEED data:'.1.3.6.1.4.1.11.2.29.2.5.3.10.2.1.6.0'
13557:20140415:202340.531 In DCconfig_get_poller_items() poller_type:0
13559:20140415:202340.531 In get_value() key:'ReAuthReq-SCP1'
13559:20140415:202340.531 In get_value_snmp() key:'ReAuthReq-SCP1' oid:'.1.3.6.1.4.1.11.2.29.2.5.3.10.2.1.6.0'
13559:20140415:202340.531 In zbx_snmp_open_session()
..............



 Comments   
Comment by Aleksandrs Saveljevs [ 2014 Apr 16 ]

It seems incredible to me that Zabbix can append ".10" to {$BASE_OID} out of thin air. Could you please check that this macro is not redefined on the host level or somewhere in downstream templates? If everything seems OK, please export the necessary templates and the host, and attach their XML here.

Comment by Little Martian [ 2014 Apr 16 ]

I have attached the template I created.
One other question: As you can see from the template, I have several instances of the same application installed on the same server. The oid of each counter has an id of the application instantce (the static value in the SNMP oid in the template). It would be helpfull if I could define a macro at application level. Should I open a feature request for this ?

Thank you.

Comment by Little Martian [ 2014 Apr 16 ]

Just as a confirmation, it works OK if I don't use macros to compose the OID (if I put the complete OID).
Also as a confirmation, the wrong oid (.1.3.6.1.4.1.11.2.29.2.5.3.10.2.1.6.0) exists but points to a different counter than the one I'm trying to monitor.

Comment by Aleksandrs Saveljevs [ 2014 Apr 16 ]

Could you please also attach XML for the host? You can remove any sensitive information like its name, IP address or DNS name.

Comment by Little Martian [ 2014 Apr 16 ]

Attached xml.

In the xml you will find referrence to a second SNMP template. That one is a work in progress and at the moment only contains one application defined (no ithems, no graphs etc.).

Comment by Aleksandrs Saveljevs [ 2014 Apr 16 ]

Does the second SNMP template have any macros defined?

Comment by Aleksandrs Saveljevs [ 2014 Apr 16 ]

One other question: As you can see from the template, I have several instances of the same application installed on the same server. The oid of each counter has an id of the application instantce (the static value in the SNMP oid in the template). It would be helpfull if I could define a macro at application level. Should I open a feature request for this ?

Would low-level discovery work for you in this case? For instance, instead of hardcoding static IDs into the OID, let them be discoverable by a script.

Comment by Little Martian [ 2014 Apr 16 ]

Ooops, yes, the second template has the same macro name definition with a different oid (the one with .10).
Unfortunately I do not have the MIBS and a scan of the tree below base oid reveals >1000 ids (counters, properties etc.).

My problem is: I have several applications (same vendor, so most of the base oid is the same) and even several instances of the same application deployed on the same host. I want to monitor some SNMP triggers and SNMP statistics from each instance of each application (each application does different things, all instances of the same application do the same thing). How can I achieve that ?

If I could define a macro at application level, then I could define a base oid for each application and an instance ID and use those macros in the item definition.

So, for this bug I think you can close it, is not a bug, is a duplicate definition of the same macro on different templates attached to the same host. I should define different macro names for each template.

Thanks

Comment by Aleksandrs Saveljevs [ 2014 Apr 16 ]

Thanks for a quick response! Closing the issue as "Won't fix".

Regarding your problem, you might wish to continue the discussion on one of the community channels mentioned at https://www.zabbix.org/wiki/Getting_help .

Generated at Tue Jul 08 08:56:58 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.