Specify community id in discovery

Hi Guys,
Quite new to Librenms and programming, seen other info on community’s hoping mine question is a bit easier.

Working on a new carrier wireless device with multiple modems and RFU’s, to get stats of each they use community.x, is there a way to address this in the yaml discovery file ? either physically providing community string and id or by acquired device community ?

Once i have sorted this and a few other items out then tested for a week or two i will then submit

oid: oduRSSI
community: $community.1
num_oid: ‘.1.3.6.1.4.1.xx.xx.xx.1.3.1.9.1’
descr: ODU RX Signal Level
index: ‘oduRSSI.1’
group: ‘Modem 1’

oid: oduRSSI
community: $community.2
num_oid: ‘.1.3.6.1.4.1.xx.xx.xx.1.3.1.9.1’
descr: ODU RX Signal Level
index: ‘oduRSSI.2’
group: ‘Modem 2’

I don’t know for sure (and can’t find any examples) of doing this in yaml, but have a look at the Routeros.php file which implements wireless stats via PHP code for some possible ideas: librenms/Routeros.php at e8bcbfd9446bb58866cf6efe05834932e29291a5 · librenms/librenms · GitHub

I know about this as I had to revert to PHP code as a workaround for mempools on a Siemens device below TL;DR there was an SNMP table but it was not a real table, just a random collection of unrelated device stats: librenms/Scalance.php at e8bcbfd9446bb58866cf6efe05834932e29291a5 · librenms/librenms · GitHub

Without an example to judge from I can’t be much more help but the App\Models\Device librenms/Device.php at 32f1ce494ee3867871eb8847e612d4f814492b98 · librenms/librenms · GitHub has a community fillable, so you should be able to get at that info somehow.

Thanks for the information, i have very little idea on writing PHP at the minute, something new to learn maybe. Here is an example of the RFU signal level and temperature, this unit has 4 * RFU’s and modems. If i configured multiple sensors and could specify say $community.2 or $community.3 in the yaml the problem would be solved, get the device configured community and add .x

RFU (ODU) RSSI divide -10
ralph@trap-monitor:/opt/librenms$ snmpget -v2c 172.16.250.13 1.3.6.1.4.1.xxx.xxx.xx.4.1.3.1 -c public
iso.3.6.1.4.1.xxx.xxx.xx.4.1.3.1 = INTEGER: 497 (Same as public.3)
ralph@trap-monitor:/opt/librenms$ snmpget -v2c 172.16.250.13 1.3.6.1.4.1.xxx.xxx.xx.4.1.3.1 -c public.1
iso.3.6.1.4.1.xxx.xxx.xx.4.1.3.1 = INTEGER: 470
ralph@trap-monitor:/opt/librenms$ snmpget -v2c 172.16.250.13 1.3.6.1.4.1.xxx.xxx.xx.4.1.3.1 -c public.2
iso.3.6.1.4.1.xxx.xxx.xx.4.1.3.1 = INTEGER: 451
ralph@trap-monitor:/opt/librenms$ snmpget -v2c 172.16.250.13 1.3.6.1.4.1.xxx.xxx.xx.4.1.3.1 -c public.3
iso.3.6.1.4.1.xxx.xxx.xx.4.1.3.1 = INTEGER: 501
ralph@trap-monitor:/opt/librenms$ snmpget -v2c 172.16.250.13 1.3.6.1.4.1.xxx.xxx.xx.4.1.3.1 -c public.4
iso.3.6.1.4.1.xxx.xxx.xx.4.1.3.1 = INTEGER: 482

RFU (ODU) Temperature - divide 10
ralph@trap-monitor:/opt/librenms$ snmpget -v2c 172.16.250.13 1.3.6.1.4.1.xxx.xxx.xx.2.4.1.2.1 -c public
iso.3.6.1.4.1.xxx.xxx.xx.2.4.1.2.1 = INTEGER: 264 (Same as odu 3 - public.3)
ralph@trap-monitor:/opt/librenms$ snmpget -v2c 172.16.250.13 1.3.6.1.4.1.xxx.xxx.xx.4.1.2.1 -c public.1
iso.3.6.1.4.1.xxx.xxx.xx.2.4.1.2.1 = INTEGER: 261
ralph@trap-monitor:/opt/librenms$ snmpget -v2c 172.16.250.13 1.3.6.1.4.1.xxx.xxx.xx.4.1.2.1 -c public.2
iso.3.6.1.4.1.xxx.xxx.xx.2.4.1.2.1 = INTEGER: 258
ralph@trap-monitor:/opt/librenms$ snmpget -v2c 172.16.250.13 1.3.6.1.4.1.xxx.xxx.xx.4.1.2.1 -c public.3
iso.3.6.1.4.1.xxx.xxx.xx.2.4.1.2.1 = INTEGER: 264
ralph@trap-monitor:/opt/librenms$ snmpget -v2c 172.16.250.13 1.3.6.1.4.1.xxx.xxx.xx.4.1.2.1 -c public.4
iso.3.6.1.4.1.xxx.xxx.xx.2.4.1.2.1 = INTEGER: 284

Look into something called snmp context in the code base. It is snmpv3 context + appending a string to the community for older versions of snmp. It is not exposed to yaml currently.

Thank you, I will look into it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.