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.
Contrary to all the examples I found, it’s not easy to get snmpwalk to communicate with snmpd.
I am using the net-mgmt/net-snmp port with the default configuration options.
It was installed with: pkg install net-mgmt/net-snmp
This is the minimal configuration file, which should be placed at /usr/local/etc/snmp/snmpd.conf:
rocommunity public
When starting snmpd for the *first* time, you should see [something like] this in /var/log/snmpd.log:
Created directory: /var/net-snmp Created directory: /var/net-snmp/mib_indexes NET-SNMP version 5.7.2
Now you should be able to get some simple output, like this:
$ snmpwalk -c public -v 1 127.0.0.1 SNMPv2-MIB::sysDescr.0 SNMPv2-MIB::sysDescr.0 = STRING: FreeBSD cuppy.example.org 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
If you get something like this, check /var/log/snmpd.log:
$ snmpwalk -c public -v 1 127.0.0.1 Timeout: No Response from 127.0.0.1
I hope this helps.
See also this recipe I use: https://gist.github.com/dlangille/37790c43c8e2fdbdbf1a
Thank you for this post, Dan. The minimalist approach is helpful as a reference point from which to start.
When one sees “Timeout: No Response” the first place to look is /etc/hosts.allow. A strategically-placed
snmpd : 127.0.0.1 : ALLOW
will allow snmpwalk on the localhost to connect to the local snmpd daemon.