SmartMIB Sample Script - Performance Management Solution Presentation


 

MODULE mibTables ();

DESCRIPTION "Interface INVENTORY information";

BEGIN              

            ALL-DEV BY DEV

            {

                        SET-INDEX ifTable ( ifDescr [ ifIndex, INT ] );

                        WITH-INDEX ifTable
                        {
                                RMV(ifDescr; ifIndex);
                        }

            };

END 


 

#########################################################

# This is the Module that contains the collection of indexes to be learned by the

# Parent management process

#

#########################################################

 

MODULE PerfMgmtIndexes ();

DESCRIPTION "Performance  Management Guidelines";  

BEGIN

 

            ALL-DEV BY DEV

            {         

                        WITH-INDEX ifTable

                        {

                                    POLL ( ifAdminStatus; ifOperStatus );

 

                                    DEFINE ifAdminStatus DB DISPL;        

                                    DEFINE ifOperStatus DB DISPL;

 

                                    IF ( ifAdminStatus    == "up" AND ifOperStatus  == "up" )

                                    THEN

                                                STORE-INDEX "ifList";

                                    ENDIF;

                        };

            };

END


 

MODULE CpuStats ();

DESCRIPTION "Interface INVENTORY information";

BEGIN             

            ALL-DEV BY DEV

            {         

                        SET-INDEX cpmCPUTotalTable

                        (cpmCPUTotal5minRev [ cpmCPUTotalIndex, INT]) BY-INDEX;

 

                        WITH-INDEX cpmCPUTotalTable

                        {

                                    POLL     (cpmCPUTotalPhysicalIndex);

 

                                    DEFINE cpmCPUTotalPhysicalIndex  DB INT;

                                    DEFINE entPhysicalDescr  DB DISPL;

 

                                    POLL (DEV, entPhysicalDescr, cpmCPUTotalPhysicalIndex);

 

                                    DEFINE cpmCPUTotalPhysicalIndex  DB INT;

                                    DEFINE entPhysicalName  DB DISPL;

 

                                    POLL (DEV, entPhysicalName, cpmCPUTotalPhysicalIndex);

 

                                    RMV      (cpmCPUTotal5minRev;

                                                cpmCPUTotalIndex;

                                                cpmCPUTotalPhysicalIndex);

                        };

            };

END 


 

MODULE CpuProcessTable ();

DESCRIPTION "";

BEGIN             

 

            ALL-DEV BY DEV

            {         

                        SET-INDEX cpmProcessTable (cpmProcessName

                                                                    [cpmCPUTotalIndex, INT;

                                                                    cpmProcessPID, INT]);

 

                        SET-INDEX MemProcessTable (cpmProcessName

                                                                        [cpmCPUTotalIndex, INT;

                                                                        cpmProcessPID, INT]);

            };

END 


 

MODULE CpuProcessStats ();

BEGIN

 

           ALL-DEV BY DEV

            { 

                        WITH-INDEX cpmProcessTable

                         {

                                    POLL (cpmProcessTimeCreated; cpmProcessAverageUSecs);

                          };

             };

END 


 

MODULE MemProcessStats ();

DESCRIPTION "Mem Process Stats module";

BEGIN

 

           ALL-DEV BY DEV

            { 

                        WITH-INDEX MemProcessTable

                        {

                                    POLL (   cpmProcExtMemAllocatedRev;

                                                                cpmProcExtMemFreedRev     );

                         };

             };

END 


 

##########################################################

# This is the static Fault Alarm Thrsholds for the critical Buffer memoryon

# managed elements

##########################################################

 

MODULE BufferData ();

DESCRIPTION "Fault Management Process";

BEGIN

 

            ALL-DEV BY DEV

            {

                        DEFINE bufferFailCountT1  MAP INT;

                        DEFINE bufferNoMemCountT1  MAP INT;

 

                        DEFINE bufferFail  DB INT;

                        DEFINE bufferNoMem DB INT;

 

                        bufferFailCountT1  = bufferFail;

                        bufferNoMemCountT1  = bufferNoMem;

 

                        RMV (bufferFail; bufferNoMem);

 

                        POLL (bufferFail; bufferNoMem);

 

                        DEFINE bufferFailCountT2  MAP INT;

                        DEFINE bufferNoMemCountT2  MAP INT;

                        DEFINE bufferFailCount  MAP INT;

                        DEFINE bufferNoMemCount  MAP INT;

 

                        bufferFailCountT2  = bufferFail;

                        bufferNoMemCountT2  = bufferNoMem;

 

                        bufferFailCount  = bufferFailCountT2 – bufferFailCountT1;

                        bufferNoMemCount  = bufferNoMemCountT2 – bufferNoMemCountT1;

 

                        IF (bufferFailCount >= 5)

                        THEN

                                    MSG(“Device @1 is reporting a Buffer allocation failure”, DEV);

                        ENDIF;

 

                        IF (bufferNoMemCount >= 1)

                        THEN

                                    MSG(“Device @1 reporting a Buffer creation failure”, DEV);

                        ENDIF;

            };

