SmartMIB Small Solution:

ATM Type Interface Statistics
(Utilization & Throughput)


(SM-SmallSol0036)

Solution’s SOSL Based management process script:

 

The solution defines the following main modules:

 

MainMIBTables:

This is the main module that controls and instantiates the ‘mibTables’ module.

 

MainFilterAtmTables:

This is the main module that controls and instantiates the ‘FilterAtmTables’ module.

 

MainIfATM:

This is the main module that controls and instantiates the ‘ATM1’ and the ‘ATM2’ modules where ‘ATM2’ and instantiates the ‘AtmifCounters’ and ‘AtmifHCcounters’ modules.

 

The details of the Main modules and the transient Service modules are provided below:

 


 

MODULE MainMIBTables ();

DESCRIPTION "Interface INVENTORY information";

BEGIN

            POLL-FREQ

            {

                        MODULE-CALL mibTables();

 

                        WAIT (12000);

            };

END

 


 

MODULE MainFilterAtmTables ();

DESCRIPTION "Interface INVENTORY information";

BEGIN

 

            POLL-FREQ

            {

                        MODULE-CALL FilterAtmTables();

 

                        WAIT (12000);

            };

END

 


 

MODULE MainIfATM ();

DESCRIPTION "ATM Interfaces Process";

BEGIN

 

            ALL-DEV BY DEV

            {

                        MODULE-CALL ATM1 (DEV);

            };

 

            POLL-FREQ

            {

                        WAIT (3000);

 

                        ALL-DEV BY DEV

                        {

                                    MODULE-CALL ATM2 (DEV);

                        };

            };

END

 


 

MODULE mibTables ();

DESCRIPTION "Interface INVENTORY information";

BEGIN             

            ALL-DEV BY DEV

            {

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

            };

END

 


 

MODULE FilterAtmTables ();

DESCRIPTION "Interface INVENTORY information";

BEGIN

            ALL-DEV BY DEV

            {

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

                        # MSG (" DEVICE: @1", DEV);

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

 

                        WITH-INDEX ifTable

                        {

                                    POLL (   ifDescr;

                                                ifType;

                                                ifSpeed;

                                                ifAdminStatus;

                                                ifMtu;

                                                ifOperStatus;

                                                ifAlias);

 

                                    DEFINE ifAdminStatus DB DISPL;        

                                    DEFINE ifType DB DISPL;        

                                    DEFINE ifOperStatus DB DISPL;

                                    DEFINE ifSpeed DB DISPL;        

                                   

                                    IF ( ifAdminStatus    == "up" AND

                                          ifOperStatus      == "up" AND

                                          ifType               == "^aal5$" AND

                                          ifSpeed             <=  20000000  )

                                    THEN

                                                STORE-INDEX "IfAAL5";

 

                                    ELSEIF  ( ifAdminStatus    == "up" AND

                                                 ifOperStatus      == "up" AND

                                                 ifType               == "^aal5$" AND

                                                 ifSpeed              >  20000000   )

                                    THEN

                                                STORE-INDEX "IfHCAAL5";

 

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

                                                # "IfAAL5" and "IfHCAAL5" index lists now contains

                                                # the list of AAL5 type interfaces on each of the

                                                # managed elements

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

 

                                                IF ( ifAdminStatus    == "up" AND

                                                      ifOperStatus      == "up" AND

                                                      ifType               == "^atm$" OR

                                                      ifType               == "^aflane$" AND

                                                      ifSpeed             <=  20000000  )

                                                THEN

                                                            STORE-INDEX "IfATM";

             

                                                ELSEIF  ( ifAdminStatus    == "up" AND

                                                             ifOperStatus      == "up" AND

                                                             ifType               == "^atm$" OR

                                                             ifType               == "^aflane$" AND

                                                             ifSpeed             >  20000000  )

                                                THEN

                                                            STORE-INDEX "IfHCATM";

 

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

                                                            # "IfATM" and "IfHCATM" index lists now contains

                                                            # the list of  ATM and Lane type interfaces on

                                                            # each managed elements

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

 

                                                ENDIF;

                        };

            };

END


 

MODULE  ATM1 (DEV    DEVICE);

DESCRIPTION "";

