2017年4月20日 星期四

四論 SNMP OIDs

基礎入門

(1)利用SNMP OIDs 加入 Zabbix 監控
http://xrcd2.blogspot.tw/2012/10/snmp-oids-zabbix.html

(2)再論 SNMP OIDs
http://xrcd2.blogspot.tw/2012/10/snmp-oid.html

(3)三論 SNMP OIDs
http://xrcd2.blogspot.tw/2016/11/snmp-oids.html

(4)四論 SNMP OIDs


本文開始


縁起於 http://www.netadmin.com.tw/article_content.aspx?sn=1702080002
網管人-技術專欄
2017/2/15
透過SNMP Query Index協助管理 資源流量圖表自動產出
Cacti監控報表圖多不愁 批次抓取設備資料繪製
丁光立

因為想多學一點 Cacti 的技巧,所以參考了上述文章,一些觀念,寫成這個小筆記供需要
的人參考,但本文會著重於 Linux (CentOS) 的 snmp 實用指令簡介及運用與
 snmp.conf 的撰寫參考等等.建議在閱讀本文之前,可看參考上述基本門,強化
 snmp 基本觀念.


(1) linux (  CentOS ) snmpd.conf
詳細設定可參考
http://net-snmp.sourceforge.net/docs/man/snmpd.conf.html

為方便使用可參考如下設定,請抄改成個人的使用環境配置.

[root@bbb /]# cat /etc/snmp/snmpd.conf

rocommunity public

#這一行是宣告 MIB 檔的目錄.
#MIBDIRS /usr/share/snmp/mibs:/usr/share/snmp/private-mibs
#這一行是宣告載入所有的 MIB 檔
#MIBS all

#宣告使用 CHECK-R77-MIB及CISCO-QOS-PIB-MIB
mibs +CHECK-R77-MIB:CISCO-QOS-PIB-MIB
#宣告使用 CISCO-MEMORY-POOL-MIB
mibs +CISCO-MEMORY-POOL-MIB

#另一種宣告方式

mibfile /usr/share/snmp/mibs/CHECK-R77-MIB.txt

#其它資訊

sysLocation vlab
sysContact wwww.vlab.com.tw
sysName Cacti

# 其它參考資訊如下 URL
# http://www.net-snmp.org/FAQ.html#How_do_I_add_a_MIB_
# 系統預設的 mibs 的目錄為 /usr/share/snmp/mibs 可將自行下載的 mib 檔放置於此目錄內.


測試一下 本機 liunx 的系統資訊

[root@bbb /]# snmpwalk -v2c -c public localhost system
SNMPv2-MIB::sysDescr.0 = STRING: Linux www.vlab.com.tw 2.6.32-642.11.1.el6.x86_64 #1 SMP Fri Nov 18 19:25:05 UTC 2016 x86_64
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (11265) 0:01:52.65
SNMPv2-MIB::sysContact.0 = STRING: wwww.vlab.com.tw
SNMPv2-MIB::sysName.0 = STRING: Cacti
SNMPv2-MIB::sysLocation.0 = STRING: vlab
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORID.1 = OID: SNMP-MPD-MIB::snmpMPDMIBObjects.3.1.1
SNMPv2-MIB::sysORID.2 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance
SNMPv2-MIB::sysORID.3 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.5 = OID: TCP-MIB::tcpMIB
SNMPv2-MIB::sysORID.6 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: UDP-MIB::udpMIB
SNMPv2-MIB::sysORID.8 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.3 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.7 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.8 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (3) 0:00:00.03
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (3) 0:00:00.03
[root@bbb /]#


===================================================

Cisco 設備啟用 snmp 服務


Router#sh run 
.....
.....
!
!
snmp-server community public RO
!
!
....
.....

Router#sh ver 
Cisco IOS XE Software, Version 03.10.02.S - Extended Support Release
Cisco IOS Software, CSR1000V Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 15.3(3)S2, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2014 by Cisco Systems, Inc.
Compiled Fri 31-Jan-14 20:10 by mcpre
.....


