I am trying to create a new powershell script monitor and I keep getting the following and am unable to save it:
Unexpected Website Error
Cannot convert object of type 'System.Int32' to type 'Orion_APM_Controls_ChangeTestNodeRow+Node'
Save error report locally Return to home
For more troubleshooting help, see the SolarWinds Knowledge Base, or contact support.
Attached is the Error Report. Here's the script:
#Declare NodeID from Orion Script Arguments
$nodeID = "${IP}";
#Make request to Service Monitor
$r = [System.Net.WebRequest]::Create("http://-- MASKED URL --/ServiceMonitor/Master/Monitor/$nodeID");
$resp = $r.GetResponse();
$reqstream = $resp.GetResponseStream();
$sr = new-object System.IO.StreamReader $reqstream;
#Format results as XML
[xml]$result = $sr.ReadToEnd();
#Check results
if ($result.MonitorResults.Monitor.Status -eq 'UP')
{
write-host "Message.Status:" $result.MonitorResults.Monitor.StatusMessage;
write-host "Statistic.Status: 1";
Remove-Variable -Name nodeID;
exit(0);
}
else
{
write-host "Message.Status:" $result.MonitorResults.Monitor.StatusMessage;
write-host "Statistic.Status: 0";
Remove-Variable -Name nodeID;
exit(1);
}
Any ideas what's going on?