Hi all,
I’ve been playing with LibreNMS for a few weeks and it’s been working well so I decided to extend its functionality by turning on some apps. I’ve followed the instructions, I’ve searched this forum but I’ve made no progress.
The apps I’ve turned on so far are Docker and SMART. In my searches I have found the thousands of post from people who haven’t added sudo to the extend line in their snmpd.conf file. I can assure you that it’s there.
steve@intdocker:~$ sudo grep extend /etc/snmp/snmpd.conf
extend osupdate /etc/snmp/osupdate
extend smart /usr/bin/sudo /etc/snmp/smart
extend docker /usr/bin/sudo /etc/snmp/docker-stats.sh
I’ve also added ‘snmp’ and ‘Debian-snmp’ to the sudoers file. At the moment they’re included with ALL=(ALL:ALL) but I’ve tried various other combinations but still get the same result.
The actual problem:
snmpwalk -v 2c -c public 192.168.1.16 .1.3.6.1.4.1.8072.1.3.2.3.1.1.6.100.111.99.107.101
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."docker" = STRING: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
And I can’t finure out why. If I run on the server, for example,
sudo -u Debian-snmp /etc/snmp/docker-stats.py
{"version": 2, "data": [{"container": "pma", "pids": "7", "memory". etc etc etc
So works fine but on the LibreNMS server I get the sudo error. Moreover, the SMART plugin has different behaviour:
steve@intdocker:~$ sudo -u Debian-snmp /etc/snmp/smart
/dev/sda,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,null
/dev/sdb,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,null
steve@intdocker:~$ /etc/snmp/smart
/dev/sda,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,null
/dev/sdb,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,null
steve@intdocker:~$ sudo /etc/snmp/smart
sudo /etc/snmp/smart
WDZG7M2J,0,0,null,null,null,0,0,65540,42,42,null,0,0,0,null,null,0,0,0,0,0,0,0,0,18587
WDZFKH58,0,0,null,null,null,0,0,3,41,41,null,0,0,0,null,null,0,0,0,0,0,0,0,0,21328
So even though sudo -u Debian-snmp works for docker it doesn’t work for SMART. Which doesn’t help me narrow down the problem at all.
I can’t figure out what the correct combination of permissions and configurations are to get this to run. Could someone give me some pointers about what I might have missed or need to double-check?
The server is Ubuntu 22 (as are the servers I’m trying to query).
librenms@librenms:~$ ./validate.php
===========================================
Component | Version
--------- | -------
LibreNMS | 23.2.0-51-g13d8ac222 (2023-04-06T03:05:59+01:00)
DB Schema | 2023_03_14_130653_migrate_empty_user_funcs_to_null (249)
PHP | 8.1.2-1ubuntu2.11
Python | 3.10.6
Database | MariaDB 10.6.12-MariaDB-0ubuntu0.22.04.1
RRDTool | 1.7.2
SNMP | 5.9.1
===========================================
Thanks