net-snmp-5.7.1 编译安装 (ubuntu)

下载net-snmp
#wget http://superb-dca2.dl.sourceforge.net/project/net-snmp/net-snmp/5.7.1/net-snmp-5.7.1.tar.gz
安装Ubuntu下的snmp的依赖包
#sudo apt-get install libperl-dev
进入到解压目录,开始配置snmp
#tar -xvf net-snmp-5.7.1.tar.gz
#./configure --with-default-snmp-version="2" --with-sys-contact="@jiesai" --with-sys-location="Unknown" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp"
#make
#make install
7、验证安装是否成功,如下所示:
# snmpget --version
如果提示如下错误:
snmpget: error while loading shared libraries: libnetsnmp.so.30: cannot open shared object file: No such file or directory
解决方案如下: cp /usr/local/lib/libnetsnmp.so.30 /usr/lib
#修改snmpd.conf文件 0.0.0.0 是别的机器通过snmp能够信息
agentAddress udp:0.0.0.0:161
view systemonly included .1
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
access notConfigGroup "" any noauth exact systemview none none
syslocation www.openlab.com //系统的location
syscontact xxxx([email protected]) //系统联系人
dontLogTCPWrappersConnects yes

转载于:https://www.cnblogs.com/feiyuliu/archive/2012/09/15/2686971.html

你可能感兴趣的:(net-snmp-5.7.1 编译安装 (ubuntu))