13 Replies Latest reply on Nov 27, 2013 10:27 PM by alexnguyen

    Orion SDK --Perl -- Add node issue


      Using below Perl code against our standalone NCM setup, I can create new node and attach "SNMP" pollers to it. I can see, through querying SWQL, that the software (NCM 7.2.1) populate node data in Orion.Nodes (vendor, vendor icon, systemoid, location..) but only when it due for next discovery (30mins), I dont see the software discover it at first place after added. Also when drilling into node detail page, all the information under Node details are suppressed. Checking the Orion.DiscoveredPoller and DiscoverNodes, I could not see my new node in either of them, Am i missing anything?




      ***** extracted code ****


      my $AddedNode = $swis->Create('Orion.Nodes',


          IPAddress=> $ip,













          Comments=>"added by script",



      $swis->Create("Orion.Pollers", {






        • Re: Orion SDK --Perl -- Add node issue

          Hi, according to the SDK's Technical Reference section "Examples of CRUD Operations/Required Properties by Protocol", there are three properties required to initialize in the Create operation as well:

          • SysObjectID
          • MachineType
          • VendorIcon

          All the three should be initialized to an empty string.


          Also, I'd recommend to initialize the RediscoveryInterval property to a reasonable value, the interval you set means that in this period you should get the node first re-discovered.

          • Re: Orion SDK --Perl -- Add node issue

            here is what I have discovered as the minimum to get a node added in perl. The SDK may show minimums, but the webUI needs more than those to prevent giving errors in random places [aside: these should really have been put into the database as defaults]


                    my $AddedNode=$swis->Create('Orion.Nodes',
                            'IPAddressguid' => ip2guid($ip),
                            'Comments'=>'Added by noc',
            • Re: Orion SDK --Perl -- Add node issue

              Hi all,


              Thanks for the reply.

              I have tried both suggestions, Richard's solution does help to show pop-up menu, which I did not get it with my code.

              I was not able to drill into node page with Tom's suggestion,got this error

              Till I manually initiate re-discovery throught the WebUI, I can get into the node detail. What is the script to initiate re-discovery? Keep in mind that I only have standalone NCM and does not have NPM module in my environment. I have actually tried to invoke DiscoverInterfaceOnNode in Orion.Interfaces Class with no luck


              I am still not able to see data under Node detail as reported orignally. When attempting to download config, the added node does not shown up in the config management page. When trying to sync node (in Orion database) to NCM database, the new added node does not get synced.


              Richard, I am curious to know if you could download config or see the new added node under config managemenet page?

                • Re: Orion SDK --Perl -- Add node issue

                  Alex, could on that error page, please click "Save Error Report Locally". You'll get a text file containing the exception stack trace and some more details. Attach it to this thread and I should be able to figure out what is going wrong here.

                    • Re: Orion SDK --Perl -- Add node issue

                      hi Tdanner,

                      See below is the trace of the error. Looks to me that it is resulted of init of empty string of the Machine type


                      Time: 11/25/2013 08:37:26.7946

                      Server: Microsoft-IIS/7.0

                      Pipeline: Integrated

                      User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.0.30618; .NET CLR 3.5.30729)

                      Error Instance: c9b86935ddcb49e0ae494f3be57543ca

                      User: Admin



                      Message: Unable to cast object of type 'System.DBNull' to type 'System.String'.

                      ErrorSite: NetPerfMonWeb.Node.get_MachineType

                      ErrorType: System.InvalidCastException


                      at SolarWinds.Orion.NPM.Web.Node.get_MachineType()

                      at Orion_NetPerfMon_NodeDetails.GetViewForDeviceType()

                      at SolarWinds.Orion.Web.UI.OrionView.SelectView()

                      at SolarWinds.Orion.Web.UI.OrionView.OnPreInit(EventArgs e)

                      at System.Web.UI.Page.PerformPreInit()

                      at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


                      Version          Assembly

                      ---------------- ------------------------------------------

            ,     Antlr3.Runtime

                      8.2.20082.1000,  Infragistics2.WebUI.Shared.v8.2

                      8.2.20082.1000,  Infragistics2.WebUI.UltraWebChart.v8.2

                      8.2.20082.1000,  Infragistics2.WebUI.UltraWebGauge.v8.2

                      8.2.20082.1000,  Infragistics2.WebUI.UltraWebNavigator.v8.2

            ,         Accessibility

            ,         g3ihfde1

                      12.1.20121.2038, Infragistics4.Documents.Excel.v12.1

            ,         Microsoft.Build.Framework

            ,         Microsoft.Build.Utilities.v4.0

            ,         Microsoft.CSharp

            ,        Microsoft.JScript

            ,        Microsoft.VisualBasic.Activities.Compiler

            ,        Microsoft.VisualC

            ,         mscorlib

            ,         SMDiagnostics

            ,         System

            ,         System.Activities

            ,         System.ComponentModel.Composition

            ,         System.ComponentModel.DataAnnotations

            ,         System.Configuration

            ,         System.Configuration.Install

            ,         System.Core

            ,         System.Data

            ,         System.Data.DataSetExtensions

            ,         System.Data.SqlXml

            ,         System.Design

            ,         System.DirectoryServices

            ,         System.DirectoryServices.AccountManagement

            ,         System.Drawing

            ,         System.Drawing.Design

            ,         System.EnterpriseServices

            ,         System.IdentityModel

            ,         System.IdentityModel.Selectors

            ,         System.Management

            ,         System.Numerics

            ,         System.Runtime.Caching

            ,         System.Runtime.DurableInstancing

            ,         System.Runtime.Serialization

            ,         System.Security

            ,         System.ServiceModel

            ,         System.ServiceModel.Activation

            ,         System.ServiceModel.Activities

            ,         System.ServiceModel.Channels

            ,         System.ServiceModel.Discovery

            ,         System.ServiceModel.Routing

            ,         System.ServiceModel.Web

            ,         System.Transactions

            ,         System.Web

            ,         System.Web.ApplicationServices

            ,         System.Web.DynamicData

            ,         System.Web.Extensions

            ,         System.Web.Extensions.Design

            ,         System.Web.Mobile

            ,         System.Web.RegularExpressions

            ,         System.Web.Services

            ,         System.Windows.Forms

            ,         System.Workflow.Activities

            ,         System.Workflow.ComponentModel

            ,         System.Workflow.Runtime

            ,         System.WorkflowServices

            ,         System.Xaml

            ,         System.Xaml.Hosting

            ,         System.Xml

            ,         System.Xml.Linq

                      4.1.50927.0,     AjaxControlToolkit

            ,         AntiXssLibrary

            ,         AspNet.ScriptManager.jQuery

            ,         AxInterop.C1Query80

            ,         AxTomSawyer

            ,       EO.Pdf

            ,         FiftyOne.Foundation

            ,         HtmlAgilityPack

            ,         HtmlSanitizationLibrary

            ,         Interop.C1Query80

            ,         Interop.stdole

            ,        log4net

            ,         Microsoft.AspNet.SignalR.Client

            ,         Microsoft.AspNet.SignalR.Core

            ,         Microsoft.AspNet.SignalR.Owin

            ,         Microsoft.AspNet.SignalR.SystemWeb

            ,         Microsoft.Owin.Host.SystemWeb

            ,         Microsoft.Practices.ServiceLocation

                      2.1.505.0,       Microsoft.Practices.Unity

            ,         Microsoft.Web.Infrastructure

            ,         Microsoft.Web.Services3

            ,         MiniProfiler

                      7.0.3300.0,      MSDATASRC

                      2013.1.4.1011,   NetPerfMonWeb

            ,         Newtonsoft.Json

                      2013.1.4.1011,   OrionWeb

            ,         Owin

            ,         SmartThreadPool

            ,       SolarWinds.Cirrus.IS.Client

            ,       SolarWinds.Cirrus.OrionLayer

            ,       SolarWinds.Cirrus.Web

                      2013.1.4.1011,   SolarWinds.Common

            ,       SolarWinds.ConfigManagement.Core

            ,         SolarWinds.Data

                      2011.5.0.130,    SolarWinds.Data.Entity

                      2011.5.0.130,    SolarWinds.InformationService.Addons

            ,         SolarWinds.InformationService.Contract

                      2013.1.0.130,    SolarWinds.InformationService.Contract2

                      2013.1.4.1011,   SolarWinds.Internationalization

            ,        SolarWinds.JobEngine.Contract

            ,        SolarWinds.JobEngine.Contract2

            ,       SolarWinds.Licensing.Framework

            ,         SolarWinds.Logging

            ,        SolarWinds.MapEngine

            ,        SolarWinds.MapStudio.Strings

            ,        SolarWinds.MapStudio.Web

            ,       SolarWinds.NCM.Contracts

            ,         SolarWinds.NCM.NodeManagement

            ,       SolarWinds.NCM.Strings

            ,         SolarWinds.NCMModule.Web.Inventory

            ,       SolarWinds.NCMModule.Web.Resources

            ,       SolarWinds.NCMModule.Web.Search

                      2013.1.4.1011,   SolarWinds.Net.ICMP

                      2013.1.4.1011,   SolarWinds.Net.SNMP

                      2013.1.4.1011,   SolarWinds.Net.WMI

            ,         SolarWinds.NPM.Web.Gauge.V1

            ,         SolarWinds.Orion.Common

                      2013.1.4.1011,   SolarWinds.Orion.Core.Common

                      2013.1.4.1011,   SolarWinds.Orion.Core.Data

                      2013.1.4.1011,   SolarWinds.Orion.Core.Jobs

                      2013.1.4.1011,   SolarWinds.Orion.Core.Models

                      2013.1.4.1011,   SolarWinds.Orion.Core.Reporting

                      2013.1.4.1011,   SolarWinds.Orion.Core.SharedCredentials

                      2013.1.0.0,      SolarWinds.Orion.Core.Strings

                      2013.1.0.0,      SolarWinds.Orion.Core.Web

                      2013.1.4.1011,   SolarWinds.Orion.Discovery.Contract

                      2013.1.4.1011,   SolarWinds.Orion.Pollers.Framework

                      2013.1.4.1011,   SolarWinds.Orion.Security

                      2013.1.4.1011,   SolarWinds.Reporting

                      2013.1.4.1011,   SolarWinds.Shared

            ,         SWPicExtFactoryLib

            ,         TomSawyer

            ,         TSEDefaultExtFactoryLib

            ,         App_Code.so1p8jgk

            ,         App_global.asax.xrairt9c

            ,         App_GlobalResources.iqnnc8n_

            ,         App_Web_0waz1cxo

            ,         App_Web_3bf4qsbm

            ,         App_Web_43d0hn5g

            ,         App_Web_51jd4gey

            ,         App_Web_5l304q43

            ,         App_Web_awav0h0j

            ,         App_Web_ddai5ypd

            ,         App_Web_doczlwtr

            ,         App_Web_ecohr5om

            ,         App_Web_f44x3ggy

            ,         App_Web_gpgtlhxa

            ,         App_Web_ia5znu1i

            ,         App_Web_jpbbrwbp

            ,         App_Web_k1ektuid

            ,         App_Web_mem1kbyc

            ,         App_Web_no3lxbfv

            ,         App_Web_nqm3hcxw

            ,         App_Web_sr3jxng2

            ,         App_Web_szgwjgua

            ,         App_Web_tc1et53w

            ,         App_Web_twcts5xk

            ,         App_Web_v1t0aad3

            ,         App_Web_v2dwfbpa

            ,         App_Web_xhe3hzor

            ,         App_Web_xltfrjtz

            ,         App_Web_y4wgrdkn

            ,         App_Web_yevpkdw0

            ,         App_Web_zf01zwh1

            ,         App_Web_zpkvo4my

            ,         A_c27acc3d_2a38_4739_aff6_9553311bd353

            ,         Anonymously Hosted DynamicMethods Assembly

                        • Re: Orion SDK --Perl -- Add node issue

                          This error indicates that the MachineType contains a NULL value instead of a string value, scripts should always initialize this property to an empty string. Are you sure that your script initializes it properly?

                            • Re: Orion SDK --Perl -- Add node issue


                              a) if NULLS are not supported in the database then do not allow them to be inserted; I mean you're literally allowing trouble to the stored for the future.


                              b) if you don't want to do that then default them to a sensible value; e.g. if setting an unknown machinetype to '' is the right thing for the program inserting data to do, then help out the programmer by making the database do this for you.


                              so many of the UI glitches and niggles would be fixed by adding not null with default to the schema (which is what setting all of those values to '-2' is for -- so the darned popover widget works.)

                                • Re: Orion SDK --Perl -- Add node issue

                                  I agree and we are aware of the fact that the API is not robust enough, however we are working on improvements in this area.

                                  • Re: Orion SDK --Perl -- Add node issue

                                    Tom, I did init the SysObjectID, MachineType & Vendor icon as your suggestion and got that error. (see below for my code)


                                    my $AddedNode = $swis->Create('Orion.Nodes',


                                        IPAddress=> $ip,













                                        Comments=>"added by script",






                                    If i comment out the last three lines, the error disappear and i can drill into Node detail page.

                                    I am still not able to see "Node Details" info under Manage Nodes, The added node does not get synced to NCM database in which I can confirm through License details page.

                                      • Re: Orion SDK --Perl -- Add node issue

                                        In order to the added node to get synced through to the NCM database you need to have an additional step:


                                        $swis->Invoke('Cirrus.Nodes', 'AddNodeToNCM', [$nodeid]);

                                        where $nodeid is the node id returned from the create step above.

                                        see:SDK 1.5 invoke with Perl ?

                                        ** note **

                                        you might need to get the sysobjectID for the node and fill it in correctly -- I have found that the NCM product never resyncs the sysObjectID after the node has been created, so if someone replaces your (say) HP switch with a Juniper switch NCM will try to use the HP methods


                                        1 of 1 people found this helpful
                                          • Re: Orion SDK --Perl -- Add node issue


                                            My invoke function return nothing, hence it does not add the node to NCM database as it should. I have tried with the updated InformationService.pm but no luck. However, if I try manually add (to NCM) via webUI, the new node get synced fine and i can see the node detail data under node detail page. I have also found that I need to provide the machinetype and vendor property along with the sysobjectID to be able to add node to Orion database properly.


                                            What is the returne result of your invoke command?

                                              • Re: Orion SDK --Perl -- Add node issue

                                                turned on XML output and received this error when calling invoke function to sync node from Orion into NCM database.Any idea?


                                                2013-11-28 13:49:12,503 [23] ERROR SolarWinds.InformationService.Core.InformationService - Exception caught in method Invoke

                                                SolarWinds.InformationService.Verb.VerbExecutorException: Verb Cirrus.Nodes.AddNodeToNCM: Cannot find assembly

                                                   at SolarWinds.InformationService.Verb.VerbExecutor.EnsureCached(VerbExecutorContext verbExecContext)

                                                   at SolarWinds.InformationService.Verb.VerbCache.GetVerbContext(String entity, String verb, VerbExecutor& executor, VerbExecutorContext& context)

                                                   at SolarWinds.InformationService.Core.InformationService.InvokeInternal[T](String entity, String verb, Action`1 setupParameters, Func`2 extractReturnValue)

                                                   at SolarWinds.InformationService.Core.InformationService.Invoke(String entity, String verb, XmlElement[] parameters)

                                                </log></s:Header><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring xml:lang="en-US">Invoke failed, check fault information.</faultstring><detail><InformationServiceFaultContract xmlns="http://schemas.solarwinds.com/2007/08/inform

                                                ionservice" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Message>Verb Cirrus.Nodes.AddNodeToNCM: Cannot find assembly</Message></InformationServiceFaultContract></detail></s:Fault></s:Body></s:Envelope>