Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to query the MAC address of Ubuntu terminals. I remember that a few years ago I've used the OID .1.3.6.1.2.1.2.2.1.6.2 (IF-MIB::ifPhysAddress.2) to query OpenSUSE terminals.

This OID doesn't work with Ubuntu:

$ snmpget -v 2c -c public localhost .1.3.6.1.2.1.2.2.1.6.2
IF-MIB::ifPhysAddress.2 = No Such Object available on this agent at this OID

nor:

$ snmpget -v 2c -c public localhost .1.3.6.1.2.1.2.2.1.6
IF-MIB::ifPhysAddress = No Such Object available on this agent at this OID

It seems that all network interfaces are not available at all:

$ snmpwalk -v 2c -c public localhost .1.3.6.1.2.1.2
IF-MIB::interfaces = No more variables left in this MIB View (It is past the end of the MIB tree)

while if I do an snmpwalk starting from .1.3.6.1.2.1 (SNMPv2-SMI::mib-2) I get a few results.

Why? Is there something that I need to enable to get the MAC address?

I've checked and ifPhysAddress is defined in /usr/share/mibs/ietf/IF-MIB and MIBS seems correctly configured:

$ net-snmp-config --default-mibs | grep IF-MIB
:HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES:UCD-DLMOD-MIB:UCD-DISKIO-MIB:LM-SENSORS-MIB:IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB:NOTIFICATION-LOG-MIB:DISMAN-EVENT-MIB:DISMAN-SCHEDULE-MIB:UCD-SNMP-MIB:UCD-DEMO-MIB:SNMP-TARGET-MIB:NET-SNMP-AGENT-MIB:SNMP-FRAMEWORK-MIB:SNMP-MPD-MIB:SNMP-USER-BASED-SM-MIB:SNMP-VIEW-BASED-ACM-MIB:SNMP-COMMUNITY-MIB:IPV6-ICMP-MIB:IPV6-MIB:IPV6-TCP-MIB:IPV6-UDP-MIB:IP-FORWARD-MIB:NET-SNMP-EXTEND-MIB:SNMP-NOTIFICATION-MIB:SNMPv2-TM:NET-SNMP-VACM-MIB

The packages I've installed are:

ii  libsnmp-base          4.4.1~dfsg-12ubuntu7               SNMP (Simple Network Management Protocol) MIBs and documen
ii  libsnmp15             5.4.1~dfsg-12ubuntu7               SNMP (Simple Network Management Protocol) library
ii  snmp                  5.4.1~dfsg-12ubuntu7               SNMP (Simple Network Management Protocol) applications
ii  snmpd                 5.4.1~dfsg-12ubuntu7               SNMP (Simple Network Management Protocol) agents

Update:

Below there's the snmpd.conf of the target machines:

com2sec paranoid  default         public
group MyROSystem v1        paranoid
group MyROSystem v2c       paranoid
group MyROSystem usm       paranoid
group MyROGroup v1         readonly
group MyROGroup v2c        readonly
group MyROGroup usm        readonly
group MyRWGroup v1         readwrite
group MyRWGroup v2c        readwrite
group MyRWGroup usm        readwrite
view all    included  .1                               80
view system included  .iso.org.dod.internet.mgmt.mib-2.system
access MyROSystem ""     any       noauth    exact  system none   none
access MyROGroup ""      any       noauth    exact  all    none   none
access MyRWGroup ""      any       noauth    exact  all    all    none
syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
share|improve this question
    
Do you have access to this part of the tree on the receiving side? Can you post the snmpd.conf from one of the servers (minus comments and blank lines) –  Paul May 22 '12 at 5:30
    
@Paul I've just updated the question with the config file –  alexyz78 May 23 '12 at 5:33

1 Answer 1

up vote 1 down vote accepted

The public community string maps to the paranoid group, which maps to the MyROSystem access, which allows visibility of the system view. Can you change:

com2sec paranoid  default         public

to read

com2sec readonly  default         public

This will map it to readonly and give it the whole tree.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.