BEGIN

 

            WITH-INDEX IfAAL5

            {

                        POLL (   ifInOctets;

                                    ifOutOctets;

                                    ifInUcastPkts;

                                    ifOutUcastPkts;

                                    sysUpTime;

                                    ifSpeed;

                                    ifCounterDiscontinuityTime );

            };

 

            WITH-INDEX IfHCAAL5

            {

                        POLL (   ifHCInOctets;

                                    ifHCOutOctets;

                                    ifHCInUcastPkts;

                                    ifHCOutUcastPkts;

                                    sysUpTime;

                                    ifSpeed;

                                    ifCounterDiscontinuityTime );

           

            };

 

            WITH-INDEX IfATM

            {

                        POLL (   ifInOctets;

                                    ifOutOctets;

                                    ifInUcastPkts;

                                    ifOutUcastPkts;

                                    sysUpTime;

                                    ifSpeed;

                                    ifCounterDiscontinuityTime );

 

            };

 

            WITH-INDEX IfHCATM

            {

                        POLL (   ifHCInOctets;

                                    ifHCOutOctets;

                                    ifHCInUcastPkts;

                                    ifHCOutUcastPkts;

                                    sysUpTime;

                                    ifSpeed;

                                    ifCounterDiscontinuityTime );

           

            };

END


 

MODULE  ATM2 (DEV    DEVICE);

DESCRIPTION "";

BEGIN

 

            WITH-INDEX IfAAL5

            {

                        MODULE-CALL ATMifCounters (DEV);

            };

 

            WITH-INDEX IfHCAAL5

            {

                        MODULE-CALL ATMifHCcounters (DEV);

            };

 

            WITH-INDEX IfATM

            {

                        MODULE-CALL ATMifCounters (DEV);

            };

 

            WITH-INDEX IfHCATM

            {

                        MODULE-CALL ATMifHCcounters (DEV);

            };

END


 

MODULE  ATMifCounters (DEV DEVICE);

DESCRIPTION "";

