Jean.M.SCHMIDT@odot.state.or.us wrote:
> How do I know which instance relates to which interface?
Here is a way to do it:
If the INDEX variable is set to the index of the interface, and NODE is the
IP address or hostname of the node, this will return the name of the
interface:
snmpget $NODE .1.3.6.1.2.1.2.2.1.2.$INDEX
It used the interface description MIB.
If you want to get the IP address of the interface (assuming there is one -
there doesn't have to be!)
snmpwalk $NODE .1.3.6.1.2.1.4.20.1.2 | grep "INTEGER: $INDEX"\
| cut -d. -f5-8 | cut -f1 -d:
Hope that helps..
--
Ray Schafer | schafer@tkg.com
The Kernel Group | Distributed Systems Management
http://www.tkg.com
|