You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an automation script.
Before PRTG Update to 21.4.73.1656+, everything was working.
But no, the script can not add a device anymore.
In our script: $Device = $DeviceGroup | Add-Device $currentRow.Name $currentRow.Host
[DBG]: PS C:\Visual_Studio\net-team\monitoring\macd> $DeviceGroup | Add-Device $currentRow.Name $currentRow.Host
'Add-Device' failed to resolve device: object is still being created. Retries remaining: 4
'Add-Device' failed to resolve device: object is still being created. Retries remaining: 3
'Add-Device' failed to resolve device: object is still being created. Retries remaining: 2
'Add-Device' failed to resolve device: object is still being created. Retries remaining: 1
Add-Device : Could not resolve object: PRTG is taking too long to create the object. Confirm the object has been created in the Web UI and then attempt resolution again manually.
At line:1 char:16
+ $DeviceGroup | Add-Device $currentRow.Name $currentRow.Host
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-Device], ObjectResolutionException
+ FullyQualifiedErrorId : PrtgAPI.ObjectResolutionException,PrtgAPI.PowerShell.Cmdlets.AddDevice
=> Device is added in PRTG / only response is missing
Same issue when I change command to Add-Device -Name $currentRow.Name -Host $currentRow.Host -Destination $DeviceGroup
But when I try to add a device manually, it is working.
Add-Device -Name bla -Host 1.2.3.4 -Destination $DeviceGroup
Name Id Status Host Sensors Group Probe
---- -- ------ ---- ------- ----- -----
bla 52373 Up 1.2.3.4 0 Test-Group LocalProbe
Even if I entert the string from param manually, it is working
[DBG]: PS C:\Visual_Studio\net-team\monitoring\macd> $currentRow.Name
su-sw-3og03
[DBG]: PS C:\Visual_Studio\net-team\monitoring\macd> $currentRow.Host
10.10.10.106
[DBG]: PS C:\Visual_Studio\net-team\monitoring\macd> $DeviceGroup | Add-Device "su-sw-3og03" "10.10.10.106"
Name Id Status Host Sensors Group Probe
---- -- ------ ---- ------- ----- -----
su-sw-3og03 52374 Up 10.10.10.106 0 Test-Group LocalProbe
Steps to reproduce
One different I found with '-verbose' command. This could explain the issue.
Working:
Add-Device-Name "su-sw-3og03"-Host "10.10.10.106"-Destination $DeviceGroup-verbose
https://prtg.domain.com/adddevice2.htm?name_=su-sw-3og03&host_=10.10.10.106&ipversion_=0&discoverytype_=0&discoveryschedule_=0&id=16768&username=myuser&passhash=******=> no "+" before "su-sw-3og3Not working:And here is the point I found.Write-Host "MyString ='$($currentRow.Name)'"MyString = ' su-sw-3og03' => Leading Space in String before 'su-sw-3og3'If I try this with fix value (no param) -> same issue.Add-Device -Name " su-sw-3og3" -Host "10.10.10.106" -Destination $DeviceGroup -verbosehttps://prtg.domain.com/adddevice2.htm?name_=+su-sw-3og3&host_=10.10.10.106&ipversion_=0&discoverytype_=0&discoveryschedule_=0&id=16768&username=myuser&passhash=******=> "+" before "su-sw-3og3
Could this be a general issue. Is it possible you can add this to the PRTGApi Module to catch the error or not to send the "+" sign?
It took me a long time to find the issue (hope this there is not a 2nd issue". Other PRTGApi User should not be affected with same issue (I think this is (again) a PRTG Issue and not PRTGAPI, but you can handle this error where Paessler will not).
What is the output of 'Get-PrtgClient -Diagnostic'?
Hi @lordmilko
Yes, I found this issue because there was a leading space in my excel/csv. " su-sw-3og3" and not "su-sw-3og3"
But even if I try to use PRTGApi wich 'Add-Device -Name ' and a leading space in <myname<, I won't get a reply from PRTG Server that the object was created.
lordmilko
added
bug
Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version
and removed
alleged-bug
Bugs raised by people helpfully using the Bug Report template!
labels
Mar 5, 2022
Describe the bug
We have an automation script.
Before PRTG Update to 21.4.73.1656+, everything was working.
But no, the script can not add a device anymore.
In our script:
$Device = $DeviceGroup | Add-Device $currentRow.Name $currentRow.Host
=> Device is added in PRTG / only response is missing
Same issue when I change command to
Add-Device -Name $currentRow.Name -Host $currentRow.Host -Destination $DeviceGroup
But when I try to add a device manually, it is working.
Even if I entert the string from param manually, it is working
Steps to reproduce
What is the output of 'Get-PrtgClient -Diagnostic'?
Additional context
No response
The text was updated successfully, but these errors were encountered: