在linux4.7上安装net-snmp编译遇到的问题
来源:互联网 发布:pano2vr mac 破解方法 编辑:程序博客网 时间:2024/06/06 23:19
#wget http://nchc.dl.sourceforge.net/sourceforge/net-snmp/net-snmp-5.4.2.1.tar.gz
#cd net-snmp-5.4.2.1
#./configure --prefix=/usr/local/net-snmp --enable-developer
#make 这个时候报错如下:
grep: /usr/lib/libbeecrypt.la: No such file or directory
/bin/sed: can't read /usr/lib/libbeecrypt.la: No such file or directory
libtool: link: `/usr/lib/libbeecrypt.la' is not a valid libtool archive
make[1]: *** [libnetsnmpmibs.la] 错误 1
make[1]: Leaving directory `/usr/local/src/net-snmp-5.4.2.1/agent'
make: *** [subdirs] 错误 1
解决方法
说明缺少libbeecrypt.la ,libbeecrypt.so等共享库
如果确认系统中有libbeecrypt.la,也许他安装在/usr/local下面,可尝试:
ln -s /usr/local/lib/libbeecrypt.la /usr/lib/libbeecrypt.la
如果/usr/local下面没有,那么你必须安装beecrypt
下载路径
http://down1.chinaunix.net/distfiles/beecrypt-4.1.2.tar.gz
解压并安装到/usr目录下:
tar -zxvf beecrypt-4.1.2.tar.gz
./configure -prefix=/usr
#默认是安装在/usr/local,我们需要安装在/usr目录下。如果没有加这个参数需要做连接
ln -s /usr/local/lib/libbeecrypt.la /usr/lib/libbeecrypt.la
编译并安装beecrypt库,先执行make编译源码包文件编译成功后执行安装命令make install,其命令如下:
#make
#make install
好,beecrypt安装完成后,我们继续NET-SNMP的编译,结果又报错如下:
/usr/bin/ld: cannot find -lelf
collect2: ld returned 1 exit status
make[1]: *** [snmpd] 错误 1
make[1]: Leaving directory `/usr/local/src/net-snmp-5.4.2.1/agent'
make: *** [subdirs] 错误 1
解决方法:
说明缺少libelf.so,如果系统已经安装,只需使用西面命令就好了:
ln -s /usr/lib/libelf.so.1 /usr/lib/libelf.so
如果在/usr/lib下面找不到libelf.so.1文件的话,需下载安装-libelf包。(第二张光盘里面有)
下载地址:ftp://ftp.wesmo.com/pub/contributed/RPMS/elfutils-libelf-0.76-3.i386.rpm
直接执行命令:rpm -ivh elfutils-libelf-0.76-3.i386.rpm
ok !在去执行net-snmp的make,没有报错了,哈哈!!
继续:make install
#cp EXAMPLE.conf /usr/local/net-snmp/share/snmp/snmpd.conf
#/usr/local/net-snmp/sbin/snmpd -c /usr/local/net-snmp/share/snmpd.conf //启动snmp服务
netstat -an |grep 161 //查看snmp是否启动
在/etc/rc.local里面添加
/usr/local/net-snmp/sbin/snmpd -c /usr/local/net-snmp/share/snmpd.conf
snmp服务就会开机启动。
测试:#snmpwalk -v 2c -c zjhcsoft 127.0.0.1 if
如果有数据返回没问题
如果显示超时,那就需要重启服务器
-----------------------------------------------------------------------------------------------
如果服务器利用rpm包安装,配置net-snmp如下:
1、#vi /etc/snmp/snmpd.conf
更改
com2sec notConfigUser default public
改为
com2sec notConfigUser 127.0.0.1 zjhcsoft (团体名为zjhcsoft)
2、更改
access notConfigGroup "" any noauth exact systemview none none
改为
access notConfigGroup "" any noauth exact all none none
3、 #view all included .1 80
将前面的 # 注释 去掉。 保存退出
上面这几个地方很重要,注意了,不然得不到数据
然后重启服务
#service snmpd restart
#service snmptrapd start
同时运行setup,把这两个服务器加入自启动。
#snmpwalk -c zjhcsoft -v 2c 127.0.0.1
- 在linux4.7上安装net-snmp编译遇到的问题
- linux下安装net-snmp以及遇到的问题
- 在redhat上安装net-snmp
- 在Ubuntu上安装Net-Snmp
- Linux---net-snmp安装遇到的错误
- net-snmp在linux下的安装及snmp开发
- net-snmp在linux下的安装及snmp开发
- net-snmp的编译
- net-snmp的编译
- net-snmp的编译
- STM32F10x_StdPeriph_Lib_V3.5.0在Keil上编译遇到的问题总结
- SNMP++ 在Linux环境上的搭建与编译
- linux下net-snmp的源码编译安装与配置
- Net-snmp总结(二)-net-snmp配置编译安装
- 编译net-snmp的错误
- 在虚拟机上安装TestDirector8.0 遇到的问题
- 在CentOS5.3上安装mysql5.0.77遇到的问题
- 在mac上安装ecshop遇到的问题与解
- .NET 4.0 FAQ 第一部分—DLR
- linux环境下代码编写利器:vim+ctags
- 2010-05-21 Firday
- 学习英语的正确方法
- Install ruby 1.9 on Windows using zip binary
- 在linux4.7上安装net-snmp编译遇到的问题
- 事情一个接着一个的来,感觉越来越没意思了
- 大赞google的创意logo
- 注意细节 js变量作用域
- 德州仪器达芬奇五年之路七宗罪,嵌入式处理器架构之争决战2012
- Xen Cloud Platform 0.1.1
- Enable rsh/rlogin/rexec in Linux
- 校运会后记
- 穷举一切可能的数值排列或组合(应该是类36先7的算法)