centos安装snmp服务
不知道为啥centos自带的net-snmp抓不到很多信息,CPU 网络流量 内存都抓不到。
折腾了一会还是打算用代码自己编译拉倒。
wget http://downloads.sourceforge.net/project/net-snmp/net-snmp/5.4.4/net-snmp-5.4.4.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fnet-snmp%2Ffiles%2Fnet-snmp%2F5.4.4%2F&ts=1316244916&use_mirror=switch
./configure –sysconfdir=/etc/snmp –bindir=/usr/bin –sbindir=/usr/sbin –prefix=/usr –with-default-snmp-version=”2″ –disable-snmptrapd-subagent ; make ; make install
注意一下,不能make -j8否则会报错。
配置文件在/etc/snmp/snmpd.conf,内容如下:
agentAddress udp:161
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
rocommunity public
#rocommunity public 61.122.111.1 <–限制IP访问,如果不需要限制,则去掉IP即可。
rouser authOnlyUser
sysLocation Sitting on the Dock of the Bay
sysContact Me <me@example.org>
sysServices 72
disk / 10000
disk /var 5%
includeAllDisks 10%
load 12 10 5 www.2cto.com
iquerySecName internalUser
rouser internalUser
defaultMonitors yes
linkUpDownNotifications yes
摘自:素包子