cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 10

NCM script for ISE configuration Switch interface level

Hello All,

I want to automate the interface wise ISE configuration through Solarwinds NCM.

The challenge is i want the script to pick itself VLAN id in switch port Configuration from VLAN desc.   (If VLAN desc matches suppose "Printers").

Once this will be found, it will run commands on all interfaces in same VLAN using the VLAN ID which we found earlier.

Manual configuration on all Access Switches is a very time consuming task and we want to make best utilization of our NCM tool for this activity.

I have gone through NCM admin guide, but I am not getting how can I record VLAN ID and use it in Switch port configuration.

Kindly help to create the script.

Thanks in Advance.

Sayali.

Labels (2)
0 Kudos
2 Replies
Level 7

Hi Sayali,

Here's an example for an automic port config based on description.

Regards,

Denis

/*

.CHANGE_TEMPLATE_DESCRIPTION

        This template configures physical interfaces based on interface description.  It was verified on a Cisco 3850 Catalyst Switch running IOS software version 16.3.7.

.CHANGE_TEMPLATE_TAGS

Cisco, interface, VLAN, description, properties

.PLATFORM_DESCRIPTION

        Cisco IOS

.PARAMETER_LABEL @ContextNode

        NCM Node

.PARAMETER_DESCRIPTION @ContextNode

        The node the template will operate on.  All templates require this by default. The target node is selected during the first part of the wizard so it will not be available for selection when defining values of variables.

*/

script ChangeInterfacesBasedOnDescription (

                                            NCM.Nodes @ContextNode

                                                         )

{

  // Enter configuration mode

  CLI

  {

    configure terminal

  }

  int @MatchFound

  

  @MatchFound = 0

  // Loop through selected interfaces

  foreach (@interfaceItem in @ContextNode.Interfaces)

  {

    if (@interfaceItem.InterfaceDescription contains 'VLAN')

    {

       // Do nothing if it's not a physical interface

    }

    else

    {

     

if (@interfaceItem.InterfaceAlias contains 'AutoConfig;UserData;')

{

// Set command

CLI

{

interface @interfaceItem.InterfaceDescription

switchport access vlan 528

switchport voice vlan 596

switchport mode access

no logging event link-status

exit

}            

@MatchFound = 1

}

if (@interfaceItem.InterfaceAlias contains 'AutoConfig;Printer;')

{

// Set command

CLI

{

interface @interfaceItem.InterfaceDescription

switchport access vlan 534

switchport mode access

no logging event link-status

exit

}            

@MatchFound = 1

}

      

    }

  }

  if (@MatchFound != 1)

  {

     CLI

     {

         NO MATCHES FOUND

     }

  }

  // Exit configuration mode

  CLI

  {

    exit

  }

}

thanks...!!!

0 Kudos