Skip to content

Extend scripts for snmpd for hardware, manufacturer, and serial#617

Open
Lantizia wants to merge 3 commits intolibrenms:masterfrom
Lantizia:patch-1
Open

Extend scripts for snmpd for hardware, manufacturer, and serial#617
Lantizia wants to merge 3 commits intolibrenms:masterfrom
Lantizia:patch-1

Conversation

@Lantizia
Copy link
Copy Markdown

@Lantizia Lantizia commented Apr 3, 2026

Currently the docs say to do this on x86...

extend distro /usr/bin/distro
extend hardware '/bin/cat /sys/devices/virtual/dmi/id/product_name'
extend manufacturer '/bin/cat /sys/devices/virtual/dmi/id/sys_vendor'
extend serial '/bin/cat /sys/devices/virtual/dmi/id/product_serial'

Or this on ARM...

extend distro /usr/bin/distro
extend hardware '/bin/cat /sys/firmware/devicetree/base/model'
extend serial '/bin/cat /sys/firmware/devicetree/base/serial-number'

But if you weren't paying attention much on ARM you might miss this... and perhaps it's better not to hard code such things like this into the config file itself?

Ultimately the docs already say to download 'distro' from this repo, so what's a few more which can be downloaded at the same time?... these extra scripts have also been written in the same coding style as 'distro' (so if it looks a bit clunky, look elsewhere!) to match it.

My thinking is... using a script which people can easily update might be easier if the way things are determined needs to be updated in the future (with lots of different platforms and CPU architectures)... as people can just update the scripts like they do with the new distributions that come out.

Plus it can do other things like filter out dummy strings. Also I'm not sure, but I've read that devicetree terminates its strings with null bytes? and sometimes this can be an issue with SNMP clients? Perhaps it's not an issue for LibreNMS... but it's that kind of thing we can accommodate for in a script... which is just a bit too unwieldy as a "one liner" in snmpd.conf

Thoughts welcome... I'm not married to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant