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.
证明可用,搭建完成。

ubuntu搭建mib2c环境的更多相关文章

  1. linux -- ubuntu搭建nodejs环境

    需求:在web端做一个实时性功能比较强的模块, 客户端:用websocket 服务端:node.js node.js介绍:node.js天生就是一个高效的服务端语言,可以直接使用 javascript ...

  2. Ubuntu搭建docker环境

    一丶自己搭建Ubuntu的虚拟机(网上很多教程) PS:下带图形化界面的Ubuntu镜像,这里只说一下要装那些工具和做那些配置   安装vim         sudo apt-get install ...

  3. Ubuntu 搭建NDK环境

    一. NDK下载地址 https://developer.android.com/tools/sdk/ndk/index.html 二. NDK环境两种方式 NDK下载后,解压缩后放置于目录/home ...

  4. ubuntu 搭建django 环境

    ubuntu 默认安装了 python2.7 . 安装django apt install python-django: 安装mysql apt install mysql-server*  *代表版 ...

  5. ubuntu搭建开发环境踩坑实录

    谨以此文,记录和ubuntu系统不死不休的搏斗过程,后续待补. 1.双系统安装,windows采用uefi模式安装(优启通可制作uefi的win10安装盘),ubuntu不要划分boot区,而应该划分 ...

  6. Ubuntu搭建lnmp环境

    1.安装nginx 安装 sudo apt-get install nginx 服务启动.停止.重启 /etc/init.d/nginx start /usr/sbin/nginx -c /etc/n ...

  7. ubuntu 搭建开发环境

    一. 安装C/C++程序的开发环境 1. sudo apt-get install build-essential //安装主要编译工具 gcc, g++, make 2. sudo apt-get ...

  8. ubuntu搭建tiny4412环境【学习笔记】

    一.安装完系统之后需要执行如下步骤 1.sudo apt-get update 更新软件源 2.sudo apt-get install vsftpd openssh-server nfs-kerne ...

  9. VirtualBox安装Ubuntu搭建js环境的注意事项

    1.使用CPU-Z工具检查主板是否支持虚拟技术,因为VirtulBox虚拟机需要主板支持虚拟技术 2.Ubuntu安装之后重启会出现:please remove this install medium ...

随机推荐

  1. Creating Dialogbased Windows Application (2) / 创建基于对话框的Windows应用程序(二)Button的应用、新建子窗体 / VC++, Windows

    创建基于对话框的Windows应用程序(二) —— Button的应用.新建子窗体 可以发现上一节创建的窗体中,点击OK和Cancel两个按钮是没有任何反应的.现在我们来为他们添加退出对话框的功能. ...

  2. Mybatis结果生成键值对

    在实际应用中我们经常会遇到这样的情况,需要给下拉框赋值,这个时候就需要键值对了,具体使用方法如下 1,在maper.xml文件中定义结果类型(resultType)定义为hashmap,如下所示 &l ...

  3. Spring MVC的@ResponseBody回来JSON串

    1 406错误 <mvc:annotation-driven />不用动,请求的时候URL的文件扩展名应为json @ResponseBody会根据扩展名,或者Header,或者Param ...

  4. Beamer加中文

    \documentclass{beamer} \mode<presentation> { \usetheme{CambridgeUS} % or try Darmstadt, Madrid ...

  5. Tomcat无法启动:Server Tomcat v8.5 Server at localhost failed to start

    Tomcat无法启动 项目状态 Maven项目:基础环境(依赖,基本配置文件)搭建完成,前端页面都导入,部署测试项目环境,出现该问题 问题情景: 1.弹窗提示Tomcat启动失败  2.Console ...

  6. Python Socket 网络编程 (客户端的编程)

    Socket 是进程间通信的一种方式,它与其他进程间通信的一个主要不同是:它能实现不同主机间的进程间通信,我们网络上各种各样的服务大多都是基于 Socket 来完成通信的,例如我们每天浏览网页.QQ ...

  7. 利用GetPrivateProfileString读取ini文件的字段

    //INIClass读取类 using System; using System.Collections.Generic; using System.Linq; using System.Text; ...

  8. 服务器之ECC报错检查

    需要使用ipmitool工具 [root@Resource ~]# yum install ipmitool 首先查看是否有ecc报错 如下图: [root@Resource ~]# ipmitool ...

  9. Assertion (software development) -- 断言

    Wiki: In computer programming, an assertion is a predicate (a true–false statement) placed in a prog ...

  10. CodeIgniter框架——知识要点汇总

    NO1.学习要点: 一.CodeIgniter 框架的简介 二.CodeIgniter 框架的安装 三.CodeIgniter 框架的目录结构分析 四.CodeIgniter 框架是如何工作的? 五. ...