END


 

################################################

# This is the Performance statistics for the critical memory statistics

# on the managed elements..

################################################

  

MODULE MemTable ();

DESCRIPTION "Memory information Process";

BEGIN             

            ALL-DEV BY DEV

            {

                    SET-INDEX MemoryPoolTable

                                            (ciscoMemoryPoolName [ciscoMemoryPoolType, INT]);

            };

END

 


 

MODULE MemPoolStats ();

DESCRIPTION "Memory stats";

BEGIN

 

           ALL-DEV BY ELEMENT

            { 

                        WITH-INDEX MemoryPoolTable

                        {

                                    POLL (  ciscoMemoryPoolFree;

                                               ciscoMemoryPoolLargestFree;

                                               ciscoMemoryPoolUsed );

                        };

            };

END


 

#########################################################

# This is the Module that conains the collection of indexes to be learned by the

# Parent management process

#

#########################################################

 

MODULE PerfMgmt1 ();

DESCRIPTION "Performance  Management Guidelines"; 

BEGIN

                        WITH-INDEX ifList

                        {

                                     POLL (              ifDescr;

                                                            locIfCarTrans;

                                                            locIfCollisions;

                                                            locIfResets;

                                                            locIfInputQueueDrops;                                     

                                                            locIfOutputQueueDrops;

                                                            ifCounterDiscontinuityTime;                                                        

                                                            ifInUcastPkts;

                                                            ifInNUcastPkts;

                                                            ifOutUcastPkts;

                                                            ifOutNUcastPkts );

                        };

END


 

#########################################################

# This is the Module that conains the collection of indexes to be learned by the

# Parent management process

#

#########################################################

 

MODULE PerfMgmt2 ();

DESCRIPTION "Performance  Management Guidelines";

