Issuing queries
You can issue queries against your SNMP setup.
About this task
The commands can use either numeric or textual OIDs. While the numeric OIDs might provide better performance, the textual OIDs are more meaningful and give a hint about which information is requested.
Examples
The query examples assume an interface, encf500, for which the CHPID is 6B. You can use the lsqeth command to find the mapping of interface names to CHPIDs.- To list the ifIndex and interface description relation (on one
line):
Using this GET request you can see that encf500 has the ifIndex 6 assigned.# snmpget -v 2c -c osacom localhost interfaces.ifTable.ifEntry.ifDescr.6 interfaces.ifTable.ifEntry.ifDescr.6 = encf500
- To find the CHPID numbers for your OSA devices:
The first line of the command output, with index number 6, corresponds to CHPID 0x6B of the encf500 example. The example assumes that the community osacom is authorized as described in Configuring access control (snmp.conf).# snmpwalk -OS -v 2c -c osacom localhost .1.3.6.1.4.1.2.6.188.1.1.1.1 IBM-OSA-MIB::ibmOSAExpChannelNumber.6 = Hex-STRING: 00 6B IBM-OSA-MIB::ibmOSAExpChannelNumber.7 = Hex-STRING: 00 7A IBM-OSA-MIB::ibmOSAExpChannelNumber.8 = Hex-STRING: 00 7D
If you provided defaults for the SNMP version and the community (see step 12), you can omit the -v and -c options:# snmpwalk -OS localhost .1.3.6.1.4.1.2.6.188.1.1.1.1 IBM-OSA-MIB::ibmOSAExpChannelNumber.6 = Hex-STRING: 00 6B IBM-OSA-MIB::ibmOSAExpChannelNumber.7 = Hex-STRING: 00 7A IBM-OSA-MIB::ibmOSAExpChannelNumber.8 = Hex-STRING: 00 7D
You can obtain the same output by substituting the numeric OID .1.3.6.1.4.1.2.6.188.1.1.1.1 with its textual equivalent (to be specified on a single line):.iso.org.dod.internet.private.enterprises.ibm. ibmProd.ibmOSAMib.ibmOSAMibObjects.ibmOSAExpChannelTable. ibmOSAExpChannelEntry.ibmOSAExpChannelNumber
You can shorten this unwieldy OID to the last element, ibmOsaExpChannelNumber:# snmpwalk -OS localhost ibmOsaExpChannelNumber IBM-OSA-MIB::ibmOSAExpChannelNumber.6 = Hex-STRING: 00 6B IBM-OSA-MIB::ibmOSAExpChannelNumber.7 = Hex-STRING: 00 7A IBM-OSA-MIB::ibmOSAExpChannelNumber.8 = Hex-STRING: 00 7D
- To find the port type for the interface with index number 6:
fastEthernet(81) corresponds to card type OSD_100.# snmpwalk -OS localhost .1.3.6.1.4.1.2.6.188.1.4.1.2.6 IBM-OSA-MIB::ibmOsaExpEthPortType.6 = INTEGER: fastEthernet(81)
Using the short form of the textual OID:
Specifying the index, 6 in the example, limits the output to the interface of interest.# snmpwalk -OS localhost ibmOsaExpEthPortType.6 IBM-OSA-MIB::ibmOsaExpEthPortType.6 = INTEGER: fastEthernet(81)