Solaris System Management Agent Developer's Guide

demo_module_11 Code Example for Entity MIB

The /usr/demo/sma_snmp/demo_module_11 code example shows how the Entity MIB module can be used. The demo module is designed to populate the empty MIB tables that are created when the libentity.so module is dynamically loaded into the agent. The data that is loaded is described in this section.

You should examine the code in demo_module_11, especially the code in the MyTable.c file. The file README_demo_module_11 in that directory includes procedures for building and using the example.

The demo_module_11 example refers to a system with the following components that need to be managed:

These components can be divided into the following entities:

Some of the physical entities are contained in other physical entities. The logical entities are associated with particular physical entities. The Entity MIB tables should be populated to show the relationships among the various entities.

The following examples demonstrate how the MIB tables could be populated for this system.


Example 9–1 Physical Entities for demo_module_11

The entPhysicalTable might be populated with the following values:



Example 9–2 Logical Entities for demo_module_11

The entLogicalTable is populated with the following values when you run demo_module_11:



Note –

entLogicalTable does not support SNMPv3 in this example.



Example 9–3 Logical to Physical Mappings for demo_module_11

The entLPMappingsTable is populated with the objects and values in the right column of the following table when you run demo_module_11.

Logical Entity and Physical Entity Associations 

Logical to Physical Mapping Indexes 

Domain A (entLogicalIndex.1) uses:

    Board 1 (entPhysicalIndex.5)


    Port 1 (entPhysicalIndex.12)


entLPPhysicalIndex.1.5  == 5
entLPPhysicalIndex.1.12 == 12

Domain B (entLogicalIndex.2) uses:

    Board 2 (entPhysicalIndex.8)


    Port 2 (entPhysicalIndex.13)


    Port 3 (entPhysicalIndex.14)


entLPPhysicalIndex.2.8  == 8
entLPPhysicalIndex.2.13 == 13
entLPPhysicalIndex.2.14 == 14

Firewall 1 (entLogicalIndex.3) uses:

    CPU 1 (entPhysicalIndex.6)


    Port 1 (entPhysicalIndex.12)


entLPPhysicalIndex.3.6  == 6
entLPPhysicalIndex.3.12 == 12

Firewall 2 (entLogicalIndex.4) uses:

    CPU 3 (entPhysicalIndex.9)


    Port 2 (entPhysicalIndex.13)


    Port 3 (entPhysicalIndex.14)


entLPPhysicalIndex.4.9  == 9
entLPPhysicalIndex.4.13 == 13
entLPPhysicalIndex.4.14 == 14

These mappings are included in the entLPMappingTable because Firewall 2 uses ports in the board. If the firewall did not use these ports, then a single mapping to the board, for example entLPPhysicalIndex.4.11 would be sufficient.



Example 9–4 Physical to Logical to MIB Alias Mappings for demo_module_11

The entAliasMappingTable is populated with the following objects and values when you run demo_module_11.

If the ifIndex values are shared by all logical entities, the entAliasMappingTable might be populated as follows:

entAliasMappingIdentifier.12.0 ==  ifIndex.1
entAliasMappingIdentifier.13.0 ==  ifIndex.2
entAliasMappingIdentifier.14.0 ==  ifIndex.3

The first index in the entAliasMappingIdentifier signifies the physical index. In this case, physical entities with the indexes 12, 13, and 14 are Port 1, Port 2, and Port 3. In the preceding entAliasMappingIdentifier assignments, Port 1 is mapped to ifIndex.1, Port 2 is mapped to ifIndex.2, and Port 3 is mapped to ifIndex.3. This mapping is for all logical entities that use each of these ports.

If the ifIndex values are not shared by all logical entities, the entAliasMappingTable might be populated as follows:

entAliasMappingIdentifier.12.0 ==  ifIndex.1
entAliasMappingIdentifier.12.3 ==  ifIndex.101
entAliasMappingIdentifier.13.0 ==  ifIndex.2
entAliasMappingIdentifier.13.3 ==  ifIndex.102
entAliasMappingIdentifier.14.0 ==  ifIndex.3
entAliasMappingIdentifier.14.3 ==  ifIndex.103

In this case, one logical entity is mapped differently. Firewall 1, which is entLogicalIndex.3, is mapped as follows:



Example 9–5 Physical Contains Table Entries for demo_module_11

The following table shows the containment relationships among the physical entities. The right column of the table lists the entries added to the entPhysicalContainsTable of the Entity MIB by demo_module_11.

Physical Entity 

Contains 

entPhysicalContainsTable Entry

Chassis 

Slot 1 

entPhysicalChildIndex.1.2 == 2

 

Slot 2 

entPhysicalChildIndex.1.3 == 3

 

Slot 3 

entPhysicalChildIndex.1.4 == 4

Slot 1 

Board 1 

entPhysicalChildIndex.2.5 == 5

Slot 2 

Board 2 

entPhysicalChildIndex.3.8 == 8

Slot 3 

Board 3 

entPhysicalChildIndex.4.11 == 11

Board 1 

CPU 1 

entPhysicalChildIndex.4.6 == 6

 

CPU 2 

entPhysicalChildIndex.4.7 == 7

Board 2 

CPU 3 

entPhysicalChildIndex.8.9 == 9

 

CPU 4 

entPhysicalChildIndex.8.10 == 10

Board 3 

Port 1 

entPhysicalChildIndex.11.12 == 12

 

Port 2 

entPhysicalChildIndex.11.13 == 13

 

Port 3 

entPhysicalChildIndex.11.14 == 14