1.确保Linux主机已经安装了snmp服务服务器
rpm -qa |grep snmp
ide
若是没有,那么放入Linux安装盘找到snmp的rpm包进行安装,或者到网上搜索适合本身Linux发行版本的rpm包进行安装,或者使用yum.spa
2.安装rest
须要安装的大概有orm
yum install -y net-snmp net-snmp-devel net-snmp-libs net-snmp-perl net-snmp-utils mrtgip
其中有一些不是必须的, -y 指的是对全部问题回答yes,省去安装时的交互。字符串
3.启动string
输入it
snmpd
table
service snmpd start
并用
service snmpd status
察看服务状态。
注意:有时输入service snmpd status 后出现
snmpd dead but pid file exists
或者
snmpd dead but subsys locked
缘由是没有先输入snmpd,原理还不是很明白,可是先记着吧。
4.配置
装好以后修改/etc/snmp/snmpd.conf对其进行配置
A、修改默认的community string
com2sec notConfigUser default public
将public修改成你才知道的字符串
B、把下面的#号去掉
#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
C、把下面的语句
access notConfigGroup " " any noauth exact systemview none none
改为:
access notConfigGroup " " any noauth exact mib2 none none
5.重启snmpd服务
/etc/rc.d/init.d/snmpd restart
完成snmpd的配置
6.确保Linux的iptables防火墙对咱们的流量监控服务器开放了udp 161端口的访问权限可以使用iptables -L -n 查看当前iptables规则可编辑/etc/sysconfig/iptables文件来修改iptables规则