Como instalar snmp en debian, ubuntu y RHEL 5
Instalamos los paquetes necesarios
Instalamos los paquetes necesarios
aptitude install snmp snmpd
posteriormente editamos el archivo /etc/default/snmpd y eliminamos 127.0.0.1
de la variable SNMPDOPTS para que pueda ser consultado desde cualquier equipo, deberia quedar algo así:
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid'
Editamos el archivo /etc/snmp/snmpd.conf para que quede de la siguiente manera, esto habilita todas las consultas posibles para la comunidad public y private
# sec.name source community
com2sec paranoid default public
com2sec readonly default public
com2sec readwrite default private
####
# Second, map the security names into group names:
# sec.model sec.name
group MyROSystem v1 paranoid
group MyROSystem v2c paranoid
group MyROSystem usm paranoid
group MyROGroup v1 readonly
group MyROGroup v2c readonly
group MyROGroup usm readonly
group MyRWGroup v1 readwrite
group MyRWGroup v2c readwrite
group MyRWGroup usm readwrite
####
# Third, create a view for us to let the groups have rights to:
# incl/excl subtree mask
view all included .1 80
view system included .1.3.6.1.2.1.1
#view system included .iso.org.dod.internet.mgmt.mib-2.system
####
# Finally, grant the 2 groups access to the 1 view with different
# write permissions:
# context sec.model sec.level match read write notif
access MyROSystem "" any noauth exact all all all
access MyROGroup "" any noauth exact all all all
access MyRWGroup "" any noauth exact all all all
# sec.name source community
com2sec paranoid default public
com2sec readonly default public
com2sec readwrite default private
####
# Second, map the security names into group names:
# sec.model sec.name
group MyROSystem v1 paranoid
group MyROSystem v2c paranoid
group MyROSystem usm paranoid
group MyROGroup v1 readonly
group MyROGroup v2c readonly
group MyROGroup usm readonly
group MyRWGroup v1 readwrite
group MyRWGroup v2c readwrite
group MyRWGroup usm readwrite
####
# Third, create a view for us to let the groups have rights to:
# incl/excl subtree mask
view all included .1 80
view system included .1.3.6.1.2.1.1
#view system included .iso.org.dod.internet.mgmt.mib-2.system
####
# Finally, grant the 2 groups access to the 1 view with different
# write permissions:
# context sec.model sec.level match read write notif
access MyROSystem "" any noauth exact all all all
access MyROGroup "" any noauth exact all all all
access MyRWGroup "" any noauth exact all all all
reiniciamos el servicio
/etc/init.d/snmpd restart
IF-MIB::ifDescr.2 = STRING: eth0
para probar ejecutamos:
snmpwalk -cpublic -v1 127.0.0.1 ifDescdebería devolvernos algo como esto:
IF-MIB::ifDescr.1 = STRING: loIF-MIB::ifDescr.2 = STRING: eth0
No hay comentarios:
Publicar un comentario