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

Set-ObjectProperty Device #275

Closed
2 tasks done
ArneBrucker opened this issue Mar 3, 2022 · 16 comments
Closed
2 tasks done

Set-ObjectProperty Device #275

ArneBrucker opened this issue Mar 3, 2022 · 16 comments
Labels
bug Issues that have been confirmed to be bugs in PrtgAPI and will be fixed in a future version

Comments

@ArneBrucker
Copy link

What's going on?

Get-Device -Id 4294 | Set-ObjectProperty -Location "Koenneritzstrasse 47, 04229 Leipzig"

Set-ObjectProperty : PRTG was unable to complete the request. The server responded with the following error: Die Validierung Ihrer Eingaben war nicht erfolgreich: Die Werte in 'Ortsangabe (für Geo Maps)' haben entweder ein ungültiges Format oder sind außerhalb des zulässigen Bereichs. . Das Objekt wurde nicht geändert.

Something went wrong - I do not understand why?

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!
@ArneBrucker ArneBrucker added the question Questions raised by people who don't know how to program or read the wiki :P label Mar 3, 2022
@lordmilko
Copy link
Owner

Hi @ArneBrucker,

This location worked for me on my dev PRTG server; can you please provide the output of Get-PrtgClient -Diagnostic?

@ArneBrucker
Copy link
Author

Hello @lordmilko

thanks for the fast replay:

PS C:\Windows\system32> Get-PrtgClient -Diagnostic

PSVersion : 5.1.17763.2268
PSEdition : Desktop
OS : Microsoft Windows Server 2019 Standard
PrtgAPIVersion : 0.9.16
Culture : de-DE
CLRVersion : .NET Framework 4.8 (528049)
PrtgVersion : 22.1.74.1869
PrtgLanguage : german.lng

@lordmilko
Copy link
Owner

Are you able to advise if setting other addresses work, or if it's just that 1 address that doesn't work?

If other addresses don't work, have you previously successfully set an address using PrtgAPI? When was that?

Can you set the address that isn't working using the PRTG UI?

@ArneBrucker
Copy link
Author

Hi @lordmilko

I tried to put in several adresses no one works right now - this is the first time I will use Set-ObjectProperty to change Device settings - so if the cmdlt ever worked properly I do not know.

@lordmilko
Copy link
Owner

If you try and do any of these addresses that don't work using the PRTG UI are you able to advise whether or not it works?

@ArneBrucker
Copy link
Author

Tried 5 - get 5 times a positiv result - so in the PRTG UI it works great

@lordmilko
Copy link
Owner

lordmilko commented Mar 3, 2022

In the PRTG UI can you please go to Setup -> System Information -> User Interface and under the Geo Maps section can you advise which Service Provider is selected?

@lordmilko
Copy link
Owner

lordmilko commented Mar 3, 2022

Hi @ArneBrucker,

I figured out the issue. The issue is that in the de-DE culture, decimal places are represented using commas instead of periods. As such, when PrtgAPI formats the latitude and longitude into an API request it generates the following

/editsettings?id=2055&location_=K%C3%83%C2%83%C3%82%C2%B6nneritzstra%C3%83%C2%83%C3%85%C2%B8e+47%2C+042
29+Leipzig%2C+Deutschland&lonlat_=12%2C34445%2C51%2C32475&locationgroup=0

If the PRTG server is expecting the lonlat_ property to use dots for decimal places however (i.e. lonlat_=12.34445%2C51.32475) then this will fail.

One question mark remains here however: can you please open a PowerShell on your PRTG Server and go Get-Culture and advise what the result is?

@ArneBrucker
Copy link
Author

PS C:\Windows\system32> Get-Culture

LCID Name DisplayName


1031 de-DE Deutsch (Deutschland)

@ArneBrucker
Copy link
Author

Hello @lordmilko ,

after some fails I tried to set up the Server with the expected "Culture" - now it is 1033 en-US Englisch (USA) but the Set-ObjectProperty - Location still does not work with adress details like "Dachsstrasse 1, 4329 Leipzig" - The parameter could not resolve - any suggestion?

@lordmilko
Copy link
Owner

Hi @ArneBrucker,

Apologies for the delay in getting back to you on this. Are you able to confirm whether you are running PrtgAPI on the server with the en-US culture, or are you still using it on your workstation which is de-DE?

@ArneBrucker
Copy link
Author

Hello @lordmilko

I changed the Server to US -and work on the Server itself. But both - de-DE and US does not work.

@lordmilko
Copy link
Owner

Please be advised I have successfully managed to reproduce this issue and am currently investigating

@lordmilko
Copy link
Owner

Hi @ArneBrucker,

Please be advised I have pushed a new pre-release version of PrtgAPI that should include a fix for this issue

Can you please try running PrtgAPI 0.9.18-preview.3 via the manual installation instructions and advise whether this issue is resolved?

If the issue is still occurring, please confirm that you are in fact using the pre-release version, which will be shown by doing Get-PrtgClient -Diagnostic

@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 May 8, 2022
@ArneBrucker
Copy link
Author

Hello @lordmilko,

I do not find the Version you mentioned (Prtg.API 0.9.18-preview.3) could you please tell me where to download this version?

Thank you
Arne

@lordmilko
Copy link
Owner

Please click the link included in the Manual installation instructions

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