linux下安装net-snmp以及遇到的问题

在centos下用yum安装
yum list | grep snmp
yum install net-snmp.i386
在Linux下用tar.gz包安装net-snmp-5.4.1
tar zxvf net-snmp-5.4.1.tar.gz
cd net-snmp-5.4.1
./configure
make
make install
cp EXAMPLE.conf /usr/local/share/snmp/snmpd.conf
vi /usr/local/share/snmp/snmpd.conf
把这句
com2sec local     localhost       COMMUNITY
com2sec mynetwork NETWORK/24      COMMUNITY
改为
com2sec local     localhost      public
com2sec mynetwork 192.168.1.0/24      public
启动:
snmpd -d
用如下命令测试:
snmpget -v 1 -c public localhost system.sysUpTime.0
snmpwalk -v 1 -c public localhost system
查看日志:
tail -f /var/log/snmpd.log
make时出现错误:cannot find the library `/usr/lib/libbeecrypt.la'
解决办法:rpm安装beecrypt-devel或者用源码安装beecrypt
再次make时出现错误:/usr/bin/ld: cannot find -lelf
解决办法:rpm安装elfutils-devel或者用源码安装elfutils
安装elfutils时出现错误:/usr/local/bin/ld: unrecognized option `--eh-frame-hdr'
网上说是gcc和ld不兼容的问题 ld版本低,不认识 eh-frame-hdr
解决办法:安装binutils
安装binutils出现错误:installation or configuration problem: C compiler cannot create executables
查看config.log,错误还是:
/usr/local/bin/ld: unrecognized option `--eh-frame-hdr'
GNU Binutils里面应该包含ld(the GNU linker).现在要装高版本的binutils来得到高版本的ld,但是这里安装Binutils时却需要
高版本的ld?
用"wheris ld"命令查看:
发现ld存在两个地方
/usr/local/bin/ld /usr/bin/ld
/usr/bin/ld能识别`--eh-frame-hdr',问题总算解决了.
mv /usr/local/bin/ld /usr/local/bin/ld.bak
所有的包make通过.
net-snmp地址:
http://www.net-snmp.net/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值