Creating a MIB

 



 

Overview

 

Based on the resources discussed in Application Notes, the MIB has to be defined.  In this section, the steps involved in defining the MIB for the application is discussed. This will be the first step for developing a Multi-Protocol agent for the existing Shopping Cart application.

 

AdventNet Agent Toolkit provides the tool "MibEditor" for defining SMIv1/v2 mibs. The application can be started from the Agent Toolkit launcher or from <Agent Toolkit Home>/bindirectory using the MibEditor.bat or MibEditor.sh file.

 

We have defined a MIB module under which 3 groups exist. The basic work to land up with the  "ShoppingCart" MIB module is :

Note:

  1. To know more on defining trap type and notification type construct  please refer the Defining a MIB  section in the Building SNMP Agents section of 5.0 Product Help documentation.

  2. Also refer the product document for defining the external index column.

  3. Please see the final MIB for the ShoppingCart application in <Agent Toolkit Home>/mibs directory.

 

Defining the "ShoppingCart" MIB Module

 

To define the Shopping Cart MIB Module the following steps need to be followed.

Note: As specified here, to add a new node any of the above said options can be used. These options are implied and hence can be used when you try to add a new node anywhere in the mib.

Defining Scalars

 

From the application resources explained in Application Notes section, you saw the "scalar" group information as totalItemCount and totalPrice. Hence a scalar group is defined in the MIB which contains scalar objects. (management objects which can hold only a single value).

Defining Tables

 

Steps involved in defining the table :-

Defining Notifications

 

"out of Stock" Notification.

 

We have also defined a Notification group. Traps/Notifications are implemented in a manner such that Notifications get generated for a particular state of change in the Shopping Cart. The state of change can be an event happening in the application. Thus the notification implemented is,

As per our case, the SNMP Agent which we are trying to develop has to send Notifications to Managers when the following occurs :

If this is the requirement, then we have to define a notification in the MIB (as it is of v2 type). It is very easy to define traps/notifications using MIB Editor. First, define the object group notification under the shoppingCartModule node with ID as 1.

 

Then, to define the Notification Type construct, select shoppingCartModule and right-click on it. Use Add -> Notification Type pop-up menu.  The Notification Type construct tab gets enabled in the right.

Thus the MIB is defined.

 

Copyright © 1996-2004, AdventNet Inc. All Rights Reserved.