[cc lang="bash"]
\$ yum install net-snmp net-snmp-utils
\$ rpm -ql net-snmp
\$ mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.org
\$ vi /etc/snmp/snmpd.conf
\$ vi /etc/sysconfig/snmpd.options
\$ chkconfig snmpd on
\$ service snmpd start
\$ netstat -tulnp | grep snmpd
udp 0 0 10.0.0.2:161 0.0.0.0:* 2126/snmpd
udp 0 0 127.0.0.1:161 0.0.0.0:* 2126/snmpd
\$ snmpwalk -v1 -cpublic 127.0.0.1 sysLocation
SNMPv2-MIB::sysLocation.0 = STRING: Wiki
[/cc]
/etc/snmp/snmpd.conf
[cc lang="bash"]
syslocation Wiki
syscontact Wiki wiki@jokeru.ro
####
# First, map the community into a security name
# sec.name source community
com2sec RO-SN-Local localhost public
com2sec RO-SN-Lan 10.0.0.0/24 private
####
# Second, map the security name into a group name
# group name security model security name
group RO-GN-Local v1 RO-SN-Local
group RO-GN-Local v2c RO-SN-Local
group RO-GN-Lan v2c RO-SN-Lan
####
# Third, create a view for us to let the group have rights to
# name incl/excl subtree mask(optional)
view All included .1 80
####
# Finally, grant the group read-only access to the view
# group context sec.model sec.level prefix read write notif
access RO-GN-Local "" any noauth exact All none none
access RO-GN-Lan "" any noauth exact All none none
[/cc]
/etc/sysconfig/snmpd.options
[cc lang="bash"]
# snmpd command line options
OPTIONS="-Lsd -Lf /dev/null -I -smux -p /var/run/snmpd.pid 127.0.0.1
10.0.0.2"
[/cc]