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 #383

Open
noaboa97 opened this issue Feb 27, 2024 · 3 comments
Open

Set-ObjectProperty #383

noaboa97 opened this issue Feb 27, 2024 · 3 comments
Labels
alleged-bug Bugs raised by people helpfully using the Bug Report template!

Comments

@noaboa97
Copy link

noaboa97 commented Feb 27, 2024

Describe the bug

Hello lordmilko

I hope you are doing well.

Cannot update Schedules, Dependencies, and Maintenance Window to inherit or stop inheritance via set-objectproperty.
Setting Scanning Interval for example works.

We would like to unset inheritance and also set the dependecyvalue and dependencytype.

Here's the wiki article: https://github.com/lordmilko/PrtgAPI/wiki/Property-Manipulation
Setting a schedule also doesn't work.

It seems like PRTG is not accepting the input. It's not shown in the webinterface an also not with get-objectproperties.

We run PRTG Version: 23.4.88.1429

Steps to reproduce

$sensor = get-sensor -name XY

$ht = @{
    "scheduledependency" = 0
    "dependencyvalue" = "78632"
    "dependencytype" = 1  
}

$sensor | Set-ObjectProperty -RawParameters $ht -Force

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

PSVersion      : 5.1.17763.5328
PSEdition      : Desktop
OS             : Microsoft Windows Server 2019 Standard
PrtgAPIVersion : 0.9.19
Culture        : de-CH
CLRVersion     : .NET Framework 4.8 (528049)
PrtgVersion    : 23.4.88.1429
PrtgLanguage   : english.lng

Additional context

No response

@noaboa97 noaboa97 added the alleged-bug Bugs raised by people helpfully using the Bug Report template! label Feb 27, 2024
@LemurTech
Copy link

We are having a similar issue since upgrade to 24.1.90.1306 from our previous v23. This had been working flawlessly:

$device | Set-ObjectProperty -rawparameters @{
	scheduledependency=0
	maintenable_=1
	maintstart_=$startString
	maintend_=$endString
} -force -EA Stop

PS>TerminatingError(Set-ObjectProperty): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: PRTG was unable to complete the request. The server responded with the following error: The validation of the data you entered has failed. ."
Result : FAILED - PRTG was unable to complete the request. The server responded with the following error: The validation of the data you entered has failed. .

@lordmilko
Copy link
Owner

It's possible there's an additional parameter that needs to be specified when you execute this request. I recommend using Fiddler Classic to trace what the PRTG UI does, and then test adding in additional parameters that may be relevant to this section

@LemurTech
Copy link

It looks like the acceptable date format for maintstart_ and maintend_ has changed!

Before: "2024,03,11,22,00,00"
Now: "2024-03-11 22:00:00"

Back in business!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alleged-bug Bugs raised by people helpfully using the Bug Report template!
Projects
None yet
Development

No branches or pull requests

3 participants