NOTE: If you are looking to configure net-mgmt/net-snmp for the first time, the latest article is Configuration of net-mgmt/net-snmp on FreeBSD.
I wasted a few hours today trying to figure out why special characters in passwords were causing problems. I was chasing the wrong problem.
Conclusion: smart quotes are dumb.
Full disclosure: I should have seen the problem. The problem is not with LibreNMS.
Here is my procedure for creating an snmp read-only user, as provided by zi:
# net-snmp-config --create-snmpv3-user -ro -A "AuthPass" -X "PrivPass" -a SHA -x AES MyROCommunity adding the following line to /var/net-snmp/snmpd.conf: createUser MyROCommunity SHA "AuthPass" AES PrivPass adding the following line to /usr/local/share/snmp/snmpd.conf: rouser MyROCommunity
However, that’s not what I was getting/seeing/doing. I had copied pasted the above into a document which was using smart quotes. Instead of getting the above, I was getting this:
# net-snmp-config --create-snmpv3-user -ro -A “AuthPass” -X “PrivPass” -a SHA -x AES MyROCommunity adding the following line to /var/net-snmp/snmpd.conf: createUser MyROCommunity SHA "“AuthPass”" AES “PrivPass” adding the following line to /usr/local/share/snmp/snmpd.conf: rouser MyROCommunity
The subtle differences are:
- AuthPass is enclosed in a double set of quotes, but PrivPass is not.
- PrivPass is stored as shown.
- AuthPass is stored with the “simple quotes”.
That is, the two statements do not results in the same passwords being stored. This issue led to me suspecting that LibreNMS was not correctly handling special characters (because my first attempts involved password such as PeDptM6!).
After I solved that problem, I was able to get the device added to LibreNMS.
One last problem
I did notice one problem: I am unable to update the SNMP panel for a device which is using snmp v3. See detail in this Google Groups post.
Hello Dan,
are you able to run librenms in a jail? I am not sure because there is not much doku and It does not discover anything … Do you know if you need something special in regard to jail configuration?
thanks
R.
Yes, it can run in a jail. That’s where I have installed mine. I don’t recall anything special.
Hi Dan,
I too am trying to make LibreNMS fully working inside a Truneas 13 jail, by fully I mean that I’ve installed pkg version 24… but let me share my validate.php output:
===========================================
Component | Version
——— | ——-
LibreNMS | 24.12.0 (2024-12-18T00:55:13+01:00)
DB Schema | 2024_11_22_135845_alert_log_refactor_indexes (310)
PHP | 8.3.15
Python | 3.11.11
Database | MySQL 8.0.39
RRDTool | 1.9.0
SNMP | 5.9.4.pre2
===========================================
[OK] Installed from package; no Composer required
[OK] Database connection successful
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQL and PHP time match
[FAIL] Poller is not running. No poller has run within the last 300 seconds.
[WARN] Dispatcher Service has been used, but not recently
[OK] Locks are functional
[FAIL] No active python wrapper pollers found
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok
[FAIL] Scheduler is not running
[FIX]:
sudo sh -c ‘sed “s#/opt/librenms#/usr/local/www/librenms#” /usr/local/www/librenms/dist/librenms-scheduler.cron > /etc/cron.d/librenms-scheduler.cron’
what I cannot work out is how to properly start librenms service ; if I run the command inside a librenms user shell the dispatcher starts and I can see the correct output and devices get polled; if I start with “service librenms start” I have no errors but the service doesn not start, the pidfile get created but it is empty. Permissions seems file: librenms is the owner of the /var/run/librenms directory where the pidfile get created and I’m really out of ideas.
Hope you can somehow point me in the right direction..
Thank you anyway for your really remarkable job in the FreeBSD community!
I’m just going to dump everything I can find here because I don’t see the problem. Don’t make a bunch of changes and see if it works. Make them one by one and restart the service until you find a change. See if we can track down which one fixes it.
First, do not do their suggested FIX – that is Linux-specific.
The port was updated to 25.2.0 yesterday – the package is not built yet: https://www.freshports.org/net-mgmt/librenms/#packages
What do you mean by a “librenms user shell”?
Here is everything running as www in my jail (apart from Apache):
The daemon is what is launched by the script, when then starts/watched over the librenms-service.py process – this is the Poller mentioned above.
Here is my validate:
This is my configuration:
It says no because I can’t get my libernms to start and stay running when the jail restarts. Instead, I do it this way:
That local3 above comes into effect here:
These are the log files:
This is the log rotation:
I hope something in there helps.