List of Queues with Name, Number, and OID

I would like to generate a list of my simple queues and their OIDs. I can do this with:
simple queue print oid

However, this list only provides me the queue number and not the name of the queue. Additionally, I only need to see bytes-in and bytes-out if at all possible.

I can generate a list like this:
:foreach i in=[/queue simple find] do={:global name [/queue simple get $i name]; :put $name;}

But I do not know the command to get the oid of a specific queue.

What I’m looking for is something like this (which obviously doesn’t work):
:foreach i in=[/queue simple find] do={:global name [/queue simple get $i name]; :global oid-bytes-in [/queue simple get $i oid-bytes-in]; :global oid-bytes-out [/queue simple get $i oid-bytes-out]; :put ($name . " " . $oid-bytes-in . " " . $oid-bytes-out);}

Any help would be appreciated!

I’m not sure if I’ll make it back to this thread. I ended up running two simple commands and combining them with perl:

/queue simple print brief
/queue simple print oid

The first command allows me to associate the queue name with an index number.
The second command allows me to associate and index number with an oid.

There doesn’t seem to be any way to query the oid’s based on the queue’s ids. I can only output the entire list.

Not ideal, but it got me what I needed.

I state that it sucks for me to use “print” in scripts…

{
/queue simple
:local itname “”
:local decID 0
:local OIDin “.1.3.6.1.4.1.14988.1.1.2.1.1.8”
:local OIDout “.1.3.6.1.4.1.14988.1.1.2.1.1.9”
:foreach item in=[find] do={
:set itname [get $item name]
:set decID [:tonum (“0x$[:pick $item 1 [:len $item]]”)]
:put “$itname $OIDin.$decID $OIDout.$decID”
}
}
{
/queue simple
:local itname “”
:local search [:toarray “”]
:local OIDin “”
:local OIDout “”
:foreach item in=[find] do={
:set itname [get $item name]
:set search [print oid as-value where .id=$item]
:set OIDin ($search->0->“bytes-in”)
:set OIDout ($search->0->“bytes-out”)
:put “$itname $OIDin $OIDout”
}
}

Thank you rextended, this is perfect!