Skip to main content

Some commonly used OIDs

·5 mins
Rs
Rory
Author
Rory
Step by step the ladder is ascended
Table of Contents

This artical will recording some commonly used OIDs, like memory usege,interface counters.

写在最前面
#

对于 OID 着类查询,其实没有什么很好的方法,最主要的就是多 Google 一下,多尝试用工具 get 几个值看一下.请搜索 snmpwalk 这个小工具,windows 和 linux 版本都有.Linux 如何安装参考如下:

[root@localhost ~]# yum install net-snmp-utils

你可能需要的几个网址:

  • 查 OID 意思的网址

http://cric.grenoble.cnrs.fr/Administrateurs/Outils/MIBS/?oid=1.3.6.1.2.1.138.1.10.1.1

http://snmp.cloudapps.cisco.com/Support/SNMP/do/BrowseOID.do?local=en «< CISCO 官方的网址

  • 有关 cisco 产品所支持的 MIB 库.

ftp://ftp.cisco.com/pub/mibs/supportlists/

#show snmp mib object-name | inc <oid>  <<查看某个oid在9k上是否支持

接口相关的 OID
#

ifAdminStatus 1.3.6.1.2.1.2.2.1.7  <<<<<  端口管理状态 up/down
ifOperStatus 1.3.6.1.2.1.2.2.1.8   <<<< 端口运行状态   up/down
MAC 1.3.6.1.2.1.2.2.1.6            <<<< 端口mac地址
ifInOctets 1.3.6.1.2.1.2.2.1.10    <<<<端口如方向流量字节总数
ifHCInOctets    <<<< 接口字节总数  64bit , 建议使用这个 32bit 的有点问题
ifHCOutOctets
ifOutOctets 1.3.6.1.2.1.2.2.1.16   <<<<端口出方向字节总数
ifSpeed 1.3.6.1.2.1.2.2.1.5        <<<<端口带宽
ifDescr 1.3.6.1.2.1.2.2.1.2        <<<<端口名称
ifxAlias 1.3.6.1.2.1.31.1.1.1.18   <<<<端口别名/即端口description

Show interface 下的 last link flap 时间 #

RP/0/RP0/CPU0:CORE6-ASR9922-A#show int hundredGigE 0/0/0/6 | in flapped
Tue Nov 27 21:07:00.288 UTC
  Last link flapped 01:07:40

We need following OID

1.3.6.1.2.1.2.2.1.2          ifDescr                              <<< get interface name and ifindex
1.3.6.1.2.1.2.2.1.9          ifLastChange                    <<< get the time of sysUpTime when interface state change
1.3.6.1.2.1.1.3.0              sysUpTimeInstance        <<< get sysUpTime

So Last link flapped time should be ( sysUpTimeInstance – ifLastChange )

For example:

[root@xuxing ~]# snmpwalk -v 2c -c cisco 10.75.49.13 1.3.6.1.2.1.2.2.1.2 | grep 0/0/0/6
IF-MIB::ifDescr.104 = STRING: HundredGigE0/0/0/6
[root@xuxing ~]# snmpwalk -v 2c -c cisco 10.75.49.13 1.3.6.1.2.1.2.2.1.9.104
IF-MIB::ifLastChange.104 = Timeticks: (9460) 0:01:34.60                                                           <<<
[root@xuxing ~]# snmpwalk -v 2c -c cisco 10.75.49.13 1.3.6.1.2.1.1.3.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (419819) 1:09:58.19                             <<<

1:09:58:19  - 0:01:34:60 = 1:08:24:00   same as above output

Show interface 下的 CRC 计数
#

RP/0/RSP0/CPU0:ASR9006-F#                 show int tenGigE 1/0/0/1 | in CRC
Tue Dec 18 18:55:53.560 UTC
     559851 input errors, 55 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
RP/0/RSP0/CPU0:ASR9006-F#

we need following OID

1.3.6.1.2.1.2.2.1.2                  ifDescr
1.3.6.1.2.1.10.7.11.1.2          dot3HCStatsFCSErrors

[root@xuxing ~]# snmpwalk -v 2c -c cisco 10.75.49.35 1.3.6.1.2.1.2.2.1.2 | grep TenGigE1/0/0/1            <<< get ifindex and ifname
IF-MIB::ifDescr.375 = STRING: TenGigE1/0/0/1
[root@xuxing ~]# snmpwalk -v 2c -c cisco 10.75.49.35 1.3.6.1.2.1.10.7.11.1.2.375                               <<<get CRC counter
EtherLike-MIB::dot3HCStatsFCSErrors.375 = Counter64: 55

监控板卡的 memory 使用情况
#

