Thursday, April 23, 2009

Installing snmpd

1. # sudo apt-get install snmpd
2. # sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
3. # snmpconf

-- a. Read in which: choose ALL (default) for configuration file
-- b. Select file to create: snmpd.conf
-- c. Choose 1: Trap Destinations
-- d. Choose 1: A SNMPv1 trap receiver
-- -- host name that should receive the trap: localhost [or any server in your network]
-- -- the community to be used in the trap sent: public [or whatever you want]
-- -- the port number the trap should be sent to: 161 [most used]
-- -- then type: finished
-- e. Choose 6: Access Control Setup
-- f. Choose 3: a SNMPv1/SNMPv2c read-only access community name or
-- 4: a SNMPv1/SNMPv2c read-write access community name
-- -- the community name to add read-only access for: public
-- -- the hostname or network address to accept this community name from [RETURN for all]: RETURN
-- -- the OID that this community should be restricted to [RETURN for no-restriction]: RETURN
-- -- then type: finished
-- g. finished

4. # sudo cp /etc/snmp/snmpd.conf /usr/share/snmp/snmpd.conf
5. # sudo vi /etc/default/snmpd

Change from:

# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'

To:

# snmpd options (use syslog, close stdin/out/err).
# SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'

6. restart snmpd:
# /etc/init.d/snmpd restart

7. try your snmp:
# snmpwalk -v [snmp version] -c [snmp community name] [host] -O a

if you receive any reply, then you done it! :)

No comments:

Post a Comment

Hi, for all of those who already put comments on my blog post, thanks.. really appreciate it. And for those who have not, just put your comments here :)