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 to NCM via .NET

Trying to add a node to NCM using the SDK with C# .NET. Have the following code:

System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument();

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

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

xel.InnerText = nodeID.ToString();

elem[0] = xel;

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

Following exception results: "Invoke failed, check fault information."

Where can I check this fault info? Seems like this should work from looking around the message board.

Also - Can I set the NCM Global Connection Profile using the SDK in a similar way?

  • Hello, in general the fault information you should be able to find in the Orion.InformationService.log.

    The default location is (dependent on used endpoint):

    • SWISv2: c:\Users\All Users\Solarwinds\InformationService\v2.0\
    • SWISv3: c:\Users\All Users\Solarwinds\InformationService\v3.0\

    However in my mind there come some two reasons why the invoke may fail:

    1. You might be using the v3 endpoint, although this verb is as far as I know available for already released NCM versions only under v2
    2. I remember the only argument for this verb is the coreNodeId, which is Integer, not String - maybe sorry if this is blind path, I'm not very familiar with C# and it's invokation syntax

    I hope it helped.

    Honza

  • Hello,

    Adding to Jan

      To set the credentials for NCM,

    1. For adding credentials for already added node, use “UpdateSelectedNodeColumnsverb and provide values for Username, Password, EnableLevel, EnablePassword,…
    2. You can also create global connection profile using “AddConnectionProfile” and update ConnectionProfile property in Nodes using “UpdateSelectedNodeColumns”.
      The credentials can be either encrypted or plain.

    It would be better to encrypt the credentials. To encrypt, use the below mentioned steps  

    1. Use the verb ”EncryptData” against “Cirrus.Settings” entity to encrypt data. To use this connect to V2 certificate swis service.
    2. You can also decrypt the data using the verb “DecryptData”.  
  • Thanks for path to logs! Here is the error I am getting.

    SolarWinds.InformationService.Verb.VerbExecutorException: Verb Cirrus.Nodes.AddNodeToNCM: Not found

    Should I be pointing to a different endpoint for NCM? Current end point is: https://server:17778/SolarWinds/InformationService/OrionBasic

  • That looks like the right endpoint. Could you look in the C:\ProgramData\Solarwinds\InformationService\v3.0\Orion.InformationService.log to find that error and copy the lines around it into a reply here?

  • tdanner

    2014-02-19 10:54:30,260 [6] ERROR SolarWinds.InformationService.Core.InformationService - Exception for Operation: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

      <s:Header>

        <i18n xmlns="http://schemas.solarwinds.com/2007/08/informationservice" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

    <Culture>en-US</Culture>

        </i18n>

        <To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">https://okc1swm0001:17778/SolarWinds/InformationService/v3/OrionBasic</To>

        <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://schemas.solarwinds.com/2007/08/informationservice/InformationService/Invoke</Action>

      </s:Header>

      <s:Body>

        <Invoke xmlns="http://schemas.solarwinds.com/2007/08/informationservice">

    <entity>Cirrus.Nodes</entity>

    <verb>AddNodeToNCM</verb>

          <parameters xmlns:a="http://schemas.datacontract.org/2004/07/System.Xml" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">

    <a:XmlElement>

    <coreNodeId xmlns="">20240</coreNodeId>

    </a:XmlElement>

          </parameters>

        </Invoke>

      </s:Body>

    </s:Envelope>

    2014-02-19 10:54:30,260 [6] ERROR SolarWinds.InformationService.Core.InformationService - Exception caught in method Invoke

    1. 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)

  • Strange. Could you tell me more about your NCM deployment? What version of NCM, how many servers, which components on each server, etc.

  • Oops - I just noticed two things: first, that I asked you to look in the SWISv3 log file when I should have specified the SWISv2 log file. The path should be C:\ProgramData\Solarwinds\InformationService\v2.0. Second, that you did find the error in the SWISv3 log file showing that you used this URL for your request: https://okc1swm0001:17778/SolarWinds/InformationService/v3/OrionBasic.

    NCM is still on SWISv2, so you should use https://okc1swm0001:17778/SolarWinds/InformationService/OrionBasic. For your request.

  • How did that get in there?! Doh!

    Change to correct endpoint and got the node to add to NCM.

    Now... how do I set the Global Connection Profile?

  • Proved the steps for creating Global connection profile in NCM.

    1. You can create global connection profile using the verb “AddConnectionProfile”. Once connection profile is created, update ConnectionProfile property in Nodes using the verb “UpdateSelectedNodeColumns”  (To map connection profile to Nodes) .
    2. You can also add credentials directly to a node by using the verb “UpdateSelectedNodeColumns by providing values for Username, Password, EnableLevel, EnablePassword,… properties of the Node.

    The credentials can be encrypted or plain. It would be better to encrypt the credentials. To encrypt, use the below mentioned steps  

    1. Use the verb ”EncryptData” against “Cirrus.Settings” entity to encrypt data. To use this connect to V2 certificate swis service.
    2. You can also decrypt the data using the verb “DecryptData”.
  • madhavan

    Do you have a code example? I can't seem to get this to work... I have existing Connection profile, which is index 1, and try to set it like this:

    System.Xml.XmlDocument xdoc = new System.Xml.XmlDocument();

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

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

    xel.InnerText = nodeID.ToString();

    elem[0] = xel;

    xel = xdoc.CreateElement("ConnectionProfile");

    xel.InnerText = ConnectionProfile.ToString();

    elem[1] = xel;

    System.Xml.XmlElement result = orion.Invoke("Cirrus.Nodes", "UpdateSelectedNodeColumns", elem);

    This doesn't seem to work?