当前位置: 首页 > news >正文

Ubuntu编译文件安装SNMP服务

net-snmp源码下载

http://www.net-snmp.org/download.html

编译步骤

指定参数编译

./configure --prefix=/root/snmpd --with-default-snmp-version="2" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" --with-sys-contact="contact" --with-sys-location="location"
make make install

编译环境

apt-get install makeapt-get install gccapt-get install cmakeapt-get install perl-ExtUtils-Embedapt-get install libperl-dev 

在这里插入图片描述

---------------------------------------------------------Net-SNMP configuration summary:
---------------------------------------------------------SNMP Versions Supported:    1 2c 3Building for:               linuxNet-SNMP Version:           5.9.4.pre2Network transport support:  Callback Unix Alias TCP UDP TCPIPv6 UDPIPv6 IPv4Base SocketBase TCPBase UDPIPv4Base UDPBase IPBase IPv6BaseSNMPv3 Security Modules:     usmAgent MIB code:            default_modules =>  snmpv3mibs mibII ucd_snmp notification notification-log-mib target agent_mibs agentx disman/event disman/schedule utilities hostMYSQL Trap Logging:         unavailableEmbedded Perl support:      disabledSNMP Perl modules:          building -- not embeddableSNMP Python modules:        disabledCrypto support from:        internalAuthentication support:     MD5 SHA1Encryption support:         DES AES AES128Local DNSSEC validation:    disabled---------------------------------------------------------

编译完成
在这里插入图片描述

gcc -E -I./include -I. -DDONT_INC_STRUCTS -DBINDIR=/root/snmpd/bin -x c -I. -Iinclude ./sedscript.in | /bin/grep -E '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
echo 's/VERSIONINFO/5.9.4.pre2/g' >> sedscript
echo 's#DATADIR#/root/snmpd/share#g' >> sedscript
echo 's#LIBDIR#/root/snmpd/lib#g' >> sedscript
echo 's#BINDIR#/root/snmpd/bin#g' >> sedscript
echo 's#PERSISTENT_DIRECTORY#/var/net-snmp#g' >> sedscript
echo 's#SYSCONFDIR#/root/snmpd/etc#g' >> sedscript
/bin/sed -f sedscript ./EXAMPLE.conf.def > EXAMPLE.conf
making all in /root/net-snmp-5.9.4/snmplib
make[1]: Entering directory '/root/net-snmp-5.9.4/snmplib'

编译报错

# 编译报错collect2: error: ld returned 1 exit status
Makefile:1008: recipe for target 'libnetsnmpagent.la' failed
make[1]: *** [libnetsnmpagent.la] Error 1
make[1]: Leaving directory '/root/net-snmp-5.9.4/agent'
Makefile:671: recipe for target 'subdirs' failed
make: *** [subdirs] Error 1

编译的时候出现找不到perl库的问题,这个问题其实也好解决,编译一个就是嘛。但是呢,没有这个必要,麻烦。解决办法 其实很简单,将之前configure配置的时候加上一个参数–disable-embedded-perl,然后再次make就可以了。

http://www.lryc.cn/news/256163.html

相关文章:

  • 3D Web可视化平台助力Aras开发PLM系统:提供数据访问、可视化和发布功能
  • Graphpad Prism10.1.0 安装教程 (含Win/Mac版)
  • 【动态规划】路径问题_不同路径_C++
  • Python并发-线程和进程
  • 微信小程序适配方案:rpx(responsive pixel响应式像素单位)
  • vue2 echarts饼状图,柱状图,折线图,简单封装以及使用
  • Linux信息收集
  • 三种定时任务总结
  • [足式机器人]Part2 Dr. CAN学习笔记-数学基础Ch0-6复数Complex Number
  • 使用 MITRE ATTCK® 框架缓解网络安全威胁
  • 从零构建属于自己的GPT系列4:模型训练3(训练过程解读、序列填充函数、损失计算函数、评价函数、代码逐行解读)
  • 光学遥感显著目标检测初探笔记总结
  • HttpComponents: 领域对象的设计
  • 使用wire重构商品微服务
  • 大三上实训内容
  • IOT安全学习路标
  • java中线程的状态是如何转换的?
  • 处理合并目录下的Excel文件数据并指定列去重
  • Numpy数组的去重 np.unique()(第15讲)
  • ROS-log功能区别
  • 学习git后,真正在项目中如何使用?
  • Qt国际化翻译Linguist使用
  • ShardingSphere数据分片之分表操作
  • 基于ssm鲸落文化线上体验馆论文
  • LeetCode Hot100 131.分割回文串
  • SAP UI5 walkthrough step9 Component Configuration
  • 【数据结构和算法】--- 栈
  • CentOS7.0 下rpm安装MySQL5.5.60
  • 智慧能源:数字孪生压缩空气储能管控平台
  • 【链表OJ—反转链表】