Friday, February 2, 2007

SNMP

Debian/Ubuntu:
Ok so I have a bit of frustration to let out over SNMP... I installed SNMP with the whole

apt-get install snmpd

and everything went fine.... I figured out how to change the /etc/snmp/snmpd.conf file to allow for external connections...

com2sec readonly "Network (ex. 192.168.1.0/24)" public

But! It wouldn't work! So I hit the web... Not a whole lot out there for snmpd. I did find some stuff, but nothing seemed to work... I was going crazy for a couple of days until I finally came across a little Mailing list post that had buried in it a line about

/etc/default/snmpd

Hmm... Well I checked it out and theres my problem! There is a line in there

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'

that I think controls what interface snmpd daemon listens on! I changed it to the correct IP of the interface I wanted it to listen on and boom... There you go...

Oh and this little command helped me realize that snmpd wasn't listening on the right interface

netstat -natup | grep 161

And there you go....