Router#show memory 
                Head    Total(b)     Used(b)     Free(b)   Lowest(b)  Largest(b)
Processor  7F4216AD6010   2232382384   195274364   2037108020   2036934440   1332474908
 lsmpi_io  7F41C34CE1A8     6295128     6294304         824         824         412


=================================================


測試一下 Cisco 設備的系統資訊

[root@bbb /]# snmpwalk -v2c -c public 192.168.111.158 system
SNMPv2-MIB::sysDescr.0 = STRING: Cisco IOS Software, CSR1000V Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 15.3(3)S2, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2014 by Cisco Systems, Inc.
Compiled Fri 31-Jan-14 20:10 by mcpre
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.9.1.1537
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (10206994) 1 day, 4:21:09.94
SNMPv2-MIB::sysContact.0 = STRING: 
SNMPv2-MIB::sysName.0 = STRING: Router
SNMPv2-MIB::sysLocation.0 = STRING: 
SNMPv2-MIB::sysServices.0 = INTEGER: 78
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00



(2)使用 export MIBS , 以 CISCO-MEMORY-POOL-MIB 為例


[root@bbb /]# MIBS=+CISCO-MEMORY-POOL-MIB
[root@bbb /]# export MIBS


[root@bbb /]#   snmpwalk -c public -v2c     192.168.111.158   .1.3.6.1.4.1.9.9.48
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.1 = STRING: Processor
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.14 = STRING: lsmpi_io
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolAlternate.1 = INTEGER: 0
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolAlternate.14 = INTEGER: 0
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolValid.1 = INTEGER: true(1)
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolValid.14 = INTEGER: true(1)
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.1 = Gauge32: 195206240 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.14 = Gauge32: 6294296 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.1 = Gauge32: 2037176144 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.14 = Gauge32: 832 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolLargestFree.1 = Gauge32: 1332474908 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolLargestFree.14 = Gauge32: 412 bytes


(3) 未使用 CISCO-MEMORY-POOL-MIB


[root@bbb /]#  snmpwalk -c public -v2c     192.168.111.158   .1.3.6.1.4.1.9.9.48
SNMPv2-SMI::enterprises.9.9.48.1.1.1.2.1 = STRING: "Processor"
SNMPv2-SMI::enterprises.9.9.48.1.1.1.2.14 = STRING: "lsmpi_io"
SNMPv2-SMI::enterprises.9.9.48.1.1.1.3.1 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.48.1.1.1.3.14 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.48.1.1.1.4.1 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.48.1.1.1.4.14 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.48.1.1.1.5.1 = Gauge32: 195206240
SNMPv2-SMI::enterprises.9.9.48.1.1.1.5.14 = Gauge32: 6294296
SNMPv2-SMI::enterprises.9.9.48.1.1.1.6.1 = Gauge32: 2037176144
SNMPv2-SMI::enterprises.9.9.48.1.1.1.6.14 = Gauge32: 832
SNMPv2-SMI::enterprises.9.9.48.1.1.1.7.1 = Gauge32: 1332474908
SNMPv2-SMI::enterprises.9.9.48.1.1.1.7.14 = Gauge32: 412

一般而言,有導入使用 MIB 檔會比較方便閱讀與理解.


(4)透過 load mib 參數



[root@bbb/]# snmpwalk -c public -v2c 192.168.111.158 CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolMIB
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.1 = STRING: Processor
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.14 = STRING: lsmpi_io
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolAlternate.1 = INTEGER: 0
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolAlternate.14 = INTEGER: 0
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolValid.1 = INTEGER: true(1)
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolValid.14 = INTEGER: true(1)
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.1 = Gauge32: 195216024 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.14 = Gauge32: 6294296 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.1 = Gauge32: 2037166360 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.14 = Gauge32: 832 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolLargestFree.1 = Gauge32: 1332474908 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolLargestFree.14 = Gauge32: 412 bytes




