Chinaunix首页 | 论坛 | 博客
  • 博客访问: 293002
  • 博文数量: 77
  • 博客积分: 1422
  • 博客等级: 上尉
  • 技术积分: 932
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-21 12:39
文章分类
文章存档

2011年(1)

2009年(3)

2008年(73)

我的朋友

分类:

2008-06-20 22:45:56

1.从下载最新版本5.4.1.2源代码

2.拷贝到/root/src目录下

3.tar -zxvf net-snmp-5.4.1.tar.gz

4.cd net-snmp-5.4.1
5../configure
6.make
7.make install

configure后返回的configure信息

net-snmp configuration summary
SNMP Version Support: 1 2c 3
Net-SNMP Version: 5.4.1
Building for : Linux
Network transport support: callback Unix Tcp Udp
SNMPv3 security modules: usm
Agent MIB code:
  default_modules=>snmpv3mibs mib2 ucd-snmp notification notificaion-log-mib
      target agent-mibs agentx disman/event disman/schedule utilities host
Embeded perl support: enabled
SNMP perl modules: building embedable
SNMP python modules: disabled
Authentication support: MD5 SHA1
Encryption support: DES AES

8.在编译过程中可能会碰到一些问题

参考解决

This has been seen in a number of guises over the years - most commonly on Linux systems (although the problem may also occur elsewhere). A typical installation may not always include the full set of library links required for building the Net-SNMP software.

This problem can usually be fixed by installing the missing packages (typically the development version of a package that is already there).

Examples of this that we have come across include:

    -lelf       elfutils-devel      (later renamed to elfutils-libelf-devel)
-lbz2 bzip2-devel
-lselinux libselinux-devel
-lcrypto openssl/openssl-devel
-lbeecrypt libbeecrypt/beecrypt/beecrypt-devel.

These are the names of the RedHat/Fedora RPMs. Other distributions or O/S's may use different names, but the basic idea should be the same.

If the compilation is complaining about a missing .so file, then an alternative quick fix is to add the missing symbolic link, using something like:

         ln -s libelf.so.1 /usr/lib/libelf.so

giving the appropriate generic library name from the error message, and the correct number for whichever version of this library you have installed.

9.运行snmptranslate 测试是否可以正确解析OID

可以参考:

几个选项介绍如下:

a.-On 用数字形式输出

b.-Of 输出完整名字

c.-IR

  OID的形式一般需要这样提供的

     模块名::mib object的最底层名字 例如:SNMPv2-MIB::sysUpTime.0

  -IR 选项使得用户可以不用提供前面的模块名

d.-Tp  -Td  用户提供OID的时候不需要加后缀.0

  -Tp  打印该节点树的详细信息

  -Td  输出该节点的详细信息


10.参照教程 简单配置windows下的snmp服务


  在linux下用snmpget snmpwalk 等工具访问成功

  对snmp有个感性认识


11.开始配置linux下的snmp agent

  检测snmpd是否运行

  %snmpwalk -v 1 -c public 127.0.0.1 SNMPv2-MIB::sytem

  返回 No response from 127.0.0.1

  说明SNMPv2-MIB::sytem 已经解析成功,但是snmpd没有反应

  %netstat -apn | grep 161

  %ps -aux | grep -i snmpd

  都没有关于snmpd的信息返回,说明snmpd没有运行


12.后台运行snmpd

  %snmpd &

  如果失败,就要仔细检查/usr/local/etc/snmp  下的snmpd.conf 文件是否配置正确

  不是 /etc/snmp/ 下的snmpd.conf 文件哦,它没有执行权限


13. %snmpwalk -v 1 -c public 127.0.0.1 SNMPv2-MIB::sytem

  成功访问!


阅读(3265) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~