github lordmilko/PrtgAPI v0.9.9
PrtgAPI 0.9.9

latest releases: v0.9.19, v0.9.18, v0.9.17...
4 years ago

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.
  • The NotificationTypes property on sensors, devices, groups and probes does not work

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 and Priority properties from SensorSettings to TableSettings base class, giving these properties to DeviceSettings, GroupSettings and ProbeSettings as well
  • Changed NotificationTrigger.Threshold from int? to double?
  • 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 to SetObjectProperty
    //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 IDs
    Acknowledge-Sensor -Id 1001,1002 -Forever
  • Implemented new Object parameter on Get-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 on Clone-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 improvements
  • Move-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 a TimeSpan object
  • Implemented new -Raw parameter to Get-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 doing
    C:\> 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 to TimeUnit.Second / TimeUnit.Minute

PowerShell

  • Renamed internal name of Sort-PrtgObject (Start-SortPrtgObject to Invoke-SortPrtgObject). This should not affect you unless you were not using the documented name Sort-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 (or text = true) values in newer versions of PRTG
  • PrtgAPI now ignores malformed <input/> tags emitted by PRTG that do not contain name attributes (#96)
  • SetTriggerProperty no longer allows specifying null on properties that don't support null (every property besides Notification Actions)
  • Fixed CancellationToken not being propagated properly to all requests in RestartCore / RestartCoreAsync, ApproveProbeAsync
  • It is no longer possible to construct a TriggerChannel with a null 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 alternate IEnumerable 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 with null 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 detected Get-SensorHistory will refrain from displaying a numeric value

Don't miss a new PrtgAPI release

NewReleases is sending notifications on new releases.