5 Replies Latest reply on Aug 17, 2012 2:08 PM by tdanner

    Getting Switch Port details through SDK-API

    adat

      Hi,

      I am new user of Orion , and having less knowledge of scripting and all. I am  using  UDT and having a Change Management System. My requirement is --through that CMS web API, I will send an IP address to Orion UDT, and in return need Corresponding Switch and Port details from UDT. If anyone can help to achieve this through SDK/API/Script etc...

        • Re: Getting Switch Port details through SDK-API
          tdanner

          Something like this should get you what you need. I'll give the example in powershell:

           

          Add-PSSnapin SwisSnapin

          $swis = Connect-Swis -Hostname yourorionserver  # this will prompt you for credentials

          Get-SwisData $swis "SELECT n.IP_Address, n.Caption, p.Name, p.Speed, p.PortType FROM Orion.Nodes n JOIN Orion.UDT.Port p ON n.NodeID = p.NodeID WHERE n.IP_Address = @ip AND p.IsExcluded = 0 AND p.IsMissing = 0" @{ip="1.2.3.4"}

           

          That should get you the name and management IP of the connected switch, plus the name, speed, and type of the port it is on.

            • Re: Getting Switch Port details through SDK-API
              adat

              Thanks tdanner, I am little bold now. I want to achieve as mentioned below.... Can these be achieved through Orion---

              1. A user desktop is connected with Switch ‘X’ in port Number  ‘1’.  The VLAN membership configured in the port ‘1’as VLAN ‘A’.
              2. The user desktop will get an IP address (Say 10.1.1.1) from ‘A’ VLAN subnet , from the DHCP server.
              3. Likewise Switch X having multiple such other user desktops are connected with.
              4. In same way there might have multiple other switches in LAN like ‘Y’, ‘Z’ etc. where multiple other desktops are connected with.
              5. Desktops one NIC card will be physically connected with one switch port, and the NIC will have single MAC address.
              6. In switch ‘X’ there will be one MAC to corresponding IP address in ARP table.
              7. Our Ticketing system will be sending an IP address to UDT, like 10.1.1.1 in this example. And an would be VLAN ID , let’s say VLAN ‘B’ for this example.
              8. UDT will take the IP Address (10.1.1.1) and will check in his DB and will return—Direct connection details of this IP ---
                • Switch ‘X’
                • Port number ‘1’
                • Present VLAN ‘A’

               

                   9. The above output of point number ‘8’ (a,b &c) will be passed on to NCM

                   10 Would be VLAN ID  ‘B’ also passed to NCM in step 7.

                   11. Now NCM will generate a script to ---

                • Remove VLAN ‘A’ from switch ‘X’, Port number ‘1’
                • Add VLAN ‘B’ membership in switch ‘X’ Port number ‘1’.
                • On completion will return a value to ticketing system as Done or Not Done.