Closed shane5557 closed 1 year ago
Hi @shane5557,
The "dependency" of an object B is the object A, that when down, causes the object B to go down. i.e. Devices typically depend on Ping sensors
In order to disable trigger inheritance you need to set the -InheritTriggers
property to $false
Get-Device -Id 1001 | Set-ObjectProperty -InheritTriggers $false
Thank you I've spent days trying to get this to work! Calling it that way using $false solved the issue for me.
The second part I'm still struggling with the Dependency of a sensor (DependentObjectID) I can't seem to find a way to make it change to another value without manually selecting it in the GUI.
$dependency = @{
scheduledependency = 0
dependencytype_ = 1 ***This changes the Dependency Type to "Select a Sensor" as expected
---->>>> DependentObjectId = "70253" <<<<<<-------- Won't pass this value...
DependencyDelay = 0
}
$child = Get-Sensor -ID xxxx
$child | Set-ObjectProperty -RawParameters $dependency -Force -Verbose
############# OUTPUT ###################### VERBOSE: Performing the operation "Set-ObjectProperty scheduledependency = '0', dependencytype = '1', DependencyDelay = '0', DependentObjectId = '70253'" on target "'Access Point / xxx-xxx-xxx (xxxxxxxxxxxxx)' (ID: 86622)". VERBOSE: Set-ObjectProperty: Synchronously executing request https://xxxxxxxx.com/editsettings?id=86622&scheduledependency=0&dependencytype=1&dependencydelay=0&dependentobjectid=70253
As per #18 you need to set the dependency_
field to the ID of the object to be dependent on, as seen in the following example
# Create a device named "dc-1" and set its dependency to the object with ID 40
Get-Probe | Add-Device dc-1 | Set-ObjectProperty -RawParameters @{
scheduledependency=0
dependencytype_=1
dependency_=40
} -Force
The names of these parameters can be derived either by tracing with Fiddler or by inspecting the HTML on the PRTG webpage (use the Chrome Inspector to select the textbox on the page to navigate straight to the surrounding source code)
Thanks again. This is working as you described and I learned something along the way. Hope this helps someone else moving forward and truly appreciate your response and time.
Describe the bug
We are using the API to try and turn off Inherited triggers. I wanted to assign only one notification trigger and to ingore the parents to prevent two templates from happening. Each time I run the command below it says it worked but no actual change is made to the device in the gui or in the API. (inherittriggers=0)
$child_id = 12345
https://xxxxxx.xxx.com/editsettings?id=86622&scheduledependency=0&dependencytype_=1&dependencydelay=0&Dependentobjectid=70253&
######################################################## The second part of this is similar as one of the sensor ObejectProperty wont change. In this case im trying to toggle the inherrittriggers so it doesnt choose to use the Parent Notification Template & the new template i just created. I only want the sensor to use the newly defined template specific to it.
$dependency = @{ inherittriggers = 0 }
get-sensor $s
Invoke-WebRequest -uri "[https://xxxxxxxxxx.com/editsettings?id=83052&inherittriggers=0&username=xx$pas] RawContent : HTTP/1.1 200 OK Connection: close
Steps to reproduce
What is the output of 'Get-PrtgClient -Diagnostic'?
Additional context
No response