From a3f8dc64998f888ab3a5b89de277cf662882bd12 Mon Sep 17 00:00:00 2001 From: Matt Peterson Date: Wed, 21 Oct 2020 17:39:06 -0700 Subject: [PATCH] Clarify non-x86 hardware info sources for snmpd (#12253) * Clarify non-x86 hardware info sources for snmpd * Clarify that ARM platforms use device tree, not SMBIOS _(maybe consider a wrapper script for this too?)_ * Non-GPS based systems can also provide lat & lon, such as Galileo or Beidou * Clarify that Distro means Distribution * Update SNMP-Configuration-Examples.md --- doc/Support/SNMP-Configuration-Examples.md | 7 +++++++ snmpd.conf.example | 14 ++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/Support/SNMP-Configuration-Examples.md b/doc/Support/SNMP-Configuration-Examples.md index 54bfc53b92..f31691b1c8 100644 --- a/doc/Support/SNMP-Configuration-Examples.md +++ b/doc/Support/SNMP-Configuration-Examples.md @@ -380,6 +380,13 @@ is mode 0400. One solution is to include `@reboot chmod 444 /sys/devices/virtual/dmi/id/product_serial` in the crontab for root or equivalent. +Non-x86 or SMBIOS-based systems, such as ARM-based Raspberry Pi units should +query device tree locations for this metadata, for example: +``` +extend hardware '/bin/cat /sys/firmware/devicetree/base/model' +extend serial '/bin/cat /sys/firmware/devicetree/base/serial-number' +``` + The LibreNMS server include a copy of this example here: ``` diff --git a/snmpd.conf.example b/snmpd.conf.example index 51d4adc50a..be8e303cd1 100644 --- a/snmpd.conf.example +++ b/snmpd.conf.example @@ -5,12 +5,18 @@ group MyROGroup v2c readonly view all included .1 80 access MyROGroup "" any noauth exact all none none -syslocation Rack, Room, Building, City, Country [GPSX,Y] +syslocation Rack, Room, Building, City, Country [Lat, Lon] syscontact Your Name -#Distro Detection +#OS Distribution Detection extend distro /usr/bin/distro -#Hardware Detection (uncomment to enable) -#extend hardware '/bin/cat /sys/devices/virtual/dmi/id/product_name' + +#Hardware Detection +# (uncomment for x86 platforms) #extend manufacturer '/bin/cat /sys/devices/virtual/dmi/id/sys_vendor' +#extend hardware '/bin/cat /sys/devices/virtual/dmi/id/product_name' #extend serial '/bin/cat /sys/devices/virtual/dmi/id/product_serial' + +# (uncomment for ARM platforms) +#extend hardware '/bin/cat /sys/firmware/devicetree/base/model' +#extend serial '/bin/cat /sys/firmware/devicetree/base/serial-number'