Smart quotes are not so smart: net-snmp-config –create-snmpv3-user for LibreNMS

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:

  1. AuthPass is enclosed in a double set of quotes, but PrivPass is not.
  2. PrivPass is stored as shown.
  3. 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.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

2 thoughts on “Smart quotes are not so smart: net-snmp-config –create-snmpv3-user for LibreNMS”

  1. 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.

Leave a Comment

Scroll to Top