Menu

#2371 Putting community into ~/.snmp/snmpapp.conf

closed
nobody
configure (132)
5
2012-11-08
2012-06-14
No

I'm new, and I tried to make it so 'snmpdf' would get its community string from ~/.snmp/snmpapp.conf.

The documentation for how to do this is hard to find; it's not mentioned in snmpdf. Tracking down the answer took a day, and looking at the source code did not reveal an answer. I finally had to read several man pages.

The answer:
mkdir ~/.snmp
echo "[snmp]" > ~/.snmp/snmpapp.conf
echo "defCommunity secretstring" >> ~/.snmp/snmpapp.conf
snmpdf somehost

If you could just put that as an example on snmp.conf, or snmpapp.conf, or *anywhere*, that would have helped. The snmpd.conf file has examples on a page of its own, the apps need it too.

Thanks!

Discussion

  • Penelope Fudd

    Penelope Fudd - 2012-06-14

    Also, here's the error message you get if you don't have '[snmp]' in the snmpapp.conf file:

    /Users/chowes/.snmp/snmpapp.conf: line 2: Warning: Unknown token: defCommunity.
    No community name specified.

    If it could be changed to also say:

    See 'man snmp.conf' or http://net-snmp.sourceforge.net/docs/man/snmp.conf.html for known tokens.
    See 'man snmp_config' or http://net-snmp.sourceforge.net/docs/man/snmp_config.html for config file format.

    That would be cool too. After all, you're already printing an error message, a slightly bigger error message won't hurt anything.

    that would be great.

     
  • Dave Shield

    Dave Shield - 2012-07-26

    Thanks for the bug report!
    We've fixed the problem in the 5.4.x, 5.5.x, 5.6.x and 5.7.x code branch and the main development tree, so it should be fixed in future releases of the Net-SNMP package.

     
  • Dave Shield

    Dave Shield - 2012-07-26

    I've updated the documentation, as requested.

    I'm less comfortable about extending the error message along the lines you suggest.
    Perhaps you could raise this on the mailing list, and see what other people think.
    In the meantime, I'm closing this bug report (if only so I can more easily see what still needs looking at!)

     

Log in to post a comment.