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.

Error when editing node after adding via SDK/API

After adding a node to Solarwinds via SDK or API (I'm using Powershell) I cannot edit the node settings. I get the following error:

2018-05-11 09_07_03-Orion Website Error.png

I have tried:

Rebooting the Solarwinds box

Adding the node with the absolute bare minimum properties required to create a new node

Rebooting the server that's being monitored

One of the things I read to try was to add a custom property name and then remove it.

The command I am using looks like this:

$newNodeProps = @{

  IPAddress = $ipaddress

  EngineID = 1

  ObjectSubType = "WMI"

  DNS = ""

  SysName = ""

}

#region CREATING the node

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

If you require more information please let me know.

  • Hi

    Do you provide any type of credentials? I see that you use WMI as polling method, but I can't see any credential assigned.

    Raul Gonzalez

    Prosperon - UK SolarWinds Partners

    Installation | Consultancy | Training | Licenses

    facebook_icon.jpglinkedin.pngblogger.pngtwitter-icon.jpg

  • $credentialName = '<account>'
    $credentialId = Get-SwisData $swis "SELECT ID FROM Orion.Credential WHERE CredentialOwner='APM' AND Name=@credential" @{credential = $credentialName}

    if (!$credentialId) {
    Write-Host "Can't find credential with name '$credentialName'."
    exit 1
    }
    #endregion

    #region ADD NodeSettings
    $nodeSettings = @{
    NodeID       = $NewNodeProps["NodeID"]
    SettingName  = "WMICredential"
    SettingValue = ($credentialId.ToString())
    }

    $newNodeSettings = New-SwisObject $swis -EntityType "Orion.NodeSettings" -Properties $nodeSettings

    I run this set of commands AFTER I create the node. Should I be putting the credential somewhere in the new node properties?

    So after setting the correct credential (after trying maybe 4-5) I was finally able to land on the edit node page. The credential that I did originally set must have been corrupt or not able to look up

  • That's right, I would add it to the first script.

    Bear in mind that you can also assign existing credentials in SolarWinds (SettingValue = CredentialID from Orion.Credentials).

    Raul Gonzalez

    Prosperon - UK SolarWinds Partners

    Installation | Consultancy | Training | Licenses

    facebook_icon.jpglinkedin.pngblogger.pngtwitter-icon.jpg