[root@bbb /]# snmpwalk -c public -v2c  -m CISCO-MEMORY-POOL-MIB   192.168.111.158   .1.3.6.1.4.1.9.9.48
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.1 = STRING: Processor
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.14 = STRING: lsmpi_io
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolAlternate.1 = INTEGER: 0
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolAlternate.14 = INTEGER: 0
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolValid.1 = INTEGER: true(1)
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolValid.14 = INTEGER: true(1)
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.1 = Gauge32: 195216016 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.14 = Gauge32: 6294296 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.1 = Gauge32: 2037166368 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.14 = Gauge32: 832 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolLargestFree.1 = Gauge32: 1332474908 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolLargestFree.14 = Gauge32: 412 bytes


(5) OIDs 表示法

[root@bbb /]#  snmpwalk -c public -v2c  192.168.111.158 .iso.org.dod.internet.private.enterprises.cisco.ciscoMgmt.ciscoMemoryPoolMIB

CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.1 = STRING:  Processor
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.14 = STRING: lsmpi_io
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolAlternate.1 = INTEGER: 0
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolAlternate.14 = INTEGER: 0
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolValid.1 = INTEGER: true(1)
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolValid.14 = INTEGER: true(1)
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.1 = Gauge32: 195210248 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.14 = Gauge32: 6294296 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.1 = Gauge32: 2037172136 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.14 = Gauge32: 832 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolLargestFree.1 = Gauge32: 1332474908 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolLargestFree.14 = Gauge32: 412 bytes
[root@bbb /]#

如未載入  CISCO-MEMORY-POOL-MIB

[root@bbb /]# snmpwalk -c public -v2c  192.168.111.158 .iso.org.dod.internet.private.enterprises.cisco.ciscoMgmt.ciscoMemoryPoolMIB

No log handling enabled - turning on stderr logging
.iso.org.dod.internet.private.enterprises.cisco.ciscoMgmt.ciscoMemoryPoolMIB: Unknown Object Identifier (Sub-id not found: enterprises -> cisco)

[root@bbb /]#

改用數字

[root@bbb /]#  snmpwalk -c public -v2c     192.168.111.158   .1.3.6.1.4.1.9.9.48
SNMPv2-SMI::enterprises.9.9.48.1.1.1.2.1 = STRING: "Processor"
SNMPv2-SMI::enterprises.9.9.48.1.1.1.2.14 = STRING: "lsmpi_io "
SNMPv2-SMI::enterprises.9.9.48.1.1.1.3.1 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.48.1.1.1.3.14 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.48.1.1.1.4.1 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.48.1.1.1.4.14 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.48.1.1.1.5.1 = Gauge32: 195210248
SNMPv2-SMI::enterprises.9.9.48.1.1.1.5.14 = Gauge32: 6294296
SNMPv2-SMI::enterprises.9.9.48.1.1.1.6.1 = Gauge32: 2037172136
SNMPv2-SMI::enterprises.9.9.48.1.1.1.6.14 = Gauge32: 832
SNMPv2-SMI::enterprises.9.9.48.1.1.1.7.1 = Gauge32: 1332474908
SNMPv2-SMI::enterprises.9.9.48.1.1.1.7.14 = Gauge32: 412
[root@bbb snmp]#


(6)  snmptranslate

可參考 http://net-snmp.sourceforge.net/tutorial/tutorial-5/commands/mib-options.html


[root@bbb /]#  snmptranslate  1.3.6.1.4.1.9.9.48
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolMIB
[root@bbb /]#


未載入  CISCO-MEMORY-POOL-MIB

[root@bbb /]#  snmptranslate  1.3.6.1.4.1.9.9.48
SNMPv2-SMI::enterprises.9.9.48

[root@bbb /]#  snmptranslate  -IR -On ciscoMemoryPoolMIB
Unknown object identifier: ciscoMemoryPoolMIB
[root@bbb /]#

指定載入  CISCO-MEMORY-POOL-MIB

