Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

get-device -id 12312 | get-sensor -tag pingsensor | Get-NotificationTrig ... #308

Closed
2 tasks done
carsten0407 opened this issue Oct 14, 2022 · 3 comments
Closed
2 tasks done
Labels
bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version

Comments

@carsten0407
Copy link

carsten0407 commented Oct 14, 2022

What's going on?

Hi Lord,

since yesterday we can no longer access the trigger notification via API with a Read/Write user (no admin-user)
We updated yesterday from version 22.1.75.1588+ to version 22.3.79.2108+.

This query still works on our other two core servers (version 22.1.75.1588+)

get-device -id 12312 | get-sensor -tag pingsensor | Get NotificationTrig...

Get-NotificationTrigger : Response status code does not indicate success: 403 (Forbidden).
At line:1 char:61

  • get-device -id $tempfound.id | get-sensor -tag pingsensor | Get NotificationTrig...
  •   + CategoryInfo : NotSpecified: (:) [Get-NotificationTrigger], HttpRequestException
      + FullyQualifiedErrorId : System.Net.Http.HttpRequestException,PrtgAPI.PowerShell.Cmdlets.GetNotificationTrigger
    
    

thx

Carsten

Due Dilligance

  • It wasn't covered by the wiki, I swear!
  • I have tried doing some basic research on this issue but haven't been able to come up with anything. Please help!
@carsten0407 carsten0407 added the question Questions raised by people who don't know how to program or read the wiki :P label Oct 14, 2022
@lordmilko
Copy link
Owner

PrtgAPI needs to execute an API request against /controls/objectdata.htm?id=810 (which retrieves the web server options) to determine whether your PRTG server is using English or not; if not, it uses a slower code path (that executes many more API calls) in order to be compatible with non-English versions of PRTG

If this was working previously, it would seem that PRTG now restricts access to the web server options to admin users only. I can confirm that retrieving notification triggers still works when requesting as an admin user.

I can potentially look into modifying PrtgAPI to assume the server is not using English (and therefore default to taking the slower code path) when not using an admin user, however in the meantime to work around this you will need to use an admin user

@lordmilko lordmilko added bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version and removed question Questions raised by people who don't know how to program or read the wiki :P labels Oct 15, 2022
@lordmilko
Copy link
Owner

Hi @carsten0407,

I have pushed a commit that I believe should resolve this issue. Can you please follow the manual installation instructions and advise whether you're able to retrieve notification triggers as a non-admin user using PrtgAPI 0.9.18-preview.7?

@carsten0407
Copy link
Author

carsten0407 commented Oct 15, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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

2 participants