Not to be fixed
Created: May 7, 2013
Updated: Apr 19, 2018
Resolved Date: Apr 17, 2018
Previous ID: LIN3-5553
Found In Version: 6.0
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Networking
Attempting to create a new entry with a zero index fails silently.
root@localhost:/root> snmpset -v 2c -c NETMAN 10.0.2.15 .1.3.6.1.6.3.12.1.2.1.9.0.25 i 5
SNMP-TARGET-MIB::snmpTargetAddrRowStatus.'..' = INTEGER: createAndWait(5)
root@localhost:/root> snmpget -v 2c -c NETMAN 10.0.2.15 .1.3.6.1.6.3.12.1.2.1.9.0.25 i 5
snmp_build: unknown failuresnmpget: Error building ASN.1 representation (Can't build OID for variable)
Notice that there is no error when setting, only when trying to get.
A possibly workaround would be to escape the zero like this:
.1.3.6.1.6.3.12.1.2.1.9.\'0.25\'
$ configure --enable-board=common_pc --enable-kernel=standard --enable-rootfs=glibc_std
$ make fs
Copy the attached files to the correct locations in export/dist/
/etc/snmp/snmpd.conf
/etc/sysconfig/snmpd
Boot the target.
$ make start-target
On the target, fix ownership of the added files
# chown root:root /etc/snmp/snmpd.conf
# chown root:root /etc/sysconfig/snmpd
Start the server:
# /etc/init.d/snmpd start
Starting snmpd: [ OK ]
Verify the server is working
# snmpwalk -v 2c -c NETMAN 10.0.2.15 .1.3.6.1.6.3
SNMPv2-MIB::snmpSetSerialNo.0 = INTEGER: 1288531134
SNMP-FRAMEWORK-MIB::snmpEngineID.0 = Hex-STRING: 80 00 1F 88 80 E1 B2 A5 6E E3 CE 88 51
SNMP-FRAMEWORK-MIB::snmpEngineBoots.0 = INTEGER: 1
SNMP-FRAMEWORK-MIB::snmpEngineTime.0 = INTEGER: 13911 seconds
SNMP-FRAMEWORK-MIB::snmpEngineMaxMessageSize.0 = INTEGER: 1500
SNMP-MPD-MIB::snmpUnknownSecurityModels.0 = Counter32: 0
SNMP-MPD-MIB::snmpInvalidMsgs.0 = Counter32: 0
SNMP-MPD-MIB::snmpUnknownPDUHandlers.0 = Counter32: 0
...
Add an entry (without a zero) to show working condition:
# snmpset -v 2c -c NETMAN 10.0.2.15 .1.3.6.1.6.3.12.1.2.1.9.116.101.115.116 i 5
SNMP-TARGET-MIB::snmpTargetAddrRowStatus.'test' = INTEGER: createAndWait(5)
# snmpget -v 2c -c NETMAN 10.0.2.15 .1.3.6.1.6.3.12.1.2.1.9.116.101.115.116
SNMP-TARGET-MIB::snmpTargetAddrRowStatus.'test' = INTEGER: notReady(3)
Now try with a zero, failing condition:
# snmpset -v 2c -c NETMAN 10.0.2.15 .1.3.6.1.6.3.12.1.2.1.9.0.25 i 5
SNMP-TARGET-MIB::snmpTargetAddrRowStatus.'..' = INTEGER: createAndWait(5)
# snmpget -v 2c -c NETMAN 10.0.2.15 .1.3.6.1.6.3.12.1.2.1.9.0.25 i 5
snmp_build: unknown failuresnmpget: Error building ASN.1 representation (Can't build OID for variable)