CentOS5 安装配置 SNMP 服务
1.通过 yum 安装
yum install net-snmp net-snmp-utils
snmpconf
The following installed configuration files were found: 1: /etc/snmp/snmpd.conf 2: /usr/share/snmp/snmpd.confWould you like me to read them in? Their content will be merged with theoutput files created by this session.Valid answer examples: "all", "none","3","1,2,5"Read in which (default = all): noneI can create the following types of configuration files for you.Select the file type you wish to create:(you can create more than one as you run this program) 1: snmpd.conf 2: snmp.conf 3: snmptrapd.confOther options: quitSelect File: 1The configuration information which can be put into snmpd.conf is dividedinto sections. Select a configuration section for snmpd.confthat you wish to create: 1: Access Control Setup 2: Extending the Agent 3: Agent Operating Mode 4: System Information Setup 5: Trap Destinations 6: Monitor Various Aspects of the Running HostOther options: finishedSelect section: 1Section: Access Control SetupDescription: This section defines who is allowed to talk to your running snmp agent.Select from: 1: a SNMPv3 read-write user 2: a SNMPv3 read-only user 3: a SNMPv1/SNMPv2c read-only access community name 4: a SNMPv1/SNMPv2c read-write access community nameOther options: finished, listSelect section:
/etc/init.d/snmpd start)
createUser user1 MD5 user1password
/etc/init.d/snmpd stop
/etc/init.d/snmpd start
iptables -A INPUT -i eth0 -p udp -s [允许访问的ip地址] --dport 161 -j ACCEPT