[root@bbb /]#  snmptranslate -m CISCO-MEMORY-POOL-MIB  -IR -Onf ciscoMemoryPoolMIB
.iso.org.dod.internet.private.enterprises.cisco.ciscoMgmt.ciscoMemoryPoolMIB

或預設載入  CISCO-MEMORY-POOL-MIB

[root@bbb /]# snmptranslate  -IR -On ciscoMemoryPoolMIB
.1.3.6.1.4.1.9.9.48

[root@bbb /]# snmptranslate  .1.3.6.1.4.1.9.9.48
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolMIB
[root@bbb /]#

OIDs 的二種表示法

[root@bbb /]# snmptranslate  -IR -Onf ciscoMemoryPoolMIB
.iso.org.dod.internet.private.enterprises.cisco.ciscoMgmt.ciscoMemoryPoolMIB

[root@bbb /]# snmptranslate  -IR -On ciscoMemoryPoolMIB
.1.3.6.1.4.1.9.9.48
[root@bbb /]#

(7)SNMP OIDs Tree [ CISCO-MEMORY-POOL-MIB  ]

[root@bbb /]# snmptranslate -Tp -m  CISCO-MEMORY-POOL-MIB  
+--iso(1)
   |
   +--org(3)
      |
      +--dod(6)
         |
         +--internet(1)
            |
            +--directory(1)
            |
            +--mgmt(2)
            |  |
            |  +--mib-2(1)
            |     |
            |     +--transmission(10)
            |
            +--experimental(3)
            |
            +--private(4)
            |  |
            |  +--enterprises(1)
            |     |
            |     +--cisco(9)
            |        +--ciscoProducts(1)
            |        +--local(2)
            |        +--temporary(3)
            |        +--pakmon(4)
            |        +--workgroup(5)
            |        +--otherEnterprises(6)
            |        |  +--ciscoSB(1)
            |        |  +--ciscoSMB(2)
            |        |
            |        +--ciscoAgentCapability(7)
            |        +--ciscoConfig(8)
            |        +--ciscoMgmt(9)
            |        |  +--ciscoMemoryPoolMIB(48)
            |        |     |
            |        |     +--ciscoMemoryPoolObjects(1)
            |        |     |  |
            |        |     |  +--ciscoMemoryPoolTable(1)
            |        |     |  |  |
            |        |     |  |  +--ciscoMemoryPoolEntry(1)
            |        |     |  |     |  Index: ciscoMemoryPoolType
            |        |     |  |     |
            |        |     |  |     +-- ---- Integer32 ciscoMemoryPoolType(1)
            |        |     |  |     |        Textual Convention: CiscoMemoryPoolTypes
            |        |     |  |     |        Range: 1..65535
            |        |     |  |     +-- -R-- String    ciscoMemoryPoolName(2)
            |        |     |  |     |        Textual Convention: DisplayString
            |        |     |  |     |        Size: 0..255
            |        |     |  |     +-- -R-- Integer32 ciscoMemoryPoolAlternate(3)
            |        |     |  |     |        Range: 0..65535
            |        |     |  |     +-- -R-- EnumVal   ciscoMemoryPoolValid(4)
            |        |     |  |     |        Textual Convention: TruthValue
            |        |     |  |     |        Values: true(1), false(2)
            |        |     |  |     +-- -R-- Gauge     ciscoMemoryPoolUsed(5)
            |        |     |  |     +-- -R-- Gauge     ciscoMemoryPoolFree(6)
            |        |     |  |     +-- -R-- Gauge     ciscoMemoryPoolLargestFree(7)
            |        |     |  |
            |        |     |  +--ciscoMemoryPoolUtilizationTable(2)
            |        |     |     |
            |        |     |     +--ciscoMemoryPoolUtilizationEntry(1)
            |        |     |        |
            |        |     |        +-- -R-- INTEGER   ciscoMemoryPoolUtilization1Min(1)
            |        |     |        |        Textual Convention: Percent
            |        |     |        |        Range: 0..100
            |        |     |        +-- -R-- INTEGER   ciscoMemoryPoolUtilization5Min(2)
            |        |     |        |        Textual Convention: Percent
            |        |     |        |        Range: 0..100
            |        |     |        +-- -R-- INTEGER   ciscoMemoryPoolUtilization10Min(3)
            |        |     |                 Textual Convention: Percent
            |        |     |                 Range: 0..100
            |        |     |
            |        |     +--ciscoMemoryPoolNotifications(2)
            |        |     |
            |        |     +--ciscoMemoryPoolConformance(3)
            |        |        |
            |        |        +--ciscoMemoryPoolCompliances(1)
            |        |        |  |
            |        |        |  +--ciscoMemoryPoolCompliance(1)
            |        |        |  +--ciscoMemoryPoolComplianceRev1(2)
            |        |        |
            |        |        +--ciscoMemoryPoolGroups(2)
            |        |           |
            |        |           +--ciscoMemoryPoolGroup(1)
            |        |           +--ciscoMemoryPoolUtilizationGroup(2)
            |        |
            |        +--ciscoExperiment(10)
            |        +--ciscoAdmin(11)
            |        |  +--ciscoProxy(1)
            |        |  |  |
            |        |  |  +--ciscoPartyProxy(1)
            |        |  |  |
            |        |  |  +--ciscoContextProxy(2)
            |        |  |
            |        |  +--ciscoRptrGroupObjectID(2)
            |        |  |  +--ciscoUnknownRptrGroup(1)
            |        |  |  +--cisco2505RptrGroup(2)
            |        |  |  +--cisco2507RptrGroup(3)
            |        |  |  +--cisco2516RptrGroup(4)
            |        |  |  +--ciscoWsx5020RptrGroup(5)
            |        |  |
            |        |  +--ciscoChipSets(3)
            |        |     +--ciscoChipSetSaint1(1)
            |        |     +--ciscoChipSetSaint2(2)
            |        |     +--ciscoChipSetSaint3(3)
            |        |     +--ciscoChipSetSaint4(4)


