Closed clemensmool closed 5 years ago
Hi @clemensmool,
Can you please advise
gmo prtgapi
)$PSVersionTable
) and whether it's Windows PowerShell or PowerShell CoreIn addition, if you do
Get-Sensor -Verbose
Copy and paste the URL that is emitted and then do
Invoke-WebRequest <url>
does the Invoke-WebRequest
command emit the same error as Get-Sensor
does?
Thanks for your quick response! When collecting the requested information I noticed that the internet explorer on the prtg server was configured to use a proxy server. When removing this setting everything works fine. Strange enough does connecting to the server works fine when a proxy server is configured but running PrtgAPI commands failes.
Thanks @clemensmool,
Good to hear the issue is resolved. Are you able to advise though if you re-enable the proxy on the PRTG Server, confirm commands like Get-Sensor
fail again, then do the Invoke-WebRequest
test specified above whether you still get the issue or it works fine? This will confirm whether the issue was solely to do with PRTG or whether it was a combination of something the PRTG server and PrtgAPI was doing
I was forgotton to mention what a great product PrtgAPI is. It makes managing a PRTG installation a lot easier. For example it is really easy to run remote probes in a self created failover cluster.
I just went home, I'll try again tomorrow. Thanks for your quick response.
I re-enabled the proxy setting in internet explorer again and when I do a get-device I got the same error message as before: PS C:\Windows\system32> get-device -Status Paused WARNING: 'Get-Device' timed out: The remote server returned an error: (503) Server Unavailable. Retries remaining: 1 get-device : The remote server returned an error: (503) Server Unavailable. At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Get-Device], WebException
+ FullyQualifiedErrorId : System.Net.WebException,PrtgAPI.PowerShell.Cmdlets.GetDevice
I did the test as requested, see the output below:
PS C:\Windows\system32> Get-Sensor -Verbose VERBOSE: Get-Sensor: Synchronously executing request https://wingenprtg01.ccsilver.local/api/table.xml?content=sensors &count=0&username=prtgadmin&passhash=321894000 WARNING: 'Get-Sensor' timed out: The remote server returned an error: (503) Server Unavailable. Retries remaining: 1 Get-Sensor : The remote server returned an error: (503) Server Unavailable. At line:1 char:1
+ CategoryInfo : NotSpecified: (:) [Get-Sensor], WebException
+ FullyQualifiedErrorId : System.Net.WebException,PrtgAPI.PowerShell.Cmdlets.GetSensor
PS C:\Windows\system32> Invoke-WebRequest "https://wingenprtg01.ccsilver.local/api/table.xml?content=sensors &count=0&username=prtgadmin&passhash=321894000" Invoke-WebRequest : The remote server returned an error: (503) Server Unavailable. At line:1 char:1
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebE
xception
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Thanks @clemensmool,
This proves the issue is not specific to PrtgAPI
As you've successfully managed to identify the cause of this issue I will close this issue
Regards, lordmilko
Hello,
Since a few days we are getting errors from PrtgAPI commands. Connecting to the server works fine and also the command Get-PrtgClient works fine. But commands like get-sensor and get-device resolves in errors (see bellow). Yesterday the command get-prtgstatus works fine but this gives an error since today.
Can you help us to solve this problem?