using SNMP Extend to call a python script, I can get the JSON output returned via an snmpwalk of the specific extend, however the values are never input into LibreNMS and as such the charts remain empty.
from LibreNMS
sudo -u Debian-snmp snmpwalk -v 2c -c xxxx x.x.x.x 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."dhcpstats".1'
returns a bunch of errors about unlinked OID in the agent MIB, this is the same output when running as root, or librenms or standard user.
when running from a different client or locally on the dhcp server I have no issues:
─ snmpwalk -v 2c -c home 192.168.1.6 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."dhcpstats".1' [11:14am]
NET-SNMP-EXTEND-MIB::nsExtendOutLine."dhcpstats".1 = STRING: {\"version\": 2, \"error\": 0, \"errorString\": \"\", \"data\": {\"leases\": {\"total\": 66, \"active\": 39, \"expired\": 0, \"released\": 0, \"abandoned\": 0, \"reset\": 0, \"bootp\": 0, \"backup\": 0, \"free\": 66}, \"pools\": [{\"first_ip\": \"192.168.1.50\", \"last_ip\": \"192.168.1.200\", \"max\": \"151\", \"cur\": \"38\", \"percent\": \"25.166\"}], \"networks\": [{\"network\": \"192.168.1.0/24\", \"max\": \"151\", \"cur\": \"38\", \"percent\": \"25.166\"}], \"all_networks\": {\"max\": \"151\", \"cur\": \"38\", \"percent\": \"25.166\"}}}
it looks like there is an issue with SNMP on libreNMS, however if that was the case the other extends that I have would surely not be working too of which at least OSUpdates is, NTP complains that it is unable to draw the charts but that’s another issue all together:
#Distro Detection
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro
#Hardware Detection (uncomment to enable)
extend .1.3.6.1.4.1.2021.7890.2 hardware '/bin/cat /sys/devices/virtual/dmi/id/product_name'
extend .1.3.6.1.4.1.2021.7890.3 manufacturer '/bin/cat /sys/devices/virtual/dmi/id/sys_vendor'
extend .1.3.6.1.4.1.2021.7890.4 serial '/bin/cat /sys/devices/virtual/dmi/id/product_serial'
extend osupdate /etc/snmp/osupdate
extend dhcpstats /usr/bin/python3 /etc/snmp/dhcp.py
extend /etc/snmp/ntp-server.sh