BEGIN

 

            ALL-DEV BY DEV

            {

                        ####################################################

                                ## dot3StatsTable & lifTable shares the same index with ifTable

                                ####################################################

 

                        WITH-INDEX ifList

                        {

                                ########################################################

                                ###########Defining the First-Run Variables and the database variables:

                                ########################################################

 

                                    DEFINE locIfCarTransT1  MAP INT;

                                    DEFINE locIfCollisionsT1  MAP INT;

                                    DEFINE ifInputQueueDropsT1   MAP INT;

                                    DEFINE ifOutputQueueDropsT1  MAP INT;

                                    DEFINE locIfResetsT1  MAP INT;

                                    DEFINE ifInUcastPktsT1  MAP INT;

                                    DEFINE ifInNUcastPktsT1  MAP INT;

                                    DEFINE ifOutUcastPktsT1  MAP INT;

                                    DEFINE ifOutNUcastPktsT1  MAP INT;

 

                                    DEFINE locIfCarTrans DB INT;

                                    DEFINE locIfCollisions  DB INT;

                                    DEFINE locIfInputQueueDrops DB INT;

                                    DEFINE locIfOutputQueueDrops  DB INT;

                                    DEFINE locIfResets  DB INT;

                                    DEFINE ifInUcastPkts  DB INT;

                                    DEFINE ifInNUcastPkts  DB INT;

                                    DEFINE ifOutUcastPkts  DB INT;

                                    DEFINE ifOutNUcastPkts  DB INT;

 

                        ###################################################################

                        Populating the First-Run values:

                        ###################################################################

 

                                    locIfCarTransT1  = locIfCarTrans;

                                    locIfCollisionsT1 = locIfCollisions;

                                    ifInputQueueDropsT1  = locIfInputQueueDrops;

                                    ifOutputQueueDropsT1   = locIfOutputQueueDrops;

                                    locIfResetsT1  = locIfResets;

                                    ifInUcastPktsT1  = ifInUcastPkts;

                                    ifInNUcastPktsT1  = ifInNUcastPkts;

                                    ifOutUcastPktsT1  =ifOutUcastPkts;

                                    ifOutNUcastPktsT1  = ifOutNUcastPkts;

 

                        #################################################################

                        #Cleaning up the database from the excess transient First-Run values:

                        #################################################################

 

                                    RMV (locIfCarTrans;

                                            locIfCollisions;

                                            locIfResets;

                                            locIfInputQueueDrops;

                                            locIfOutputQueueDrops;

                                            ifCounterDiscontinuityTime;

                                            ifInUcastPkts;

                                            ifInNUcastPkts;

                                            ifOutUcastPkts;

                                            ifOutNUcastPkts);

 

                        ########################################################

                                    ###########Populating the Databse with the Second-Run values:

                        ########################################################

 

                                    POLL (locIfCarTrans;

                                                locIfCollisions;

                                                locIfResets;

                                                locIfInputQueueDrops;

                                                locIfOutputQueueDrops;

                                                ifCounterDiscontinuityTime;

                                                ifInUcastPkts;

                                                ifInNUcastPkts;

                                                ifOutUcastPkts;

                                                ifOutNUcastPkts);

 

                        ########################################################

                                    ###########Defining the Second-Run Variables:

                        ########################################################

 

                                    DEFINE locIfCarTransT2  MAP INT;

                                    DEFINE locIfCollisionsT2  MAP INT;

                                    DEFINE ifInputQueueDropsT2  MAP INT;

                                    DEFINE ifOutputQueueDropsT2  MAP INT;

                                    DEFINE locIfResetsT2  MAP INT;

                                    DEFINE ifInUcastPktsT2   MAP INT;

                                    DEFINE ifInNUcastPktsT2  MAP INT;

                                    DEFINE ifOutUcastPktsT2  MAP INT;

                                    DEFINE ifOutNUcastPktsT2  MAP INT;

 

                        ########################################################

                        ###########Populating the Variables with the Second-Run values:

 

                                    locIfCarTransT2  = locIfCarTrans;

                                    locIfCollisionsT2  = locIfCollisions;

                                    ifInputQueueDropsT2 = locIfInputQueueDrops;

                                    ifOutputQueueDropsT2   = locIfOutputQueueDrops;

                                    locIfResetsT2  = locIfResets;

                                    ifInUcastPktsT2  = ifInUcastPkts;

                                    ifInNUcastPktsT2  = ifInNUcastPkts;

                                    ifOutUcastPktsT2  = ifOutUcastPkts;

                                    ifOutNUcastPktsT2  = ifOutNUcastPkts;

             

                        ########################################################

                                    #######Defining and calculating Variables for Populating the relevant database values:

 

                                    DEFINE locIfCarTrans  MAP INT;

                                    DEFINE locIfCollisions  MAP INT;

                                    DEFINE locIfInputQueueDrops  MAP INT;

                                    DEFINE ifOutputQueueDrops  MAP INT;

                                    DEFINE locIfResets  MAP INT;

 

                                    CounterData( DeltalocIfCarTrans,

                                                        locIfCarTransT1,

                                                        locIfCarTransT2);

 

                                    CounterData( DeltalocIfCollisions,

                                                        locIfCollisionsT1,

                                                        locIfCollisionsT2);

 

                                    CounterData( DeltaifInputQueueDrops,

                                                        ifInputQueueDropsT1,

                                                        ifInputQueueDropsT2);

 

                                    CounterData( DeltaifOutputQueueDrops,

                                                        ifOutputQueueDropsT1,

                                                        ifOutputQueueDropsT2);

 

                                    CounterData( DeltalocIfResets,

                                                        locIfResetsT1,

                                                        locIfResetsT2);

 

                                    CounterData( DeltaifInUcastPkts,

                                                        ifInUcastPktsT1,

                                                        ifInUcastPktsT2);

 

                                    CounterData( DeltaifInNUcastPkts,

                                                        ifInNUcastPktsT1,

                                                        ifInNUcastPktsT2);

 

                                    CounterData( DeltaifOutUcastPkts ,

                                                        ifOutUcastPktsT1,

                                                        ifOutUcastPktsT2);

 

                                    CounterData( DeltaifOutNUcastPkts,

                                                        ifOutNUcastPktsT1,

                                                        ifOutNUcastPktsT2);

 

                                    ####################################################

                                    # Defining Variables for setting the Thresholds the relevant database values:

 

                                    DEFINE InTotalPkts  MAP INT;

                                    DEFINE OutTotalPkts  MAP INT;

 

                                    DEFINE InputQueueDropsThershold  MAP INT;

                                    DEFINE OutputQueueDropsThreshold  MAP INT;

 

                                    InTotalPkts  =  DeltaifInUcastPkts + DeltaifInNUcastPkts;

                                    OutTotalPkts  =  DeltaifOutUcastPkts + DeltaifOutNUcastPkts;

 

                                    ###################################################

                                    # The Input Queue drops condition:

        

                                    InputQueueDropsThershold = InTotalPkts * 0.01;

 

                                    IF (DeltaifInputQueueDrops > InputQueueDropsThershold)

                                    THEN

                                                MSG(“Device @1 is reporting an Input Queue drops alarm”, DEV);

                                    ENDIF;

 

                                    ###################################################

                                    # The Output Queue drops condition:

          

                                    OutputQueueDropsThreshold = OutTotalPkts * 0.1;

 

                                    IF (DeltaifOutputQueueDrops > OutputQueueDropsThreshold)

                                    THEN

                                            MSG(“Device @1 is reporting an Output Queue drops alarm”, DEV);

                                    ENDIF;

                        };

            };

END  


© 2001-2004 Advanced Network Management Solutions, Inc.