.............................

.............................


(8) 實戰透過 snmpwalk 取得 ciscoMemoryPool 資訊

可參考http://www.oidview.com/mibs/9/CISCO-MEMORY-POOL-MIB.html

以   Processor Memory Pool 及 lsmpi_io Memory Pool 為例

[root@bbb /]# snmptranslate  -IR -Onf ciscoMemoryPoolName
.iso.org.dod.internet.private.enterprises.cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolName




[root@bbb /]# snmptranslate -m CISCO-MEMORY-POOL-MIB  -IR -Onf ciscoMemoryPoolName
.iso.org.dod.internet.private.enterprises.cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolName

[root@bbb /]# snmptranslate -m CISCO-MEMORY-POOL-MIB  -IR -On ciscoMemoryPoolName
.1.3.6.1.4.1.9.9.48.1.1.1.2
[root@bbb /]#




[root@bbb ~]#  snmpwalk -c public -v2c     192.168.111.158   1.3.6.1.4.1.9.9.48
SNMPv2-SMI::enterprises.9.9.48.1.1.1.2.1 = STRING: "Processor"
SNMPv2-SMI::enterprises.9.9.48.1.1.1.2.14 = STRING: "lsmpi_io"
SNMPv2-SMI::enterprises.9.9.48.1.1.1.3.1 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.48.1.1.1.3.14 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.48.1.1.1.4.1 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.48.1.1.1.4.14 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.48.1.1.1.5.1 = Gauge32: 195206240
SNMPv2-SMI::enterprises.9.9.48.1.1.1.5.14 = Gauge32: 6294296
SNMPv2-SMI::enterprises.9.9.48.1.1.1.6.1 = Gauge32: 2037176144
SNMPv2-SMI::enterprises.9.9.48.1.1.1.6.14 = Gauge32: 832
SNMPv2-SMI::enterprises.9.9.48.1.1.1.7.1 = Gauge32: 1332474908
SNMPv2-SMI::enterprises.9.9.48.1.1.1.7.14 = Gauge32: 412



