1 2 3 4 5 6 Previous Next 137 Replies Latest reply on Jul 22, 2015 10:44 AM by allistair Go to original post
      • 125. Re: Orion SDK Information
        tdanner

        NPM 9.1 is too old to support the SDK. Here's what I would do in your place:

         

        1. Use a database tool (SQL Management Studio or our Database Manager app) on the old server to extract the IPs of the nodes (SELECT IP_Address FROM Nodes) and use this as the discovery list (paste it into the textbook for the "Specific Nodes" on the "Network" page for the discovery wizard) for your new server.

         

        2. If you have custom property data in the old database that you care about, use the Custom Property Editor app on the old server to export these custom properties to a CSV file. On the new server, you can import this CSV files using the (now web-based) Custom Property Editor interface with IP address as the matching field.

        • 126. Re: Orion SDK Information
          allistair

          Thanks very much for the information.

          Can i use SDK to import the info to the new server that has NPM 11.5 including the interfaces and the node groups?

          I have no problem getting the info from the old server but i want to keep the IPs with the interfaces that are being monitored and also the node groups.

          • 127. Re: Orion SDK Information
            tdanner

            NPM 9.1 did not have node groups. In those versions users generally used custom properties for ad hoc node grouping.

             

            I don't think using the SDK to do the initial import would really buy you anything. Better to just copy the IP address list and let discovery handle the initial import. By default, discovery will import all of the active interfaces it finds. If you want to monitor the same subset of these interfaces that you were monitoring on the old server, you could extract that list from the old database (SELECT N.IP_Address, I.InterfaceIndex FROM Interfaces I INNER JOIN Nodes N ON N.NodeID=I.NodeID) and then delete anything in new system that discovery imported that isn't part of that set. This is a place the SDK can help: deleting a bunch of interfaces using a list.

            • 128. Re: Orion SDK Information
              allistair

              Thank much. I will try that and get back to you.

              • 129. Re: Orion SDK Information
                allistair

                So I'm having a bit of a challenge of the CRUD script i should run i SDK to delete specific interfaces to different nodes in bulk. I have a list with the current InterfacesIndex with the IP_Address that i only want to be monitored and currently all the interfaces for these IP addresses are in NPM. Any suggestions?

                • 130. Re: Orion SDK Information
                  tdanner

                  You have a list of the node IP addresses and interfaces indexes you want to monitor. Use the same query against the new system to pull the list of what you are monitoring there (including the Uri property for those interfaces). Find everything in the second list that is not in the first list. Run a delete operation on the Uri values that remain.

                  • 131. Re: Orion SDK Information
                    allistair

                    I ran the SWQL querry that gives me a list of all the interfaces(including the WebUri) from the Orion.NPM.InterfaceWebUri DB and correlate it with the NodeID on Orion.Nodes DB and i got a list with the InterfaceID (eg; 1478), WebUri (eg; /Orion/Interfaces/InterfaceDetails.aspx?NetObject=I:1478) and IP_Address (eg; 10.0.0.0).

                     

                    SELECT I.InterfaceID, I.WebUri, N.IP_Address

                    FROM Orion.NPM.InterfaceWebUri I

                    Join Orion.Nodes N

                    ON N.NodeID=I.NodeID

                     

                    I used this list to find everything that is in the second but in the first.

                     

                    Can you provide me with a delete operation that I can use on Uri?

                    • 132. Re: Orion SDK Information
                      tdanner

                      The Uri is not the same as the WebUri. Use a query like this:

                       

                      SELECT I.InterfaceID, I.Uri, N.IP_Address

                      FROM Orion.NPM.Interfaces I

                      Join Orion.Nodes N

                      ON N.NodeID=I.NodeID

                       

                      I don't know what environment you are using, but in PowerShell you can delete an object like this:

                       

                      $uri = ... get the uri from somewhere ...

                      $swis = Connect-Swis ... connection details and credentials...

                      Remove-SwisObject $swis $uri

                      • 133. Re: Orion SDK Information
                        allistair

                        Can i add multiple Uris to the field

                        eg.

                        $uri = ....."uri location1";"uri location2";"uri location3"

                        $swis = Connect-Swis ... connection details and credentials...

                        Remove-SwisObject $swis $uri

                        would it run like that or would it only take the first location into account?

                        • 134. Re: Orion SDK Information
                          tdanner

                          Remove-SwisObject will accept multiple Uris as pipeline input. Like this:

                           

                          $uris = @( $uri1, $uri2, $uri3 )

                          $uris | Remove-SwisObject $swis

                           

                          It doesn't have to be an explicit collection like that. Any pipeline source of Uris would work.

                          • 135. Re: Orion SDK Information
                            allistair

                            It worked like a charm. Thanks again.

                            I am trying to add nodes that are currently down using the SDK and I have having some issues. When i was testing my script on a node that is up, it is added and it polls the node details. If that node goes down the status does not change. Same thing happens when i add a node that is down and when it comes back up the status stays down. Could it be because of the IPAddressGUID or the Status? Is there something i am doing wrong?

                             

                            $swis = Connect-Swis

                            $newNodeProps = @{ EntityType="Orion.Nodes";

                            IPAddress="10.132.100.1";

                            IPAddressGUID="";

                            Caption="";

                            DynamicIP=$False;

                            EngineID=1;

                            Status=2;

                            UnManaged=$False;

                            Allow64BitCounters=$False;

                            SysObjectID="";

                            MachineType="";

                            VendorIcon="";

                            ObjectSubType="SNMP";

                            SNMPVersion=2;

                            Community="public"}

                            $newNodeUri = New-SwisObject $swis –EntityType "Orion.Nodes" –Properties $newNodeProps

                            $nodeProps = Get-SwisObject $swis -Uri $newNodeUri

                            $poller = @{ NetObject="N:"+$nodeProps["NodeID"]; NetObjectType="N"; NetObjectID=$nodeProps["NodeID"];}

                            $poller["PollerType"]="N.Details.SNMP.Generic";

                            $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

                            $poller["PollerType"]="N.Uptime.SNMP.Generic"; $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

                            $poller["PollerType"]="N.Cpu.SNMP.CiscoGen3"; $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

                            $poller["PollerType"]="N.Memory.SNMP.CiscoGen3"; $pollerUri = New-SwisObject $swis -EntityType "Orion.Pollers" -Properties $poller

                            • 136. Re: Orion SDK Information
                              tdanner

                              You need a couple more pollers: one for status and one for response time. Both of these can be done with either SNMP or ICMP. Assuming it works on your network, ICMP will generally be more accurate for response time. The PollerType values for response time are:

                               

                              N.ResponseTime.ICMP.Native

                              N.ResponseTime.SNMP.Native

                               

                              The PollerType values for Status (Up/Down) are:

                               

                              N.Status.ICMP.Native

                              N.Status.SNMP.Native

                               

                              For future questions, please create a new "Discussion" for each one. That makes it easier to keep track of what has been answered.

                              • 137. Re: Orion SDK Information
                                allistair

                                Good Morning,

                                I would like to do is use the SDK to add multiple down nodes to NPM and keep them in monitoring until they come back up but I have having an issue adding multiple IP address. How can i ammend my script to add multiple IP addresses? Can you confirm if I need to add any more pollers so when they come up the would function as normal.

                                $swis = Connect-Swis

                                $newNodeProps = @{ EntityType="Orion.Nodes";

                                IPAddress="10.132.100.1", "10.123.0.2","10.345.2.6"

                                IPAddressGUID="";

                                Caption="";

                                DynamicIP=$False;

                                EngineID=1;

                                Status=2;

                                UnManaged=$False;

                                Allow64BitCounters=$False;

                                SysObjectID="";

                                MachineType="";

                                VendorIcon="";

                                ObjectSubType="SNMP";

                                SNMPVersion=2;

                                Community="public"}


                                POLLERS

                                I.StatisticsTraffic.SNMP.Universal

                                N.IPAddress.SNMP.Generic

                                N.Status.SNMP.Native"

                                N.ResponseTime.SNMP.Native

                                N.Memory.SNMP.CiscoGen3

                                N.Cpu.SNMP.CiscoGen3

                                N.Uptime.SNMP.Generic

                                1 2 3 4 5 6 Previous Next