无法使用Ubuntu中的snmp查询从MIB-II的接口组获取数据

时间:2022-01-25 01:16:42

Two machines running Ubuntu. One is running on Virtualbox inside the other.

运行Ubuntu的两台机器。一个在另一个内部运行Virtualbox。

Using the following command in the VM (get number of interfaces):

在VM中使用以下命令(获取接口数):

snmpget -v 2c -c public localhost 1.3.6.1.2.1.2.1.0

I get the following result:

我得到以下结果:

iso.3.6.1.2.1.2.1.0 = INTEGER: 2

But, if I do it in the host (query to the VM):

但是,如果我在主机中执行此操作(查询VM):

snmpget -v 2c -c public 10.1.14 1.3.6.1.2.1.2.1.0

I get:

iso.3.6.1.2.1.2.1.0 = No Such Object available on this agent at this OID

I can do SNMP queries to objects of System Group, but cannot do SNMP queries to objects of Interfaces Group.

我可以对系统组的对象进行SNMP查询,但不能对Interfaces Group的对象进行SNMP查询。

The machine is running Ubuntu 12.10 and the VM is running Ubuntu 12.04.

机器正在运行Ubuntu 12.10,VM正在运行Ubuntu 12.04。

1 个解决方案

#1


0  

Maybe because the /etc/cups/snmp.conf problem ,different Linux has the problem with the snmp.conf,more new Linux ,more problem maybe you will have,you can copy this

也许是因为/etc/cups/snmp.conf问题,不同的Linux有snmp.conf的问题,更多的新Linux,也许你会有更多的问题,你可以复制这个

    com2sec notConfigUser  127.0.0.1       public
    group   notConfigGroup v1           notConfigUser
    group   notConfigGroup v2c           notConfigUser
    view    systemview    included   .1.3.6.1.2.1.1
    view    systemview    included   .1.3.6.1.2.1.25.1.1
    access  notConfigGroup ""      any       noauth    exact  all none none
    view all    included  .1                               80

to your /etc/cups/snmp.conf ,I have the problem before,and solved this problem by this way.

到你的/etc/cups/snmp.conf,之前我遇到了问题,并通过这种方式解决了这个问题。

#1


0  

Maybe because the /etc/cups/snmp.conf problem ,different Linux has the problem with the snmp.conf,more new Linux ,more problem maybe you will have,you can copy this

也许是因为/etc/cups/snmp.conf问题,不同的Linux有snmp.conf的问题,更多的新Linux,也许你会有更多的问题,你可以复制这个

    com2sec notConfigUser  127.0.0.1       public
    group   notConfigGroup v1           notConfigUser
    group   notConfigGroup v2c           notConfigUser
    view    systemview    included   .1.3.6.1.2.1.1
    view    systemview    included   .1.3.6.1.2.1.25.1.1
    access  notConfigGroup ""      any       noauth    exact  all none none
    view all    included  .1                               80

to your /etc/cups/snmp.conf ,I have the problem before,and solved this problem by this way.

到你的/etc/cups/snmp.conf,之前我遇到了问题,并通过这种方式解决了这个问题。