I sent this to the mailing list but I have no idea if anyone is still subscribed to it, so I thought I would also post it here. Apologies to anyone who sees it twice!
How do you use the INDEX transform? Rather, once you've done the INDEX transform, how do you use the results?
What I'm trying to do is almost exactly what's in the example. I can get the index I need, but HOW do I use it to look in the ifTable? I thought it was possibly the CHAIN transform but I have been completely
unable to make it work.
Detail on my use case:
I'm attempting to pull light levels off a Juniper router and am having difficulty getting the information I need to display.
The problem is that for 40G & 100G optics there are multiple lanes per interface, so the OID I'm polling is not a one-to-one match with the ifName. (10G optics have a single lane 0.) Here's an example from snmpwalk:
You can see that et-4/0/0 (580) includes 4 lanes, reported as 580.0, 580.1, 580.2, and 580.3
So what I want to do is iterate the ifRxPower OID, and report the ifName and Lane number on each line. I am having a hard time getting the ifName. I know I need to use the INDEX transform to pull out the index.
ifRxIdx : INDEX : {ifRxPower}
This pull out the indices, which in this case are 580.0, 580.1, 580.2, and 580.3
And then I'm using REGSUBs to split the index into the leaf I need to grab out of ifName and the lane number.
This all works as expected, putting the first part of the index in ifRxIfIdx (580, in this example), and the lane numbers (not values) in ifRxLane. The following message file proves this out.
So far so good! However nothing I've tried has allowed me to actually combine the index ifRxIfIdx with the ifName to pull out the correct value. I've tried every combination of CHAIN I can think of, going so far as to actually store the ifName numeric OID value in a repeater variable. This also didn't work. :)
Does anyone have anything similar working in practice or can shed any light on how this works?
Thanks,
Steve
Last edit: SE Weaver 2019-10-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all,
I sent this to the mailing list but I have no idea if anyone is still subscribed to it, so I thought I would also post it here. Apologies to anyone who sees it twice!
How do you use the INDEX transform? Rather, once you've done the INDEX transform, how do you use the results?
The documentation glosses over this:
'INDEX' transform:
What I'm trying to do is almost exactly what's in the example. I can get the index I need, but HOW do I use it to look in the ifTable? I thought it was possibly the CHAIN transform but I have been completely
unable to make it work.
Detail on my use case:
I'm attempting to pull light levels off a Juniper router and am having difficulty getting the information I need to display.
Here is my oids file:
The problem is that for 40G & 100G optics there are multiple lanes per interface, so the OID I'm polling is not a one-to-one match with the ifName. (10G optics have a single lane 0.) Here's an example from snmpwalk:
You can see that et-4/0/0 (580) includes 4 lanes, reported as 580.0, 580.1, 580.2, and 580.3
So what I want to do is iterate the ifRxPower OID, and report the ifName and Lane number on each line. I am having a hard time getting the ifName. I know I need to use the INDEX transform to pull out the index.
ifRxIdx : INDEX : {ifRxPower}This pull out the indices, which in this case are 580.0, 580.1, 580.2, and 580.3
And then I'm using REGSUBs to split the index into the leaf I need to grab out of ifName and the lane number.
This all works as expected, putting the first part of the index in ifRxIfIdx (580, in this example), and the lane numbers (not values) in ifRxLane. The following message file proves this out.
Giving the output
So far so good! However nothing I've tried has allowed me to actually combine the index ifRxIfIdx with the ifName to pull out the correct value. I've tried every combination of CHAIN I can think of, going so far as to actually store the ifName numeric OID value in a repeater variable. This also didn't work. :)
Does anyone have anything similar working in practice or can shed any light on how this works?
Thanks,
Steve
Last edit: SE Weaver 2019-10-10