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.