*if the LC memeory smaller than 4G,you can use below OID to check the memeory usage *
ciscoMemoryPoolUsed: 1.3.6.1.4.1.9.9.48.1.1.1.5
ciscoMemoryPoolFree: 1.3.6.1.4.1.9.9.48.1.1.1.6
*if the LC memeory bigger than 4G, use below OID*
cempMemPoolHCUsed: 1.3.6.1.4.1.9.9.221.1.1.1.1.18     <<< memory LC used
cempMemPoolHCFree: 1.3.6.1.4.1.9.9.221.1.1.1.1.20      <<< memory free
For example:
1.	Get the memory used.
[root@localhost ~]# snmpwalk -v 2c -c cisco 10.75.49.54 1.3.6.1.4.1.9.9.221.1.1.1.1.18
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.18.18788073.1 = Counter64: 2836322328
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.18.18788073.2 = Counter64: 134217728
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.18.18788073.3 = Counter64: 74158304

SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.18.52690955.1 = Counter64: 2167614624
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.18.52690955.2 = Counter64: 134217728
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.18.52690955.3 = Counter64: 73829464

2.	Get the memory free.

[root@localhost ~]# snmpwalk -v 2c -c cisco 10.75.49.54 1.3.6.1.4.1.9.9.221.1.1.1.1.20
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.20.18788073.1 = Counter64: 5544935424
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.20.18788073.2 = Counter64: 0
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.20.18788073.3 = Counter64: 0

SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.20.52690955.1 = Counter64: 6213971968
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.20.52690955.2 = Counter64: 0
SNMPv2-SMI::enterprises.9.9.221.1.1.1.1.20.52690955.3 = Counter64: 0

3.	Get the LC type.

[root@localhost ~]# snmpwalk -v 2c -c cisco 10.75.49.54 1.3.6.1.2.1.47.1.1.1.1.7 | grep 18788073
SNMPv2-SMI::mib-2.47.1.1.1.1.7.18788073 = STRING: "module 0/0/CPU0"
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# snmpwalk -v 2c -c cisco 10.75.49.54 1.3.6.1.2.1.47.1.1.1.1.7 | grep 52690955
SNMPv2-SMI::mib-2.47.1.1.1.1.7.52690955 = STRING: "module 0/RSP0/CPU0"
[root@localhost ~]#

RP/0/RSP0/CPU0:ASR9001-B#show memory summary location all
Thu Apr  4 05:28:16.085 UTC

node:      node0_0_CPU0
------------------------------------------------------------------
Physical Memory: 8192M total
Application Memory : 7992M (5288M available)
Image: 70M (bootram: 70M)
Reserved: 128M, IOMem: 0, flashfsys: 0
Total shared window: 128M

node:      node0_RSP0_CPU0
------------------------------------------------------------------
Physical Memory: 8192M total (5923M available)
Application Memory : 7993M (5923M available)
Image: 70M (bootram: 70M)
Reserved: 128M, IOMem: 0, flashfsys: 0
Total shared window: 41M

监控板卡的 CPU 利用率
#

>1.3.6.1.4.1.9.9.109.1.1.1.1.7 cpmCPUTotal1minRev                   <<<1min
>1.3.6.1.4.1.9.9.109.1.1.1.1.8 cpmCPUTotal5minRev                   <<<5min


[root@localhost ~]# snmpwalk -v 2c -c cisco 10.75.39.20 1.3.6.1.4.1.9.9.109.1.1.1.1
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2 = INTEGER: 52690955         <<<  this is card type
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.18 = INTEGER: 26932192
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2082 = INTEGER: 18788073
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.2.2098 = INTEGER: 8695772
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.7.2 = Gauge32: 2   <<<<
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.7.18 = Gauge32: 1
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.7.2082 = Gauge32: 2
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.7.2098 = Gauge32: 4
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.8.2 = Gauge32: 2   <<<<
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.8.18 = Gauge32: 1
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.8.2082 = Gauge32: 2
SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.8.2098 = Gauge32: 4

[root@localhost ~]# snmpwalk -v 2c -c cisco 10.75.39.20 1.3.6.1.2.1.47.1.1.1.1.7  | grep 52690955
SNMPv2-SMI::mib-2.47.1.1.1.1.7.52690955 = STRING: "module 0/RSP0/CPU0"            <<<<
[root@localhost ~]#

Fan Speed
#

