SNMP variables (OIDs) for physical memory size and shared memory size

SNMP variables (OIDs) for physical memory size and shared memory size

Post by Siegbert Kleine » Fri, 09 Oct 1998 04:00:00



Hi all,

I want to write a small script to get via snmp the
complete hw-infos of a cisco router like
- memory size
- shared memory size
- flash size
- ios version
- rom version
- interface types
- etc.

In the appr. cisco mibs on ftp.cisco.com/usr/pub/mibs
I couldn't find the snmp variables for
- ram size
- shared memory size.

Does anyone know the snmp OIDs or snmp variables for
"ram size" and "shared memory" size?

Thanks in advance.

Mit freundlichen Gruessen - Yours sincerely

Siegbert Kleiner
NCB Network Consulting Bazzanella GmbH
Benzstrasse 32, 71083 Herrenberg, Germany
Phone: +49 (0) 70 32 / 94 88 31
Fax: + 49 (0) 70 32 / 94 88 99

 
 
 

SNMP variables (OIDs) for physical memory size and shared memory size

Post by Benoit Clais » Tue, 13 Oct 1998 04:00:00


Siegbert,

You may have a look to the CISCO-MEMORY-POOL-MIB-V1SMI.my, and to the table
ciscoMemoryPoolTable
You can see this mib at http://www.cisco.com/public/mibs
-> v1

CiscoMemoryPoolEntry ::= SEQUENCE {
    ciscoMemoryPoolType CiscoMemoryPoolTypes,
    ciscoMemoryPoolName DisplayString,
    ciscoMemoryPoolAlternate Integer32,
    ciscoMemoryPoolValid TruthValue,
    ciscoMemoryPoolUsed Gauge32,
    ciscoMemoryPoolFree Gauge32,
    ciscoMemoryPoolLargestFree Gauge32
    }

The type of the pool means

CiscoMemoryPoolTypes ::= Integer32(1..65535)
-- TEXTUAL-CONVENTION
--  Status
--    mandatory
--  Descr
--    Represents the different types of memory pools that
--    may be present in a managed device.  Memory pools can
--    be roughly categorized into two groups, predefined
--    pools and dynamic pools.  The following pool types
--    are currently predefined:
--     1:  processor memory
--     2:  i/o memory
--     3:  pci memory
--     4:  fast memory
--     5:  multibus memory
--

Now, if you want to have the total amount of memory, just get the
ciscoMemoryPoolUsed and the ciscoMemoryPoolFree for every pool.
The value you are looking for is the sum of those ones.

See example,


cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolName.1 : DISPLAY STRING- (ascii):  Processor
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolName.2 : DISPLAY STRING- (ascii):  I/O
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolAlternate.1 : INTEGER: 2
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolAlternate.2 : INTEGER: 0
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolValid.1 : INTEGER: true
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolValid.2 : INTEGER: true
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolUsed.1 : Gauge32: 1025408
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolUsed.2 : Gauge32: 430052
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolFree.1 : Gauge32: 6953468
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolFree.2 : Gauge32: 1667100
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolLargestFree.1 : Gauge32: 6924292
cisco.ciscoMgmt.ciscoMemoryPoolMIB.ciscoMemoryPoolObjects.ciscoMemoryPoolTable.ciscoMemoryPoolEntry.ciscoMemoryPoolLargestFree.2 : Gauge32: 1636032

cough#sh proc mem
Total: 10076028, Used: 1452976, Free: 8623052
 PID  TTY  Allocated      Freed    Holding    Getbufs    Retbufs Process
   0    0      31396       1252    1167528          0          0 *Init*

And so, you can calculate the amount of Used/Free/Total memory from the SNMP
counters:

   Used  memory for cough is                 1025408 +  430052 =  1455460 bytes
   Free  memory for cough is                 6953468 + 1667100 =  8620568 bytes
   Total memory for cough is (Used + Free)   1455460 + 8620568 = 10076028 bytes

I supposed that the difference between the 'sh proc mem' and the SNMP
counters (2484 bytes, passing from Free to Used) is the amount of memory
that has been used by the router to answer to my snmpwalk.

Just to be complete. Now, if you want to have the total amount of I/O memory, just get the ciscoMemoryPoolUsed and the ciscoMemoryPoolFree. The value you are
looking for is the sum of those ones.

      430052 + 1667100 = 2097152 bytes   -> 2048k

Regards, Benoit.

------------------------------------------------------------------------------
     ..        ..     | Benoit Claise (CCIE 2868) | Brussels: +32 2 778 42 00
     ||        ||     | Network Mgmt Engineer     | Direct:   +32 2 778 46 22
     ||        ||     | Cisco Systems Belgium     | Fax:      +32 2 778 43 00
    ||||      ||||    | Complex Antares           | GSM:
..:||||||:..:||||||:..| 71, Av des Pleiades       | Beeper:

------------------------------------------------------------------------------

Quote:

> Hi all,

> I want to write a small script to get via snmp the
> complete hw-infos of a cisco router like
> - memory size
> - shared memory size
> - flash size
> - ios version
> - rom version
> - interface types
> - etc.

> In the appr. cisco mibs on ftp.cisco.com/usr/pub/mibs
> I couldn't find the snmp variables for
> - ram size
> - shared memory size.

> Does anyone know the snmp OIDs or snmp variables for
> "ram size" and "shared memory" size?

> Thanks in advance.

> Mit freundlichen Gruessen - Yours sincerely

> Siegbert Kleiner
> NCB Network Consulting Bazzanella GmbH
> Benzstrasse 32, 71083 Herrenberg, Germany
> Phone: +49 (0) 70 32 / 94 88 31
> Fax: + 49 (0) 70 32 / 94 88 99