New Features
- It is now possible to theoretically create any type of sensor supported by PRTG via dynamic parameters using PrtgAPI. Sensor types that require additional information be provided prior to retrieving their parameters can now specify a
SensorQueryTarget
value or set ofSensorQueryTargetParameters
. For more information, please see the wiki (#69)
New Cmdlets
New-Trigger
: create a new notification trigger via PowerShell style, via dynamic cmdlet parameters (rather than constructing a parameter "object" C# style). Implemented under existingAdd-Trigger
cmdlet, allowing cmdlet names to be used interchangablyGet-Probe | New-Trigger -Type State -OnNotificationAction *ticket* -Latency 40
Set-TriggerProperty
: modify properties of Notification Trigger objects. Functions identically toSet-ObjectProperty
andSet-ChannelProperty
. Allows either a single-Property
and-Value
to be specified, or allows multiple properties to be modified at once via dynamic cmdlet parameters. Replaces existingEdit-TriggerProperty
cmdlet
New Methods
PrtgClient.SetTriggerProperty
: modify properties of Notification Trigger objects. Functions identically toSetObjectProperty
andSetChannelProperty
Improvements
General
SetObjectProperty
/Set-ObjectProperty
now considers a standalone\r
to be a valid newline character when setting a label as part of anObjectProperty.Location
- Implemented support for overriding the default name used for typed properties on
NewObjectParameters
. Name overrides can now be manipulated via newAddNameOverride
,GetNameOverrides
,ContainsNameOverride
andRemoveNameOverride
methodsDynamicSensorParameters
will automatically apply any required name overrides based on the dynamic parameter values it retrieves from PRTG
C#
- Implemented new
Value
property onChannelHistoryRecord
. Displays the numeric raw value of the channel, expressed in the lowest possible unit. PreviousValue
property has been renamed toDisplayValue
(#71) - Implemented new
Threshold
property onNotificationTrigger
. Displays the numeric threshold of the trigger, if applicable. PreviousThreshold
property has been renamed toDisplayThreshold
NotificationTrigger
propertiesState
,UnitSize
,UnitTime
andPeriod
are now public- Implemented
ObjectId
property onISubObject
interface. Identifies the object the subobject is a child of - Implemented
ParentId
property onIPrtgObject
interface and movedParentId
property fromSensorOrDeviceOrGroupOrProbe
toPrtgObject
PowerShell
- Implemented support for filtering by all
NotificationTrigger
properties onGet-NotificationTrigger
- Implemented support for specifying an
-Id
toGet-SensorType
rather than piping in aDevice
Breaking Changes
General
- Renamed
TriggerSensorState.PartialDown
toDownPartial
to reflect new name within PRTG and maintain consistency with valueStatus.DownPartial
C#
- Renamed
SensorHistoryData
toSensorHistoryRecord
- Renamed
ChannelHistoryRecord.Value
toDisplayValue
- Renamed
NotificationTrigger.Threshold
toDisplayThreshold
- Changed
VolumeTriggerParameters.UnitSize
fromDataVolumeUnit
toDataUnit
. Attempting to assign aDataUnit
that does not exist inDataVolumeUnit
will trigger anInvalidOperationException
- Removed all setters on interfaces derived from
IObject
- Renamed base class
SensorOrDeviceOrGroupOrProbeOrTicketOrTicketDataOrHistory
toSensorOrDeviceOrGroupOrProbeOrTicketOrTicketData
GetDynamicSensorParameters
/GetSensorTargets
, etc now include a newqueryParameters
parameter. Any method invocations specifying theCancellationToken
that do not wish to modify the query target parameters should ensure the token is specified as a named parameter, e.g.client.GetDynamicSensorParameters(1001, "exexml", token: cts.Token)
PowerShell
- Replaced
Edit-TriggerProperty
cmdlet withSet-TriggerProperty
cmdlet.Set-TriggerProperty
is fully compatible withEdit-TriggerProperty
syntax; simply rename fromEdit
toSet
Bugfixes
General
- Fixed PrtgAPI not throwing an
InvalidOperationException
upon trying to create a new object containing a mandatory array consisting solely of empty values - Fixed
StringEnum
values incorrectly considering "split" values (such asSensor (ping)
) as being equal based solely on their enum value.- Two split
StringEnum
values are now only considered equal if both theirValue
andStringValue
properties are the same (such thatSensor (ping) != Sensor (wmiservice)
) - Otherwise any other set of
StringEnum
values are considered equal either theirValue
orStringValue
is the same (such thatSensor (ping) == Sensor || Sensor (ping) == ping
)
- Two split
- Fixed
SetChannelProperty
/Set-ChannelProperty
not serializingValueLookup
property values properly (#76) - Fixed
DynamicSensorParameters
failing to parse PRTG response properly when non-hidden input field is added before hidden input field of a different type (such as in the case of WMI Share sensor parameters)
PowerShell
- Resolved an issue wherein
New-Sensor
would throw aNotImplementedException
when piped from an empty list of devices - Fixed PrtgAPI throwing a
NullReferenceException
when trying to view progress in PowerShell Core - Fixed
Set-ChannelProperty
not throwing when no parameters are specified - Fixed
Get-SensorHistory
failing to load custom formats when your username contains a space - Fixed
Get-SensorHistory
showing an empty pair of brackets on a channel column when a channel unit is an empty string
Project
Quality
- All exception messages should now properly end in a period or question mark
Cross Platform
- PrtgAPI now uses
Environment.NewLine
everywhere it needs to refer to a newline - Replaced all
TEMP
environment variable references withPath.GetTempPath()