lordmilko / PrtgAPI

C#/PowerShell interface for PRTG Network Monitor
MIT License
301 stars 37 forks source link

Call to New-Server parameter fails... #282

Closed JRAndreassen closed 2 years ago

JRAndreassen commented 2 years ago

Describe the bug

Looks like the call to "http://127.0.0.1/api/getaddsensorprogress.htm" is missing UID/PassHash parameters...

It was working great, but I think something changed with the new version of PRTG

Steps to reproduce

$PRTGDevice | New-SensorParameters -RawType "exexml" -Timeout 120 -verbose -erroraction 'silentlycontinue'

New-SensorParameters: Synchronously executing request http://127.0.0.1/api/sensortypes.json?id=147192&username=prtgadmin&passhash=138742121
New-SensorParameters: Synchronously executing request http://127.0.0.1/controls/addsensor2.htm?id=147192&sensortype=exexml&username=prtgadmin&passhash=138742121
New-SensorParameters: Synchronously executing request http://127.0.0.1/api/getaddsensorprogress.htm?id=147192&tmpid=719
New-SensorParameters : Could not authenticate to PRTG; the specified username and password were invalid.
At line:1 char:15

What is the output of 'Get-PrtgClient -Diagnostic'?

PSVersion      : 5.1.19041.1320
PSEdition      : Desktop
OS             : Microsoft Windows 10 Pro
PrtgAPIVersion : 0.9.14
Culture        : en-US
CLRVersion     : 528372
PrtgVersion    : 22.1.75.1594
PrtgLanguage   : english.lng

Additional context

No response

lordmilko commented 2 years ago

Duplicate of #268

Please update to PrtgAPI 0.9.17

(getaddsensorprogress.htm uses cookie authentication which is what broke in the PRTG update)

JRAndreassen commented 2 years ago

Excellent... I guess I should have checked the release first, sorry for the noise... Thanks JR