BEGIN

                        DEFINE ifInOctetsT1 INT;

                        DEFINE ifOutOctetsT1 INT;

                        DEFINE ifInUcastPktsT1 INT;

                        DEFINE ifOutUcastPktsT1 INT;

                        DEFINE nTime1 INT;

                        DEFINE ifDisconTime1 INT;

 

                        DEFINE ifInOctets DB INT;

                        DEFINE ifOutOctets DB INT;

                        DEFINE ifInUcastPkts DB INT;

                        DEFINE ifOutUcastPkts DB INT;

                        DEFINE sysUpTime DB INT;

                        DEFINE ifCounterDiscontinuityTime DB INT;

 

                        ifInOctetsT1 = ifInOctets;

                        ifOutOctetsT1 = ifOutOctets;

                        ifInUcastPktsT1 = ifInUcastPkts;

                        ifOutUcastPktsT1 = ifOutUcastPkts;

 

                        nTime1 = sysUpTime /100;

                        ifDisconTime1 = ifCounterDiscontinuityTime;

 

                        RMV (    ifInOctets;

                                    ifOutOctets;

                                    ifInUcastPkts;

                                    ifOutUcastPkts;

                                    sysUpTime;

                                    ifSpeed;

                                    ifCounterDiscontinuityTime);

 

                        POLL (   ifDescr; ifInOctets;

                                    ifOutOctets;

                                    ifInUcastPkts;

                                    ifOutUcastPkts;

                                    sysUpTime;

                                    ifSpeed;

                                    ifCounterDiscontinuityTime);

 

                        DEFINE ifInOctetsT2 INT;

                        DEFINE ifOutOctetsT2 INT;

                        DEFINE ifInUcastPktsT2 INT;

                        DEFINE ifOutUcastPktsT2 INT;

 

                        ifInOctetsT2 = ifInOctets;     

                        ifOutOctetsT2 = ifOutOctets;

                        ifInUcastPktsT2 = ifInUcastPkts;

                        ifOutUcastPktsT2 = ifOutUcastPkts;

 

                        DEFINE nTime2 INT;

                        DEFINE ifDisconTime2 INT;

 

                        nTime2 = sysUpTime /100;

                        ifDisconTime2 = ifCounterDiscontinuityTime;

 

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

                        #          MSG("ifDisconTime1 = @1, ifDisconTime2 = @2",

                        #                 ifDisconTime1, ifDisconTime2);

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

 

                        IF (ifDisconTime2 == ifDisconTime1)

                        THEN                

           

                            CounterData(     DeltaifInOctets,             

                                                   ifInOctetsT1,     

                                                   ifInOctetsT2);

 

                            CounterData(     DeltaifOutOctets,                       

                                                    ifOutOctetsT1,   

                                                    ifOutOctetsT2);

 

                             CounterData(     DeltaifInUcastPkts ,                   

                                                     ifInUcastPktsT1,

                                                     ifInUcastPktsT2  );

 

                             CounterData(     DeltaifOutUcastPkts,                  

                                                     ifOutUcastPktsT1,          

                                                     ifOutUcastPktsT2);

 

                             DEFINE InFrmOVHead INT;

                             DEFINE OutFrmOVHead INT;

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

                             #   DEFINE FrmOVHead INT;

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

                                   

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

                             ## The following formulas calculates the In/Out traffic   

                             ## Overhead values for all traffic passing for the particular

                             ## interface type

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

 

                             InFrmOVHead    = (DeltaifInUcastPkts) * (12);

      

                             OutFrmOVHead  = (DeltaifOutUcastPkts) * (12);

                                   

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

                             ## Calculating the time difference between the first and

                             ## second run polls as reported by each managed element

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

 

                             DEFINE DeltaT   INT;                             

                             DeltaT = nTime2 - nTime1;

 

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

                             #    MSG("ifSpeed = @1, DeltaT = @2", ifSpeed, DeltaT);

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

 

                              DEFINE ifSpeed DB INT;

 

                              IF (ifSpeed != 0 AND DeltaT > 0)

                              THEN

 

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

                                    ## The following formulas calculates the In/OutUtilization

                                    ## values for all traffic passing for the particular interface type

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

 

                                    DEFINE InTrafficUtilization DB INT;

                                    DEFINE OutTrafficUtilization DB INT;

 

              InTrafficUtilization = (DeltaifInOctets * 8) * 100 / (DeltaT * ifSpeed);

              OutTrafficUtilization = (DeltaifOutOctets * 8) * 100/ (DeltaT * ifSpeed);

 

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

                                    # MSG("InTrafficUtil = @1, OutTrafficUtil = @2",

                                    #             InTrafficUtilization, OutTrafficUtilization);

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

                                               

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

                                    ## The following formulas calculates the In/OutUtilization

                                    ## values while accounting for traffic overheads for the

                                    ## particular interface type

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

 

                                    DEFINE InDataUtilization DB INT;

                                    DEFINE OutDataUtilization DB INT;

 

            InDataUtilization = (InFrmOVHead + DeltaifInOctets * 8)*100/ (DeltaT * ifSpeed);

            OutDataUtilization = (OutFrmOVHead + DeltaifOutOctets * 8)*100/ (DeltaT * ifSpeed);

 

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

                                    ## The following formulas calculates the In/Out Throughput

                                    ## values for the particular interface type

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

 

                                    DEFINE InThroughput     DB INT;

                                    DEFINE OutThroughput   DB INT;                        

 

                                    InThroughput     = (DeltaifInOctets * 8) *1000 / DeltaT;

                                    OutThroughput   = (DeltaifOutOctets * 8) *1000 / DeltaT;

 

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

## The total utilization and Throughput could be calculated by enabling the following

## piece of code:

#

#                                  DEFINE TotalPkts                        INT;

#                                  DEFINE TotalInPkts         INT;

#                                  DEFINE TotalOutPkts       INT;

#                                  DEFINE TotalOctets         INT;

#

#                                  FrmOVHead       = TotalPkts * (16);

#

#                                  TotalInPkts = (DeltaifInUcastPkts);

#

#                                  TotalOutPkts = (DeltaifOutUcastPkts );

#

#                                  TotalPkts           = TotalInPkts + TotalOutPkts;

#

#                                  TotalOctets        = DeltaifOutOctets + DeltaifInOctets;

#

#                                              DEFINE TotalUtilization    DB INT;

#                                              DEFINE Throughput        DB INT;

#

#                 TotalUtilization = ((TotalPkts*(12)) + TotalOctets*8)*100/(DeltaT * ifSpeed);

#                 Throughput        = (TotalOctets * 8) *1000 / DeltaT;

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

 

                                    ENDIF;

                        ENDIF;

            };

END


 

MODULE  ATMifHCcounters (DEV DEVICE);

DESCRIPTION "";