[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.2.1.47.1.1.1.1.7 | grep  speed                           <<<get sensor
SNMPv2-SMI::mib-2.47.1.1.1.1.7.6869781 = STRING: "speed 0/FT1/SP"
[root@xuxing ~]#
[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.2.1.47.1.1.1.1.4.6869781                     <<<获得这个传感器name的ID
SNMPv2-SMI::mib-2.47.1.1.1.1.4.6869781 = INTEGER: 18859810
[root@xuxing ~]#
[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.2.1.47.1.1.1.1.7.18859810                   <<<使用上面的传感器id获得name为小风扇fan2 FT1
SNMPv2-SMI::mib-2.47.1.1.1.1.7.18859810 = STRING: "fan2 0/FT1/SP"
[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9  1.3.6.1.4.1.9.9.91.1.1.1.1.4.6869781                            <<<获得转速
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.6869781 = INTEGER: 4440

Fan State
#

[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.2.1.47.1.1.1.1.7 | grep  fantray
SNMPv2-SMI::mib-2.47.1.1.1.1.7.25315280 = STRING: "fantray 0/FT1/SP"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.59316821 = STRING: "fantray 0/FT0/SP"
[root@xuxing ~]#
[root@xuxing ~]#
[root@xuxing ~]#
[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.4.1.9.9.117.1.4.1.1.1.25315280          <<<<获得FAN tray的状态,2表示是正常的
SNMPv2-SMI::enterprises.9.9.117.1.4.1.1.1.25315280 = INTEGER: 2
[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.4.1.9.9.117.1.4.1.1.1.59316821
SNMPv2-SMI::enterprises.9.9.117.1.4.1.1.1.59316821 = INTEGER: 2
[root@xuxing ~]#

Power moudle state
#

[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.2.1.47.1.1.1.1.7 | grep power-module
SNMPv2-SMI::mib-2.47.1.1.1.1.7.36029366 = STRING: "power-module 0/PS1/M3/SP"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.39915627 = STRING: "power-module 0/PS0/M3/SP"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.65324228 = STRING: "power-module 0/PS1/M0/SP"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.66531208 = STRING: "power-module 0/PS0/M0/SP"

[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.4.1.9.9.117.1.1.2.1.2.36029366          <<<获得Power module的状态,2表示正常的
SNMPv2-SMI::enterprises.9.9.117.1.1.2.1.2.36029366 = INTEGER: 2
[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.4.1.9.9.117.1.1.2.1.2.39915627
SNMPv2-SMI::enterprises.9.9.117.1.1.2.1.2.39915627 = INTEGER: 2
[root@xuxing ~]#

Temperatures
#

[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.2.1.47.1.1.1.1.7 | grep temperature | grep 0/RSP0/CPU0        <<<取得温度传感器对应的值
SNMPv2-SMI::mib-2.47.1.1.1.1.7.12004356 = STRING: "temperature 0/RSP0/CPU0"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.12005976 = STRING: "temperature 0/RSP0/CPU0"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.28781969 = STRING: "temperature 0/RSP0/CPU0"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.28783653 = STRING: "temperature 0/RSP0/CPU0"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.45559678 = STRING: "temperature 0/RSP0/CPU0"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.45561266 = STRING: "temperature 0/RSP0/CPU0"
SNMPv2-SMI::mib-2.47.1.1.1.1.7.62337227 = STRING: "temperature 0/RSP0/CPU0"
[root@xuxing ~]#
[root@xuxing ~]#
[root@xuxing ~]#
[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.2.1.47.1.1.1.1.4.12004356                                                              <<<根据传感器的值获得name对应的ID
SNMPv2-SMI::mib-2.47.1.1.1.1.4.12004356 = INTEGER: 38557239
[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.2.1.47.1.1.1.1.2.38557239
SNMPv2-SMI::mib-2.47.1.1.1.1.2.38557239 = STRING: "RSP Card host "
[root@xuxing ~]# snmpwalk -v 2c -c public 10.75.49.9 1.3.6.1.4.1.9.9.91.1.1.1.1.4.12004356                                                              <<<获得传感器下对应的CPU温度
SNMPv2-SMI::enterprises.9.9.91.1.1.1.1.4.12004356 = INTEGER: 340
[root@xuxing ~]#


0/RSP0/*
        host    die_CPU                 34.0                   <<<<      对应这个温度.
        host    die_FabArbiter0         35.0
        host    die_FIA                 38.0
        host    die_PCH                 41.0
        host    die_DIMM0               33.0
        host    die_DIMM1               33.0

TIPs
#

- 请添加SystemOwner的权限,要不然一些Fan speed之类的传感器的OID获得不到。
>snmp-server community cisco RW SystemOwner

- 请安装mgbl的PIE,要不然一些板卡,风扇的OID会获得不到。
>disk0:asr9k-mgbl-px-6.3.3



Comments