SmartMIB Small Solution:

Discovering Network-Wide Links


(SM-SmallSol0039)

Solution’s SOSL Based management process script:

 

The solution defines the following main module:

 

MainNetworkLinks:

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

 

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

 

 


MODULE MainNetworkLinks ();

DESCRIPTION "Async Interface Count";

BEGIN

 

            POLL-FREQ

            {

                        MODULE-CALL NetworkLinks();

                        WAIT (12000);

            };

END


MODULE  NetworkLinks ();

DESCRIPTION "Network Links information";

BEGIN

 

            DEFINE intDevicesCount INT;

 

            intDevicesCount = 0;

 

            ALL-DEV BY DEV

            {

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

                        # Creating an internal Database Index for each

                        # managed device

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

 

                        DEFINE cdpGlobalRun INT;

                        DEFINE dbDeviceNumber DB DISPL;

 

                        intDevicesCount = intDevicesCount + 1;

                        dbDeviceNumber = intDevicesCount;

 

                        cdpGlobalRun = POLL( cdpGlobalRun );

 

                        IF( cdpGlobalRun == 1 )            

                        THEN    

                                    DEFINE intLinksCount INT;

 

                                    intLinksCount = 0;

 

                                    POLL( cdpGlobalDeviceId );

 

                                    SET-INDEX cdpCacheTable

                                    (cdpCacheDeviceId [cdpCacheIfIndex, INT; cdpCacheDeviceIndex, INT]);

 

                                    WITH-INDEX cdpCacheTable

                                    {

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

                                                # Creating an internal Database Index

                                                # for each Link on each managed device

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

 

                                                DEFINE cdpCacheIfIndex DB DISPL;

                                                DEFINE dbLinkNumber DB DISPL;

 

                                                intLinksCount = intLinksCount + 1;

                                                dbLinkNumber = intLinksCount;                                      

 

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

                                                # Retrieving the relevant information for

                                                # the local interface including the

                                                # Administrative and the Operational Statuses.

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

                                               

                                                DEFINE ifName DB DISPL;

                                                DEFINE ifAdminVar DISPL;

                                                DEFINE ifOperStatus DB DISPL;

                                                                                               

                                                ifName = POLL (DEV, ifName, cdpCacheIfIndex);

                                                ifAdminVar = POLL (DEV, ifAdminStatus, cdpCacheIfIndex);

                                                ifOperStatus = POLL (DEV, ifOperStatus, cdpCacheIfIndex);

 

                                                IF (ifAdminVar == "up" )

                                                THEN

                                                            POLL(cdpCacheAddressType);

           

                                                            DEFINE cdpCacheAddressType    DB DISPL;

 

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

                                                            # Retrieving the relevant CDP Cache 

                                                            # information for the remote

                                                            # interface only if the interface

                                                            # is an IP interface.

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

 

                                                            IF (cdpCacheAddressType == 1 )

                                                            THEN

 

                                                                        DEFINE cdpCacheDeviceId DB DISPL;

                                                                        DEFINE cdpCacheDevicePort DB DISPL;

                                                                        DEFINE cdpCacheAddress DB DISPL;

 

                                                                        POLL( cdpCacheDevicePort; cdpCacheAddress);

                                                           

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

                                                                        # Troubleshooting Messages:

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

                                                                        #WAIT(10);

                                                                        #MSG-MGR(" is connected to device: @1, @2",

                                                                        #    cdpCacheDeviceId, cdpCacheAddress);

                                                                        #WAIT(10);

                                                                        #MSG-MGR(" on Port : @1, and Interface @2",

                                                                        #    cdpCacheDevicePort, ifName);

                                                                        #WAIT(10);

                                                                        #MSG-MGR("~~~~~~~~~~~~~~~~~~~~~");

                                                                        #WAIT(20);

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

                                                            ENDIF;

                                                ENDIF;

                                    };

                        ENDIF;

            };

END

 


Discovering Network-Wide Links Index Page

Previous Page Page 3/5 Next Page


[Small Solutions], [Professional Solutions], [Security Solutions], [Development Solutions]

[Home], [About], [Solutions Center], [NMS Market], [Products & Services],
[Management Technology], [Technical Support], [Contact us], [Site Map]