This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Add node (or something) to NCM - NPM

Hi,

I have a question. Can be added a node via SWIS (Orion SDK) ? Can you help me about that? -like sample code-

(I'm working on ASP .Net / C# project about that subject.)

Thanks.

  • I'm not 100% sure on this, but I don't think so because, by default, SWIS is a read-only system.

    For example, Orion's SDK documentation states:

    "Common SQL Constructs Not Supported

    SWQL does not support the following common SQL constructs:

    * SELECT * FROM … (You must list the actual properties you want to select.)

    * UPDATE, INSERT, DELETE, etc. (You can only use SWQL to read data.)"

    And I believe what you're looking for is an insert.

    I'm actually learning to work with Orion and ASP.NET and C# at the moment, too. What are you trying to do?

  • I want to add node to NCM. I can add/delete/update node to Solarwinds via SWIS. I researched and found AddNode and AddNodeToNCM on SWQL at Cirrus.Nodes entity. I can't add existing node at Solarwinds to NCM via AddNode method, passing coreNodeID. I got an error "Node Id 2 does not exist Parameter name: nodeId". So, how can I add existing node at Solarwinds to NCM?

  • The verb you are looking for is Cirrus.Nodes.AddNodeToNCM. Just pass the node id (i.e., "2") and it should do what you want.

  • satventures, SWIS does not support write operations (INSERT/UPDATE/DELETE) through the Query interface, but it does have a different interface for handling write operations. It has specific calls for Create, Update, and Delete plus a general purpose Invoke method for doing more complex operations that do not map to simple Create/Update/Delete. juniordev's "add an existing NPM node to NCM" is an example of one of these more complex operations.

  • Ah, awesome, thank you! I've only been working with SQL, Orion, C#, ASP.NET, and networking for about a month now, so that helps a lot.

  • Thanks tdanner. I don't have to try yet but it's helpful. I have just another question. Can I add node directly to standalone NCM (not relative to NPM) via AddNode method which is required SolarWinds.NCM.Contracts.InformationService.NCMNode ?

    PS: When I try to AddNode method, I gave "Access Cirrus.Node is denied" error.

    That's my code.

                string uri = swis.Create("Orion.Nodes", new PropertyBag

                                                          {

                                                              {"EntityType", "Orion.Nodes"},

                                                              {"IPAddress", "192.168.1.1"},

                                                              {"Caption", "192.168.1.1"},

                                                              {"SysName", "192.168.1.1"},

                                                              {"DynamicIP", false},

                                                              {"EngineID", 1},

                                                              {"Status", 1},

                                                              {"Allow64BitCounters", true},

                                                              {"ObjectSubType", "SNMP"},

                                                              {"SysObjectID", ""},

                                                              {"MachineType", ""},

                                                              {"VendorIcon", ""},

                                                              {"Community", ""},

                                                              {"SNMPVersion", 2},

                                                              {"MemoryUsed", -2},

                                                              {"CPULoad", -2},

                                                              {"PercentMemoryUsed", -2 }

                                                              //,{"Test", "CustomPropTest"}

                                                          });

                    string nodeID = uri.Replace("swis://./Orion/Orion.Nodes/NodeID=", "");

                    string uriCM = swis.Create("Cirrus.Nodes", new PropertyBag

                                                          {

                                                              {"coreNodeId", nodeID}

                                                          });

                    Console.WriteLine(uriCM);

  • Hello again,

    I'm still researching. I got this error below code part. : "Cirrus.Nodes.AddNodeToNCM: Cannot find assembly". I couldn't find the required assembly for that adding process.

                    ProxyMarshalHelper helper = new ProxyMarshalHelper();

                    helper.ArgsStart();

                    helper.ArgsAdd(typeof(System.Int32), nodeID);

                    var element = new ArrayOfXmlElement();

                    element.AddRange(helper.ArgsEnd());

                    client.Invoke("Cirrus.Nodes", "AddNodeToNCM", element);

  • The NCM ("Cirrus") verbs are currently only available when connecting to SWISv2. The URL for SWISv2 should not have "v3" in it.

  • The right way to do it is to add the node to Orion.Nodes, then call Cirrus.Nodes.AddNodeToNCM. We don't have a supported way to add a node to NCM without adding it to Orion.Nodes first.

  • Hello again,

    That below code is adding an existing Node (created runtime) to NCM. There is only question & problem. If I want to use AddNode method, I don't know to pass NCMNode object to AddNode Verb by XML. Can you give any suggest?

    XmlDocument xdoc = new XmlDocument();

    XmlElement[] elem = new System.Xml.XmlElement[1];

    XmlElement xel = xdoc.CreateElement("coreNodeId");

    xel.InnerText = nodeID;

    elem[0] = xel;

    client.Invoke("Cirrus.Nodes", "AddNodeToNCM", elem);