Showing results for 
Search instead for 
Did you mean: 
Level 7

Vlan mapping through PYTHON


Question: We would like to achive vlan mapping where user only have to put his/her mac address of the device and destination vlan to be mapped.

We are doing vlan mapping for end user devices and want to execute some commands before we map source vlan to destination vlan with the help of mac address. and we are doing this in python programming.

Below are the things which we are trying to execute:

  1. Find the source port with the help of mac address.
  2. take the backup of the specific interface.
  3. migrate the source vlan to destination vlan.
  4. save the configuration to memory.
  5. exit the program.

We accomplished port finding but not able to take the backup of specific interface..

1. query to find the source port:

select DISTINCT NLC.NodeID, NLC.PortID, NLC.MACAddress,intf.InterfaceName

FROM Orion.NodeL2Connections  NLC

INNER JOIN Orion.NodePortInterfaceMap  NPM ON NPM.NodeID=NLC.NodeID  and npm.PortID=nlc.PortID


INNER JOIN Cirrus.Interfaces INTF ON INTF.NodeID=NS.NodeID AND INTF.InterfaceIndex=NPM.IfIndex

where MACAddress='xxxxxxxxxxx' and npm.porttype=1

2. I have gone through this NCM Config Transfer · solarwinds/OrionSDK Wiki · GitHub  but still not able to understand that we can execute below command and put the output into another file. just would like to confirm where it is possible or we have to take complete switch configuration backup?

command: show run | fastethernet 0/x and w

3.  We want to migrate the source vlan to destination vlan but confused whether we require switch creds or not?

4. How can we select the test switch and run any commands also please tell us what rights user need to have in order to perform this activity?

0 Kudos