【Net-Snmp学习笔记一 ——源码编译安装】

1. 源码地址

https://github.com/net-snmp/net-snmp
https://sourceforge.net/projects/net-snmp/files/net-snmp

2. 环境介绍

使用的NET-SNMP版本为5.9.3
Linux 系统为 centos-release-7-6.1810.2.el7.centos.x86_64

3. 源码编译

3.1 首先配置编译参数

configure 选项参数 说明
–prefix net snmp 安装路径
–with-default-snmp-version 默认使用版本
–with-sys-location 设备位置
–with-logfile 日志文件路径
-with-persistent-directory 不变数据存储路径
–build 交叉编译环境系统说明(编译平台)
–host 交叉编译目标环境(运行平台)
–with-endianness 指定大小端模式
–enable-mini-agent 使用最小agent
–with-cc --with-linkcc --with-ar 交叉编译器使用的gcc
–disable-applications 不编译snmpget snmpset等应用
–disable-manuals 不安装网管软件的说明手册
–disable-snmptrapd-subagent 不支持snmptrapd的agent子代理
–disable-ipv6 不支持IPv6
–with-mib-modules 添加具体模块(dlmod agentx …)
–disable-embedded-perl 不支持嵌入式perl
–disable–perl-cc-checks 不需要perl检查
–with-sys-contact 设备的联系人
–with–sys-location 设备地址
–disable-scripts 不需要安装mib2c等工具

3.2 编写配置脚本

因为配置项过多,因此这里写一个 localBuild.sh 脚本文件进行configure参数配置。

# --prefix 指定安装目录当当前源文件的 out文件夹(需要我们自己创建)
# --disable-manuals 不安装网管软件的说明手册
# --disable-snmptrapd-subagent 不支持snmptrapd的agent子代理
# --disable-ipv6 不支持IPv6
# --disable-scripts 不需要安装mib2c等工具
# -enable-mini-agent 使用最小agent
# --with-mib-modules="notification agentx" 添加 notification agentx模块
# --disable-embedded-perl 不支持嵌入式perl
# --with-perl-modules 安装perl模块
# --with-default-snmp-version 指定默认使用版本
# --with--sys-location 指定设备位置
# --with-logfile 指定日志文件路径
# --with-persistent-directory 不变数据存储路径
./configure --prefix=/home/lijun/net-snmp-5.9.3/out --disable-manuals --disable-snmptrapd-subagent --disable-ipv6 --disable-scripts --enable-mini-agent --with-mib-modules="notification agentx" --disable-embedded-perl --with-perl-modules --with-default-snmp-version
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值