Am I able to show a SNMP OID in a custom field? I’ve tried but it doesn’t seem to be working.
Is there a custom field? I didn’t know…
What I do is create a disabled queue and change it’s name to number value I want to read via snmp. It works with Cacti (perhaps because it’s written in PHP)
Could you give some instructions on how to do this?
Example (instead of queues you could create vlan interfaces or anything else that has name OID you can change via script):
Queues:
2 X ;;; Stat1
name="38.00" dst-address=0.0.0.0/0 interface=all parent=none
direction=both priority=8 queue=default-small/default-small
limit-at=0/0 max-limit=0/0 burst-limit=0/0 burst-threshold=0/0
burst-time=0s/0s total-queue=default-small
3 X ;;; Stat2
name="20.000" dst-address=0.0.0.0/0 interface=all parent=none
direction=both priority=8 queue=default-small/default-small
limit-at=0/0 max-limit=0/0 burst-limit=0/0 burst-threshold=0/0
burst-time=0s/0s total-queue=default-small
Script:
{
:local $stat1;
:local $stat2;
<some code that assigns value to above vars>
/queue simple set numbers=2 name=($stat1 . ".000");
/queue simple set numbers=3 name=($stat2 . ".00");}
“.000” and “.00” are needed so stat1=stat2 names are different to ROS.
to find out oid that you’ll plug in to your SNMP monitoring software:
/queue simple print oid
2 X ;;; Stat1
name=.1.3.6.1.4.1.14988.1.1.2.1.1.2.4
bytes-in=.1.3.6.1.4.1.14988.1.1.2.1.1.8.4
bytes-out=.1.3.6.1.4.1.14988.1.1.2.1.1.9.4
packets-in=.1.3.6.1.4.1.14988.1.1.2.1.1.10.4
packets-out=.1.3.6.1.4.1.14988.1.1.2.1.1.11.4
3 X ;;; Stat2
name=.1.3.6.1.4.1.14988.1.1.2.1.1.2.5
bytes-in=.1.3.6.1.4.1.14988.1.1.2.1.1.8.5
bytes-out=.1.3.6.1.4.1.14988.1.1.2.1.1.9.5
packets-in=.1.3.6.1.4.1.14988.1.1.2.1.1.10.5
packets-out=.1.3.6.1.4.1.14988.1.1.2.1.1.11.5