Linux系统的 SNMP服务设置

来源:互联网 发布:安卓刷票软件免费 编辑:程序博客网 时间:2024/06/05 03:25

安装SNMP

略,请参阅LINUX系统SNMP安装说明,一般情况下Linux中 的均已经自动安装了SNMP服务。以下命令可以检测SNMP服务是否安装以及安装的文件包。

[root@idc ~]# rpm -qa |grep snmp
net-snmp-libs-5.1.2-11.EL4.7
net-snmp-5.1.2-11.EL4.7

 

配置SNMP

按照如下方式修改/etc/snmp/snmpd.conf文件

A、修改默认的community stringSUMSNMP读值密码)
com2sec notConfigUser default public
public修改为你才知道的字符串

default改为你想哪台机器可以看到你 的snmp信息,比如SUM所在IP为:10.10.10.10, 就改成这个IP。不改表示所有机器充许。

B、把下面的#号去掉
#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc

启用全部功能可以使用如下一行(如果没有可以加入一行):

view all included .1           80

C、把下面的语句
access notConfigGroup "" any noauth exact systemview none none
改成:
access notConfigGroup "" any noauth exact mib2 none none

或是:

access notConfigGroup "" any noauth exact all none none

启动与停止SNMP

一般使用:service snmpd start|stop|restart命令。或是:

#/etc/rc.d/init.d/snmpd restart

防火墙

如果Linux启动了防火墙,请开放UDP161端 口。确保Linuxiptables防火墙对SUM监控服务器开放 了udp 161端口的访问权限
可使用iptables ?L ?n 查看当前iptables规则
可编辑/etc/sysconfig/iptables文 件来修改iptables规则。

原创粉丝点击