编译配置里面加了–with-mib-modules=“memory”
–with-mib-modules=“vmstat”
–with-mib-modules=“hw_mem” \
添加了mibs文件:UCD-SNMP-MIB.txt 和HCNUM-TC.txt
编译后替换了库libnetsnmpmibs.so.40.0.0 -》/lib64目录下
并重启了snmpd进程
用命令/usr/local/sbin/snmpget -v1 -c public localhost:16100 -t 60 .1.3.6.1.4.1.2021.4.6依然提示错误:
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::memTotalReal
解决办法:命令改成/usr/local/sbin/snmpget -v1 -c public localhost:16100 -t 60 .1.3.6.1.4.1.2021.4.6.0