net-snmp移植到arm
如果没有涉及到扩展agent,则蓝色字体不需要理会。
1.将源码包另找一个路径放下,解压
若想扩展agent,则可以将此模块的.c和.h文件先放到net-snmp-5.4.4/agent/mibgroup下一起配置编译;
例如我这里想用代理读写encoder模块,那么先将写好的encoder源文件复制到net-snmp-5.4.4/agent/mibgroup路径下
;
2.CC=arm-linux-gcc ./configure --prefix=/home/arm_for_snmp/ --build=i386-linux --host=arm-linux --enable-mini-agent --disable-ipv6 --with-endianness=little --disable-manuals --disable-ucd-snmp-compatibility --enable-as-needed --disable-embedded-perl --without-perl-modules --disable-snmptrapd-subagent --disable-applications --disable-scripts --with-default-snmp-version="2" --with-sys-contact="lgao@cti.com.cn" --with-sys-location="china" --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp"
若想扩展agent,则可以再末尾继续添加
如何添加多个模块,没有试过
3.make LDFLAGS="-static"
4.make install
5.arm-linux-strip snmpd
在arm端执行
1.
2.cd /usr/sbin
3.和在虚拟机端一样,开启snmpd进程后,可以
cat /var/log/snmpd.log
来查看代理进程是否成功开启;若出现了版本信息,开启成功。
4.因为在./configure 的选项中是配置了最小的snmpd,所以如果想用到
snmpwalk /snmpget/snmptrap等应用时,可以直接从虚拟机端net-snmp的交叉编译版本的/bin路径下拷过来就可以了。
说明:
在用snmptrap 命令工具测试我加入的encoder模块的时候,会出现报错情况,说是找不到节点什么的,这时可以尝试把类似SNMPv2-MIB:sysLocation.0用OID来表示。这一点更多的是涉及到扩展agent的东西,后面会详细提到的。
关键词: net-snmp移植ar
加入微信
获取电子行业最新资讯
搜索微信公众号:EEPW
或用微信扫描左侧二维码