Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2451031
  • 博文数量: 225
  • 博客积分: 11622
  • 博客等级: 上将
  • 技术积分: 7358
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-18 10:05
个人简介

我们的生活是多么美好呀!!!!

文章存档

2013年(2)

2012年(9)

2011年(59)

2010年(8)

2009年(35)

2008年(112)

分类: LINUX

2008-10-10 12:01:47

在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地址:
阅读(2304) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~