0

hrStorageIndex and ifIndex may changed after reboot sometimes.

How to identify a specific disk and network interface in SNMP, both under Linux and windows?

k1eran
  • 4,492
  • 8
  • 50
  • 73
BlackJoker
  • 3,099
  • 2
  • 20
  • 27

1 Answers1

1

There are columns for hrStorageDescr and hrStorageType in the HOST-RESOURCES-MIB::hrStorageTable table.

Here is an example ...

snmptable -M +.  -m +ALL -v 2c -Ci -c public -Pu myhost HOST-RESOURCES-MIB::hrStorageTable
SNMP table: HOST-RESOURCES-MIB::hrStorageTable

 index hrStorageIndex                                hrStorageType  hrStorageDescr hrStorageAllocationUnits hrStorageSize hrStorageUsed hrStorageAllocationFailures
     1              1           HOST-RESOURCES-TYPES::hrStorageRam Physical memory               1024 Bytes       8057980       7268792                           ?
     3              3 HOST-RESOURCES-TYPES::hrStorageVirtualMemory  Virtual memory               1024 Bytes      18347124       7687064                           ?
     6              6         HOST-RESOURCES-TYPES::hrStorageOther  Memory buffers               1024 Bytes       8057980        124288                           ?
     7              7         HOST-RESOURCES-TYPES::hrStorageOther   Cached memory               1024 Bytes       2366160       2366160                           ?
    10             10 HOST-RESOURCES-TYPES::hrStorageVirtualMemory      Swap space               1024 Bytes      10289144        418272                           ?
    31             31     HOST-RESOURCES-TYPES::hrStorageFixedDisk               /               4096 Bytes      12901535      11461911                           ?
    35             35     HOST-RESOURCES-TYPES::hrStorageFixedDisk        /dev/shm               4096 Bytes       1007247             0                           ?
    36             36     HOST-RESOURCES-TYPES::hrStorageFixedDisk           /boot               1024 Bytes        495844        100151                           ?
    37             37     HOST-RESOURCES-TYPES::hrStorageFixedDisk           /home               4096 Bytes      44531330       5981531                           ?

Same principle for IF-MIB::ifTable which has a ifDescr column ...

snmptable -M +.  -m +ALL -v 2c -Ci -c public -Pu myhost IF-MIB::ifTable
SNMP table: IF-MIB::ifTable

 index ifIndex ifDescr           ifType ifMtu    ifSpeed    ifPhysAddress ifAdminStatus ifOperStatus ifLastChange ifInOctets ifInUcastPkts ifInNUcastPkts ifInDiscards ifInErrors ifInUnknownProtos ifOutOctets ifOutUcastPkts ifOutNUcastPkts ifOutDiscards ifOutErrors ifOutQLen              ifSpecific
     1       1      lo softwareLoopback 16436   10000000                             up           up 0:0:00:00.00  723382401     729363414              0            0          0                 0   723382401      729363414               0             0           0         0 SNMPv2-SMI::zeroDotZero
     2       2    eth0   ethernetCsmacd  1500 1000000000 0:21:5e:4d:15:b7            up           up 0:0:00:00.00 1030103587      37542077        3449194            0          0                 0  1570760541       32130390               0             0           0         0 SNMPv2-SMI::zeroDotZero
     3       3    eth1   ethernetCsmacd  1500          0 0:21:5e:4d:15:b8          down         down 0:0:00:00.00          0             0              0            0          0                 0           0              0               0             0           0         0 SNMPv2-SMI::zeroDotZero
k1eran
  • 4,492
  • 8
  • 50
  • 73