After adding a new node to the Solarwinds via the SDK / API I run a discovery on the node but this fails.
I have looked in \OrionDiscoveryJob.log and all I can see is:
2020-04-27 15:27:10,929 [STP SmartThreadPool Thread #0] DEBUG ResultDumpLogger - Activities that ends up with error:
2020-04-27 15:27:10,945 [STP SmartThreadPool Thread #0] DEBUG ResultParser - Processing protocol 'WMI' (SolarWinds.Orion.Discovery.Contract.Protocols.DiscoveredWmiContext) on endpoint [IP: <IP> Hostname:<HOSTNAME.<DOMAIN> ].
2020-04-27 15:27:10,960 [STP SmartThreadPool Thread #0] DEBUG ResultParser - Discovered pollers [N.ResponseTime.ICMP.Native, N.Status.ICMP.Native, N.Details.WMI.Vista, N.Uptime.WMI.XP, N.Cpu.WMI.Windows, N.Memory.WMI.Windows], added pollers [N.ResponseTime.ICMP.Native on N:1, N.Status.ICMP.Native on N:1, N.Details.WMI.Vista on N:1, N.Uptime.WMI.XP on N:1, N.Cpu.WMI.Windows on N:1, N.Memory.WMI.Windows on N:1].
2020-04-27 15:27:10,960 [STP SmartThreadPool Thread #0] DEBUG ResultParser - Discovered pollers [V.Details.WMI.Windows, V.Statistics.WMI.Windows, V.Status.WMI.Windows], added pollers [V.Details.WMI.Windows on V:1, V.Statistics.WMI.Windows on V:1, V.Status.WMI.Windows on V:1].
2020-04-27 15:27:10,960 [STP SmartThreadPool Thread #0] DEBUG ResultParser - Processed protocol 'WMI' for endpoint [IP: <IP> Hostname:<HOSTNAME.<DOMAIN> ], skipping other protocols.
*** Assembly SolarWinds.NCM.Discovery.Plugin, Version=2019.4.0.3834, Culture=neutral, PublicKeyToken=null, .NET version v4.0.30319 ***
2020-04-27 15:27:10,976 [STP SmartThreadPool Thread #0] DEBUG HyperVDiscoveryPlugin - Number of Hyper-V nodes: 0
*** Assembly SolarWinds.PCU.DiscoveryPlugin, Version=2.0.0.3319, Culture=neutral, PublicKeyToken=null, .NET version v4.0.30319 ***
*** Assembly SolarWinds.Topology.DiscoveryPlugin, Version=3000.2.0.10599, Culture=neutral, PublicKeyToken=null, .NET version v4.0.30319 ***
2020-04-27 15:27:10,992 [STP SmartThreadPool Thread #0] DEBUG TopologyDiscoveryPlugin - Processing protocol 'WMI' (SolarWinds.Orion.Discovery.Contract.Protocols.DiscoveredWmiContext) on endpoint [IP: <IP> Hostname:<HOSTNAME.<DOMAIN> ].
2020-04-27 15:27:10,992 [STP SmartThreadPool Thread #0] DEBUG TopologyDiscoveryPlugin - Processing protocol 'ICMP' (SolarWinds.Orion.Discovery.Contract.Protocols.DiscoveredIcmpContext) on endpoint [IP: <IP> Hostname:<HOSTNAME.<DOMAIN> ].
2020-04-27 15:27:10,992 [STP SmartThreadPool Thread #0] DEBUG AssetInventoryDiscoveryPlugin - Getting profile results for AssetInventoryDiscoveryPlugin
2020-04-27 15:27:10,992 [STP SmartThreadPool Thread #0] DEBUG AssetInventoryDiscoveryPlugin - Processing endpoint <IP>.
2020-04-27 15:27:11,007 [STP SmartThreadPool Thread #0] DEBUG AssetInventoryDiscoveryPlugin - Endpoint <IP> has 1 features. Polling method: Wmi PollingDescription: WindowsServerWMI
2020-04-27 15:27:11,007 [STP SmartThreadPool Thread #0] DEBUG AssetInventoryDiscoveryPlugin - Feature 'Polling method: Wmi PollingDescription: WindowsServerWMI' selected for endpoint <IP>.
2020-04-27 15:27:11,163 [STP SmartThreadPool Thread #0] DEBUG JobMonitor - Stop tracking job d3f30ee1-831b-4c02-bb09-fcf4dadc059b
Here is a snippet of the code I am using - mostly unedited from the GitHub page for the SDK:
$EngineID = 1
$DeleteProfileAfterDiscoveryCompletes = "true"
$CorePluginConfigurationContext = ([xml]"
<CorePluginConfigurationContext xmlns='http://schemas.solarwinds.com/2012/Orion/Core' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
<BulkList>
<IpAddress>
<Address>$($IPAddress.IPV4Address.IPAddressToString)</Address>
</IpAddress>
</BulkList>
<Credentials>
<SharedCredentialInfo>
<CredentialID>$($credentialId.ID)</CredentialID>
<Order>1</Order>
</SharedCredentialInfo>
</Credentials>
<WmiRetriesCount>1</WmiRetriesCount>
<WmiRetryIntervalMiliseconds>1000</WmiRetryIntervalMiliseconds>
</CorePluginConfigurationContext>
").DocumentElement
$StartDiscoveryContext = ([xml]"
<StartDiscoveryContext xmlns='http://schemas.solarwinds.com/2012/Orion/Core' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
<Name>Script Discovery $([DateTime]::Now)</Name>
<EngineId>$EngineID</EngineId>
<SnmpRetries>1</SnmpRetries>
<RepeatIntervalMiliseconds>1500</RepeatIntervalMiliseconds>
<SnmpPort>161</SnmpPort>
<HopCount>0</HopCount>
<PreferredSnmpVersion>SNMP2c</PreferredSnmpVersion>
<DisableIcmp>false</DisableIcmp>
<AllowDuplicateNodes>false</AllowDuplicateNodes>
<IsAutoImport>true</IsAutoImport>
<IsHidden>$DeleteProfileAfterDiscoveryCompletes</IsHidden>
<PluginConfigurations>
<PluginConfiguration>
<PluginConfigurationItem>$($CorePluginConfiguration.InnerXml)</PluginConfigurationItem>
</PluginConfiguration>
</PluginConfigurations>
</StartDiscoveryContext>
").DocumentElement
$DiscoveryProfileID = (Invoke-SwisVerb $swis Orion.Discovery StartDiscovery @($StartDiscoveryContext)).InnerText
Write-Verbose "$(Get-Date -Format 'dd/MM/yyyy HH:mm:ss'):`t DISCOVERY profile #$DiscoveryProfileID running..."
# WAIT until the discovery completes
do {
Write-Host -NoNewline "."
Start-Sleep -Seconds 1
$Status = Get-SwisData $swis "SELECT Status FROM Orion.DiscoveryProfiles WHERE ProfileID = @profileId" @{profileId = $DiscoveryProfileID }
} while ($Status -eq 1)
$Result = Get-SwisData $swis "SELECT Result, ResultDescription, ErrorMessage, BatchID FROM Orion.DiscoveryLogs WHERE ProfileID = @profileId" @{profileId = $DiscoveryProfileID }
# PRINT the outcome
switch ($Result.Result) {
1 { "InProgress" }
2 { "Finished" }
3 { "Error" }
4 { "NotScheduled" }
5 { "Scheduled" }
6 { "NotCompleted" }
7 { "Canceling" }
8 { "ReadyForImport" }
}
$Result.ResultDescription
$Result.ErrorMessage
Any ideas? The code hasn't changed since it stopped working. It seems to have stopped after updating to 2019.4.1, which seems to be a common thing I have found - random things not working via the API.
Anything else I should be looking for in the log file? I have made sure our instance of Solarwinds is up-to-date