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

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 make

apt-get install gcc

apt-get install cmake

apt-get install perl-ExtUtils-Embed

apt-get install libperl-dev 

在这里插入图片描述

---------------------------------------------------------
            Net-SNMP configuration summary:
---------------------------------------------------------

  SNMP Versions Supported:    1 2c 3
  Building for:               linux
  Net-SNMP Version:           5.9.4.pre2
  Network transport support:  Callback Unix Alias TCP UDP TCPIPv6 UDPIPv6 IPv4Base SocketBase TCPBase UDPIPv4Base UDPBase IPBase IPv6Base
  SNMPv3 Security Modules:     usm
  Agent MIB code:            default_modules =>  snmpv3mibs mibII ucd_snmp notification notification-log-mib target agent_mibs agentx disman/event disman/schedule utilities host
  MYSQL Trap Logging:         unavailable
  Embedded Perl support:      disabled
  SNMP Perl modules:          building -- not embeddable
  SNMP Python modules:        disabled
  Crypto support from:        internal
  Authentication support:     MD5 SHA1
  Encryption support:         DES AES AES128
  Local 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.kler.cn/news/162738.html

相关文章:

  • 网安领域含金量最高的证书有哪些?看这1篇就足够了!
  • 14、pytest像用参数一样使用fixture
  • MX6ULL学习笔记 (八) platform 设备驱动实验
  • Qt对excel操作
  • Mysql之数据处理增删改
  • 导入JDBC元数据到Apache Atlas
  • 初识Linux:权限(2)
  • Java八股文面试全套真题【含答案】-Web前端篇
  • Ubuntu22.04安装和卸载软件的命令行
  • 前端面试灵魂提问-计网(2)
  • Windows循环检测,直到网络通/断后执行指定命令
  • springboot如何格式化时间
  • 安装以及使用Minio分布式文件系统
  • SQL注入攻击
  • numpy数据读取保存及速度测试
  • Opencv打开图片
  • Java-网络通信总结
  • 掌握VUE中localStorage的使用
  • Gateway:微服务架构中的关键组件
  • ssl什么是公钥和私钥?
  • ES-深入理解倒排索引
  • Docker-compose容器编排与容器监控
  • 基于运算放大器的电压采集电路
  • Elasticsearch:什么是检索增强生成 (RAG)?
  • 【力扣100】7.无重复字符的最长子串
  • leetcode 3. 无重复字符的最长子串
  • Mysql 索引概念回顾
  • 基于java的贪吃蛇小游戏
  • Zabbix 执行自定义key脚本超时timeout while executing a shell script
  • Linux C语言 39-进程间通信IPC之管道