BEGIN

 

                        DEFINE ifInOctetsT1 INT;

                        DEFINE ifOutOctetsT1 INT;

                        DEFINE ifInUcastPktsT1 INT;

                        DEFINE ifOutUcastPktsT1 INT;

                        DEFINE nTime1 INT;

                        DEFINE ifDisconTime1 INT;

 

                        DEFINE ifHCInOctets DB INT;

                        DEFINE ifHCOutOctets DB INT;

                        DEFINE ifHCInUcastPkts DB INT;

                        DEFINE ifHCOutUcastPkts DB INT;

                        DEFINE sysUpTime DB INT;

                        DEFINE ifCounterDiscontinuityTime DB INT;

 

                        ifInOctetsT1 = ifHCInOctets;

                        ifOutOctetsT1 = ifHCOutOctets;

                        ifInUcastPktsT1 = ifHCInUcastPkts;

                        ifOutUcastPktsT1 = ifHCOutUcastPkts;

                        nTime1 = sysUpTime /100;

                        ifDisconTime1 = ifCounterDiscontinuityTime;

 

                        RMV (    ifHCInOctets;

                                    ifHCOutOctets;

                                    ifHCInUcastPkts;

                                    ifHCOutUcastPkts;

                                    sysUpTime;

                                    ifSpeed;

                                    ifCounterDiscontinuityTime);

 

                        POLL (   ifHCInOctets;

                                    ifHCOutOctets;

                                    ifHCInUcastPkts;

                                    ifHCOutUcastPkts;

                                    sysUpTime;

                                    ifSpeed;

                                    ifCounterDiscontinuityTime);

 

                        DEFINE ifInOctetsT2 INT;

                        DEFINE ifOutOctetsT2 INT;

                        DEFINE ifInUcastPktsT2 INT;

                        DEFINE ifOutUcastPktsT2 INT;

 

                        ifInOctetsT2 = ifHCInOctets; 

                        ifOutOctetsT2 = ifHCOutOctets;

                        ifInUcastPktsT2 = ifHCInUcastPkts;

                        ifOutUcastPktsT2 = ifHCOutUcastPkts;

 

                        DEFINE nTime2 INT;

                        DEFINE ifDisconTime2 INT;

 

                        nTime2 = sysUpTime /100;

                        ifDisconTime2 = ifCounterDiscontinuityTime;

 

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

                        #          MSG("ifDisconTime1 = @1, ifDisconTime2 = @2",

                        #                     ifDisconTime1, ifDisconTime2);

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

 

                        IF (ifDisconTime2 == ifDisconTime1)

                        THEN                

           

                                    CounterData(     DeltaifHCInOctets,                     

                                                            ifInOctetsT1,     

                                                            ifInOctetsT2);

 

                                    CounterData(     DeltaifHCOutOctets,                   

                                                            ifOutOctetsT1,   

                                                            ifOutOctetsT2);

 

                                    CounterData(     DeltaifHCInUcastPkts ,               

                                                            ifInUcastPktsT1,

                                                            ifInUcastPktsT2);

 

                                    CounterData(     DeltaifHCOutUcastPkts,              

                                                            ifOutUcastPktsT1,          

                                                            ifOutUcastPktsT2);

 

                                    DEFINE InFrmOVHead     INT;

                                    DEFINE OutFrmOVHead   INT;

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

                                    #  DEFINE FrmOVHead        INT;

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

                                   

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

                                    ## The following formulas calculates the In/Out   

                                    ## traffic Overhead values for all traffic passing

                                    ## for the particular interface type

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

 

                                    InFrmOVHead    = (DeltaifHCInUcastPkts) * (12);

 

                                    OutFrmOVHead  = (DeltaifHCOutUcastPkts) * (12);

                                   

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

                                    ## Calculating the time difference between the first and second run polls as reported by each

                                    ## managed element

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

 

                                    DEFINE DeltaT   INT;                             

                                    DeltaT = nTime2 - nTime1;

 

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

                                    #  MSG("ifSpeed = @1, DeltaT = @2",

                                    #                     ifSpeed, DeltaT);

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

 

                                    DEFINE ifSpeed              DB INT;

 

                                    IF         (ifSpeed != 0 AND DeltaT > 0)

                                    THEN

 

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

                                    ## The following formulas calculates the 

                                    ## In/OutUtilization values for all traffic passing