PrtgAPI 0.9.10
New Features
-
Implemented PRTG Tree Object Model. Provides an immutable API for constructing and analyzing PRTG Trees. For more information, please see the wiki.
Note: this feature is still under development and is subject to change
var tree = client.GetTree(); var oldNode = tree["Local Probe"]["Servers"]["Ping"]; var newTree = tree.Replace(oldNode, newNode); comparison = tree.CompareTo(newTree); comparison.PrettyPrint(writer);
New Cmdlets
-
Get-PrtgTree
: retrieves a tree of PRTG Objects -
Show-PrtgTree
: pretty prints the hierarchy of a PRTG Tree -
New-SensorNode
,New-DeviceNode
,New-GroupNode
,New-ProbeNode
,New-TriggerNode
,New-PropertyNode
: wraps an object as aPrtgNode
for use in a PRTG Tree# Construct a tree containing the device with 2001 containing the sensors with IDs 2002 and 2003 $node = DeviceNode -Id 2001 { SensorNode -Id 2002,2003 }
New Methods
PrtgClient.GetTree
: retrieves a PRTG TreePrtgClient.GetTreeLazy
: lazily retrieves a PRTG Tree. Descendant nodes are only retrieved when they are accessed
Improvements
General
- Implemented support for specifying decimal values with
SetObjectProperty
/SetChannelProperty
using the culture of the PRTG Core Server that does not match the culture of the client. If a value is not equal to that same value deserialized and then serialized again (i.e."0,1" != double.Parse("0,1").ToString()
) the original value will be used instead. When using PowerShell, the stringified value must be passed to the-Value
parameter. Values passed to dynamic parameters (such as-UpperErrorLimit
) will automatically be casted to a decimal type
PowerShell
- Implemented new
-ObjectId
parameter onGet-NotificationTrigger
. Allows specifying the ID of the object to retrieve triggers from in lieu of piping in the parent object - Implemented
-Resume
parameter onClone-Object
. Allows resuming objects as they are created. Note: in terms of performance it is almost always faster to pipe newly cloned objects into theResume-Object
cmdlet at the end of the pipeline as opposed to using this parameter.Resume-Object
allows all objects to be unpaused at once, rather than unpausing each object one at a time - Implemented new
-Diagnostic
parameter onGet-PrtgClient
. Prints diagnostic information for use when raising a GitHub issue
Bugfixes
General
- Fixed PrtgAPI crashing when sensor query parameters provided to PRTG are illegally unencoded in the PRTG Server's response (#118)
FixHtmlParser
failing to detect HTML tags properly when their internal values contain newline characters (#119)
PowerShell
- Fixed an issue wherein
Get-SensorHistory
would crash when attempting to deserialize an EU decimal value in an invariant-style culture (#111) - Fixed
Update-GoPrtgCredential
incorrectly setting your passhash as your password instead of your passhash - Fixed
Set-ObjectProperty
,Set-ChannelProperty
andSet-TriggerProperty
-WhatIf
/ progress messages not displaying array values properly - Fixed common PowerShell parameters such as
-Verbose
not being passed to internal cmdlets invoked insideNew-Sensor
- Fixed duplicate
-Destination
parameter onAdd-Device
andAdd-Group
- Fixed Duplicate
-Parameters
parameter onAdd-Sensor
Known Issues
- The fix for
Get-SensorHistory
improperly dealing with EU decimal values has inadvertently caused issues when parsing numbers greater than 1,000 (values become decimals when they shouldn't be) and additionally causing crashes when dealing with values greater than 1,000,000. This can be worked around for now by utilizing the-Raw
parameter to skip trying to make sense of the channel's display value