All features of PrtgAPI are now compatible with non-English versions of PRTG!
As of writing, the only limitations on non-English versions of PRTG are:
GetObjectProperty
will not know to throw if the specified property doesn't exist- Workaround: check whether the result says
(Property not found)
in your native language.
- Workaround: check whether the result says
- The
NotificationTypes
property on sensors, devices, groups and probes does not work- Workaround: use the Notification Triggers API to enumerate triggers properly
Improvements
General
- Implemented support for deserializing splittable strings delineated with commas instead of spaces as a result of a custom API call made outside of PrtgAPI (#85)
- Moved
Name
,Tags
andPriority
properties fromSensorSettings
toTableSettings
base class, giving these properties toDeviceSettings
,GroupSettings
andProbeSettings
as well - Changed
NotificationTrigger.Threshold
fromint?
todouble?
- Improved performance of retrieving Notification Triggers containing
Channel
properties. For sensors containing multiple channel-enabled triggers, significantly less API requests are now performed - Improved HTML parsing regex performance
C#
- Implemented support for specifying values with implicit
string
conversions toSetObjectProperty
//Serialization engine will automatically convert "test.ps1" to an ExeFileTarget client.SetObjectProperty(ObjectProperty.ExeFile, "test.ps1");
PowerShell
- PrtgAPI is now significantly more PowerShell friendly; most exceptions are now emitted as
ErrorRecord
objects, allowing failures to occur without bringing down an entire command. Especially useful when banging out a one-liner. To convert all errors into terminating errors simply specify$ErrorActionPreference = "Stop"
in your script or specify-ErrorAction Stop
to the relevant cmdlets - Implemented new
-Id
parameter on all applicable operation cmdlets. Cmdlets that support Batch Mode allow specifying multiple IDsAcknowledge-Sensor -Id 1001,1002 -Forever
- Implemented new
Object
parameter onGet-Object
. Allows piping in a parent object to retrieve direct children from. Chain multiple calls together to explore the PRTG Object Tree!# Retrieve all Notification Actions from the system Notifications object Get-Object -Id -3 | Get-Object
- Implemented new
-SkipParent
parameter onClone-Object
. When used in conjunction with-SourceId
, allows skipping the parent of the source object when piping a number of devices into the cmdlet# Clone the sensor with ID 1001 to all devices in New York, excuding # the device that sensor ID 1001 is a child of Get-Device -Tags ny | Clone-Object -Id 1001 -SkipParent
Clone-Object
PowerShell Progress/-WhatIf
message improvementsMove-Object
,Sort-PrtgObject
,Get-Object
PowerShell Progress improvements- PrtgAPI PowerShell Progress now shows the ID of the object that is being processed/queued
- If
Get-SensorHistory
detects a channel value is a time span (according to a specialized heuristic) the channel value will be displayed as aTimeSpan
object - Implemented new
-Raw
parameter toGet-SensorHistory
. Allows displaying the raw values of each channel without units (e.g. a unit in MegaBytes will be displayed in Bytes) - Implemented new Manual parameter set on
Clone-Object
. Allows specifying an arbitrary-SourceId
and-DestinationId
. If no-DestinationId
is specified, the-SourceId
(also aliased as-Id
) will automatically be cloned under its parent object# Clone the Notification Action with ID 300 Clone-Object -Id 300
Set-ObjectProperty
now displays a warning if a single-RawProperty
is specified that is not known by PrtgAPI to not end in an underscore. If a set of-RawParameters
are specified, PrtgAPI will assume you know what you're doingC:\> Set-ObjectProperty -Id -RawProperty name -RawValue test WARNING: Property 'name' does not look correct. If request does not work try with 'name_' instead. To suppress this message specify -WarningAction SilentlyContinue.
Breaking Changes
General
- Renamed
TimeUnit.Sec
/TimeUnit.Min
toTimeUnit.Second
/TimeUnit.Minute
PowerShell
- Renamed internal name of
Sort-PrtgObject
(Start-SortPrtgObject
toInvoke-SortPrtgObject
). This should not affect you unless you were not using the documented nameSort-PrtgObject
Bugfixes
General
- Implemented new translation engine for deserializing Notification Triggers on non-English versions of PRTG (#91)
- Fixed
GetObjectProperty
/GetObjectPropertyRaw
not decoding HTML encoded values (such as backslash) when requesting typesafe (ortext = true
) values in newer versions of PRTG - PrtgAPI now ignores malformed
<input/>
tags emitted by PRTG that do not containname
attributes (#96) SetTriggerProperty
no longer allows specifyingnull
on properties that don't supportnull
(every property besides Notification Actions)- Fixed
CancellationToken
not being propagated properly to all requests inRestartCore
/RestartCoreAsync
,ApproveProbeAsync
- It is no longer possible to construct a
TriggerChannel
with anull
Channel
- Fixed
ObjectProperty.ExeFile
not modifying the ExeFileLabel property as well - Fixed DropDown List and TextArea HTML properties not being properly HTML decoded, resulting in malformed values in object properties, sensor targets, dynamic sensor parameters, etc
C#
- Fixed
SetObjectProperty
not serializing values for array properties properly when the value is of an alternateIEnumerable
type
PowerShell
- Resolved an issue wherein PrtgAPI PowerShell Progress would crash attempting to pipe a single
Group-Object
grouping stored in a variable to a PrtgAPI cmdlet - Fixed
Get-NotificationTrigger
not ignoring dynamic parameters withnull
values properly (#99) - Resolved an issue wherein
Get-SensorHistory
would fail to parse the channel unit/value properly when the value contains more than one space. Unless otherwise noted, if more than one space is detectedGet-SensorHistory
will refrain from displaying a numeric value