zoukankan      html  css  js  c++  java
  • ubuntu搭建mib2c环境

    1.下载net-snmp
    http://net-snmp.sourceforge.net/download.html
    例如,下载5.5版本
    2.进入下载目录,解压net-snmp压缩包
    #tar zxf net-snmp-5.5.tar.gz
    3.configure
    #cd net-snmp-5.5
    #./configure --with-default-snmp-version="2" --with-sys-contact="contact@contact" --with-sys-location="location" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp"
    4.make
    # make
    # make install
    5.配置conf文件
    # vi /etc/snmpd.conf
    在 snmpd.conf 中輸入一行:
    rocommunity public
    :wq 保存并退出
    6.启动
    # snmpd -C -c /etc/snmpd.conf
    7.检验mib2c
    # mib2c
    如果出现以下:
    Use of uninitialized value $key in hash element at /usr/local/lib/perl/5.10.1/SNMP.pm line 1325.
    Use of uninitialized value $key in hash element at /usr/local/lib/perl/5.10.1/SNMP.pm line 1326.
    Use of uninitialized value in null operation at /usr/local/lib/perl/5.10.1/SNMP.pm line 1325.
    You didn't give mib2c a valid OID to start with.  IE, I could not find
    any information about the mib node "".  This could be caused
    because you supplied an incorrectly node, or by the MIB that you're
    trying to generate code from isn't loaded.  To make sure your mib is
    loaded, run mib2c using this as an example:
       env MIBS="+MY-PERSONAL-MIB" mib2c
    You might wish to start by reading the MIB loading tutorial at:
       http://www.net-snmp.org/tutorial-5/commands/mib-options.html
    And making sure you can get snmptranslate to display information about
    your MIB node.  Once snmptranslate works, then come back and try mib2c
    again.
    证明可用,搭建完成。

  • 相关阅读:
    单选按钮控件(Ridio Button)的使用
    带属性页的对话框
    异常处理与MiniDump详解(4) MiniDump
    单片机与嵌入式 以及ARM DSP FPGA 几个概念的理解
    VC更换图标文件
    http://user.qzone.qq.com/2413264738/2
    安装包安装 执行有相对路径的程序不能正确运行
    如何将 jar 包导入Maven 本地仓库
    19、访问者设计模式
    11、装饰器模式
  • 原文地址:https://www.cnblogs.com/chars/p/4998999.html
Copyright © 2011-2022 走看看