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?
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.
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);
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);
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.