您好我在centOS上安装了SNMP,这是我的snmp.conf
agentAddress udp:161
com2sec me localhost public
com2sec nms 192.168.1.8 public
group AllGroup v2c me
group AllGroup v2c nms
group AllGroup v1 me
group AllGroup v1 nms
view AllView included 1.3.6.1.2.1.1.3
view AllView included 1.3.6.1.2.1.1.3
view AllView included 1.3.6.1.2.1.1.4
view AllView included 1.3.6.1.2.1.1.5
view AllView included 1.3.6.1.2.1.1.6
view AllView included 1.3.6.1.2.1.11.19
view AllView included 1.3.6.1.2.1.11.29
view AllView included 1.3.6.1.4.1.2021.2
view AllView included 1.3.6.1.4.1.2021.9
view AllView included 1.3.6.1.4.1.2021.10
access AllGroup "" any noauth exact AllView none none
syslocation Myserver
syscontact Admin <admin@admin.com>
proc httpd
proc mysqld
disk /tmp 290000
disk /var 2000000
disk /home 18600000
load 14 10 10
当我跑步时
snmpwalk -v 1 localhost -c public
显示
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (37590) 0:06:15.90
SNMPv2-MIB::sysContact.0 = STRING: Admin <admin@admin.com>
SNMPv2-MIB::sysName.0 = STRING: server.admin.om
SNMPv2-MIB::sysLocation.0 = STRING: Myserver
SNMPv2-MIB::snmpInTraps.0 = Counter32: 0
SNMPv2-MIB::snmpOutTraps.0 = Counter32: 0
但私人OCD没有出现
1.3.6.1.4.1.2021.2
1.3.6.1.4.1.2021.9
1.3.6.1.4.1.2021.10
但是当我通过
运行它们时snmpwalk -v 1 localhost -c public 1.3.6.1.4.1.2021.2
私有OCD MIB确实按照配置显示。
如何使用
显示私人OCDsnmpwalk -v 1 localhost -c public
...
答案 0 :(得分:0)
你不能。
如果不存在OID参数,snmpwalk将搜索以SNMPv2-SMI :: mib-2为根的子树(包括来自其他MIB模块的任何MIB对象值,定义为位于此子树内)
SNMPv2-SMI::mib-2
是1.3.6.1.2.1;您的私有树根本不属于“默认”选择。
如果您想要求特定信息,请索取具体信息。