The manual is very confusing about macros in LLD:
"The OIDs to discover are defined in SNMP OID field in the following format:
where {#MACRO1}, {#MACRO2} … are valid lld macro names and oid1, oid2… are OIDs capable of generating meaningful values for these macros. A built-in macro {#SNMPINDEX} containing index of the discovered OID is applied to discovered entities. The discovered entities are grouped by {#SNMPINDEX} macro value."
This is obvious. However, the problems start at this page where the manual talks about #SNMPVALUE macro. There is no other mention in the manual for 3.4 but in manual for 2.4 I found:
"Also, unlike the previous examples, this discovery item will generate two macros for each discovered entity: {#SNMPINDEX} and {#SNMPVALUE}.”
Apparently, these two macros are autogenerated and it is not necessary to put them explicitly into the discovery, but, when one looks at the template Template Module Interfaces SNMPv2, one can see the discovery is:
So SNMPVALUE seems to get the values of all entities under 1.3.6.1.2.1.2.2.1.8, in this case, those would be up,down etc... The question which bothered me initially was why would someone choose ifOperStatus to put snmp values to... Anyway, more interesting is the question, what is assigned to SNMPVALUE when it is no mentioned in discovery and one uses multiple macros/oids like eg:
?
And another one, can I use SNMPINDEX explicitly, such as:
?
"The OIDs to discover are defined in SNMP OID field in the following format:
Code:
discovery[{#MACRO1}, oid1, {#MACRO2}, oid2, …,]
This is obvious. However, the problems start at this page where the manual talks about #SNMPVALUE macro. There is no other mention in the manual for 3.4 but in manual for 2.4 I found:
"Also, unlike the previous examples, this discovery item will generate two macros for each discovered entity: {#SNMPINDEX} and {#SNMPVALUE}.”
Apparently, these two macros are autogenerated and it is not necessary to put them explicitly into the discovery, but, when one looks at the template Template Module Interfaces SNMPv2, one can see the discovery is:
Code:
discovery[{#SNMPVALUE},1.3.6.1.2.1.2.2.1.8,{#IFADMINSTATUS},1.3.6.1.2.1.2.2.1.7,{#IFALIAS},1.3.6.1.2.1.31.1.1.1.18,{#IFNAME},1.3.6.1.2.1.31.1.1.1.1,{#IFDESCR},1.3.6.1.2.1.2.2.1.2,{#IFTYPE},1.3.6.1.2.1.2.2.1.3]
Code:
discovery[{#IFADMINSTATUS},1.3.6.1.2.1.2.2.1.7,{#IFALIAS},1.3.6.1.2.1.31.1.1.1.18,{#IFNAME},1.3.6.1.2.1.31.1.1.1.1,{#IFDESCR},1.3.6.1.2.1.2.2.1.2,{#IFTYPE},1.3.6.1.2.1.2.2.1.3]
And another one, can I use SNMPINDEX explicitly, such as:
Code:
discovery[{#SNMPINDEX},1.3.6.1.2.1.2.2.1.8,{#SNMPVALUE},1.3.6.1.2.1.2.2.1.8,{#IFADMINSTATUS},1.3.6.1.2.1.2.2.1.7,{#IFALIAS},1.3.6.1.2.1.31.1.1.1.18,{#IFNAME},1.3.6.1.2.1.31.1.1.1.1,{#IFDESCR},1.3.6.1.2.1.2.2.1.2,{#IFTYPE},1.3.6.1.2.1.2.2.1.3]