[root@bbb /]#  snmpwalk -c public -v2c  192.168.111.158 .1.3.6.1.4.1.9.9.48
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.1 = STRING: Processor
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.14 = STRING: lsmpi_io
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolAlternate.1 = INTEGER: 0
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolAlternate.14 = INTEGER: 0
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolValid.1 = INTEGER: true(1)
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolValid.14 = INTEGER: true(1)
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.1 = Gauge32: 195210248 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.14 = Gauge32: 6294296 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.1 = Gauge32: 2037172136 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.14 = Gauge32: 832 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolLargestFree.1 = Gauge32: 1332474908 bytes
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolLargestFree.14 = Gauge32: 412 bytes
[root@bbb /]#



[root@bbb /]# snmpwalk -c public -v2c     192.168.111.158   1.3.6.1.4.1.9.9.48.1.1.1.2
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.1 = STRING: Processor
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolName.14 = STRING: lsmpi_io


Processor MemoryPool


[root@bbb /]#  snmpwalk -c public -v2c     192.168.111.158   1.3.6.1.4.1.9.9.48.1.1.1.5.1
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.1 = Gauge32: 195206240 bytes
[root@bbb log]#

[root@bbb /]#  snmpwalk -c public -v2c     192.168.111.158   1.3.6.1.4.1.9.9.48.1.1.1.6.1
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.1 = Gauge32: 2037176144 bytes



lsmpi_io MemoryPool


[root@bbb /]#  snmpwalk -c public -v2c     192.168.111.158   1.3.6.1.4.1.9.9.48.1.1.1.5.14
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.14 = Gauge32: 6294296 bytes


[root@bbb /]#  snmpwalk -c public -v2c     192.168.111.158   1.3.6.1.4.1.9.9.48.1.1.1.6.14
CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.14 = Gauge32: 832 bytes



對照 Cicso 設備下指令顯示的資訊,看到的資訊應該跟 snmpget 到的資訊差不多才是


Router#show memory 
                Head    Total(b)     Used(b)     Free(b)   Lowest(b)  Largest(b)
Processor  7F4216AD6010   2232382384   195274364   2037108020   2036934440   1332474908
 lsmpi_io  7F41C34CE1A8     6295128     6294304         824         824         412
....
....


---End


Cacti Demo
















































加碼 Demo

FortiGate SNMP OIDs

fgSysDiskUsage 1.3.6.1.4.1.12356.101.4.1.6
fgSysDiskCapacity 1.3.6.1.4.1.12356.101.4.1.7

FortiGate CLI

FortiGateCMD#dia sys logdisk usage


http://www.oidview.com/mibs/12356/FORTINET-FORTIGATE-MIB.html



[root@bbb mibs]# snmptranslate -m FORTINET-FORTIGATE-MIB  -IR -Onf fgSysDiskUsage
.iso.org.dod.internet.private.enterprises.fortinet.fnFortiGateMib.fgSystem.fgSystemInfo.fgSysDiskUsage

[root@bbb mibs]# snmptranslate -m FORTINET-FORTIGATE-MIB  -IR -On fgSysDiskUsage
.1.3.6.1.4.1.12356.101.4.1.6
[root@bbb mibs]#


[root@bbb mibs]# snmptranslate -m FORTINET-FORTIGATE-MIB  -IR -Onf fgSysDiskCapacity
.iso.org.dod.internet.private.enterprises.fortinet.fnFortiGateMib.fgSystem.fgSystemInfo.fgSysDiskCapacity

[root@bbb mibs]# snmptranslate -m FORTINET-FORTIGATE-MIB  -IR -On  fgSysDiskCapacity
.1.3.6.1.4.1.12356.101.4.1.7
[root@bbb mibs]#


FortiGate




































FortiGate











Cacti