Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adding new sensors not working after update to version 23.3.86.1520 #345

Closed
imaderaya opened this issue Jul 27, 2023 · 17 comments
Closed

Adding new sensors not working after update to version 23.3.86.1520 #345

imaderaya opened this issue Jul 27, 2023 · 17 comments
Labels
bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version

Comments

@imaderaya
Copy link

Describe the bug

Hello,

After updating PRTG to version 23.3.86.1520, Adding sensors is not working any more.
The error message : Could not authenticate to PRTG; the specified username and password were invalid

Steps to reproduce

Code Example:

Connect-PrtgServer -Server "https://prtgserver.com" (New-Credential "username" "passwd");
$device = Get-Device -Id 126556;
$device | New-SensorParameters -RawType ping | Add-Sensor

Result:

Add-Sensor : Could not authenticate to PRTG; the specified username and password were invalid.

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

PSVersion      : 5.1.20348.1850
PSEdition      : Desktop
OS             : Microsoft Windows Server 2022 Standard
PrtgAPIVersion : 0.9.18
Culture        : fr-CH
CLRVersion     : 528449
PrtgVersion    : 23.3.86.1520
PrtgLanguage   : english.lng

Additional context

There is no issue with:

  • Add-Device
  • Set-ObjectProperty
  • Set-ChannelProperty
@imaderaya imaderaya added the alleged-bug Bugs raised by people helpfully using the Bug Report template! label Jul 27, 2023
@lordmilko 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 Jul 28, 2023
@lordmilko
Copy link
Owner

Hi @imaderaya,

I have deployed a fix for this issue. Can you please follow the manual installation instructions and advise whether this issue is resolved in PrtgAPI 0.9.19-preview.2?

@imaderaya
Copy link
Author

Hi @lordmilko,

I confirm that the issue is resolved in PrtgAPI 0.9.19-preview.2.

Great job.

@TheUdK
Copy link

TheUdK commented Aug 29, 2023

Any chance of building a release and publishing to PSGallery as release or prerelease?

@schoenm1
Copy link

schoenm1 commented Sep 7, 2023

Hi @lordmilko,

I confirm that the issue is resolved in PrtgAPI 0.9.19-preview.2.

Great job.

Same here. After installing current Prelease, my Scripts are working again.

@MikeyMing
Copy link

I still get the issue with the latest version.

Add-Sensor : Could not authenticate to PRTG; the specified username and password were invalid.
At line:14 char:34

  • Get-Device -Id $ParentDeviceId | Add-Sensor $params
  •                              ~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Add-Sensor], HttpRequestException
    • FullyQualifiedErrorId : System.Net.Http.HttpRequestException,PrtgAPI.PowerShell.Cmdlets.AddSensor

get-command add-sensor

CommandType Name Version Source


Cmdlet Add-Sensor 0.9.18 PrtgAPI

@MikeyMing
Copy link

Get-PrtgClient -Diagnostic

PSVersion : 5.1.14393.5582
PSEdition : Desktop
OS : Microsoft Windows Server 2016 Standard
PrtgAPIVersion : 0.9.18
Culture : da-DK
CLRVersion : .NET Framework 4.8 (528049)
PrtgVersion : 23.3.86.1520
PrtgLanguage : english.lng

@xasz
Copy link

xasz commented Sep 14, 2023

@MikeyMing not sure if you are using the Preview.
I have not tested the preview - I need to, but had no time - So my prtg upgrade to the newest version will have to wait. But your version sys 0.9.18 and not 0.9.19-preview.2

@MikeyMing
Copy link

How do I get the preview? When I click on the link it downloads the latest zip directly.

Thanks

@lordmilko
Copy link
Owner

You need to follow the manual installation instructions to use the latest preview build, however I am actively in the process of trying to release PrtgAPI 0.9.19, I'm just trying to resolve some issues with my build system

@lordmilko
Copy link
Owner

Please be advised PrtgAPI 0.9.19 has now been released. Please do Update-Module PrtgAPI and then reopen your PowerShell session

@MikeyMing
Copy link

Thanks. Its working now. God bless PrtgAPI

@MikeSouthwell
Copy link

Hi LordMilko,

I have updated to 0.9.19, but I am still getting the same error.

Can you please take another look?

PSVersion : 5.1.17763.4974
PSEdition : Desktop
OS : Microsoft Windows Server 2019 Datacenter
PrtgAPIVersion : 0.9.19
Culture : en-AU
CLRVersion : .NET Framework 4.8 (528049)
PrtgVersion : 23.3.88.1421
PrtgLanguage : english.lng

Set-ObjectProperty : PRTG was unable to complete the request. The server responded with the following error: The validation of the data you entered has failed. Authorization: Required field, not defined. The object has not been changed.

@lordmilko
Copy link
Owner

Can you please provide a code sample which is generating this error?

@MikeSouthwell
Copy link

MikeSouthwell commented Nov 17, 2023

Please see relevant code snippet below that is causing that error:

Get-Sensor -Name "Template" -count 1 | Clone-Object -DestinationId $resellerID.Id -Name $backupSensorName -Resume

Get-Sensor -Name $backupSensorName | Set-ObjectProperty -RawProperty paessler-microsoft365-mailbox_section-mailbox_group-filter_subject_string_ -RawValue "$subjectString" -Force

@carsten0407
Copy link

Where can I download the PrtgAPI 0.9.19-preview.2? the manuial download lis broken

https://ci.appveyor.com/api/projects/lordmilko/prtgapi/artifacts/PrtgAPI.zip
{"message":"Artifact not found or access denied."}

@lordmilko
Copy link
Owner

PrtgAPI 0.9.19 has now been released

To update PrtgAPI, please run Update-Module PrtgAPI in PowerShell and then close and reopen the window

@carsten0407
Copy link

Yessss, it works, thx

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version
Projects
None yet
Development

No branches or pull requests

8 participants