Skip to content

Releases: lordmilko/PrtgAPI

PrtgAPI 0.9.19

14 Sep 11:55
Compare
Choose a tag to compare

Bugfixes

  • Fix addsensor5.htm failing in PRTG 23.3.86 (Fix #345)
  • Ignore case when checking for "the object is currently not valid" in the response URL of a cloned object (Fix #309)

PrtgAPI 0.9.18

28 Nov 07:23
Compare
Choose a tag to compare

Improvements

  • Implement top secret nosession=1 parameter on /editsettings API calls to reduce PRTG Core Server memory usage when modifying settings in bulk

Bugfixes

  • Fix PrtgAPI PowerShell Progress crashing when piping from Variable -> Unsupported (e.g. Out-GridView) -> Action (#274)
  • Fix Connect-GoPrtgServer crashing when encrypted passhash cannot be converted into a SecureString (e.g. it was copied from another user/computer's profile)
  • Fix PRTG failing to resolve created objects when name starts or ends with whitespace due to PRTG trimming name (#276)
  • Fix ObjectProperty.Location not setting location value properly when the current culture's number format does not match invariant culture (#275)
  • Fix AddSensor failing when the 302 redirect from addsensor5.htm to device.htm fails witth HTTP status 556 as a result of the PRTG server being under high load. (#280)
  • Fix ConvertUtilities.ToDynamicDouble crashing in TryRoundDecimal when trying to equate 1,000 and 999.8 due to 000 simplifying to 0 - less than 2 digits (#283)
  • Don't throw a 403 forbidden when querying whether a PRTG Server is using English when using a non-admin user in PRTG 22.3.79 (#308)
  • Fix SensorQueryTarget values specified to GetDynamicSensorParameters() not being used when eventually calling AddSensor() (#312)
    • Implement support for specifying the SensorQueryTarget or other ISensorQueryTargetParameters to use on RawSensorParameters, which is now mandatory for sensor types expecting sensor query targets in PRTG 22.3.78.1873

PrtgAPI 0.9.17

24 Feb 00:51
Compare
Choose a tag to compare

Improvements

  • Implement support for modifying and retrieving ObjectProperty.PrimaryChannel
    • Set-ObjectProperty will resolve the -PrimaryChannel for you based on a wildcard expression that can be specified

Bugfixes

  • Fix ConvertUtilities.ToDynamicDouble in Get-SensorHistory crashing when a display value containing a decimal point with more than 3 decimal places is passed in but with a raw value whose value is an integer (#223)
  • Fix Threshold not being set to double? in NotificationTriggerData used when deserializing triggers running on non-English versions of PRTG (#230)
  • Fix PrtgAPI PowerShell progress not being completed properly when an exception is thrown during an EndProcessing block (such as when -Batch:$true) or when ErrorActionPreference = "Stop" in any stage
  • Fix sensor factory channel definitions set by PrtgAPI corrupting the PRTG Configuration file in older versions of PRTG due to \r\n separating newlines being expected rather than simply \n
  • Fix colon dates on SystemInfo objects sometimes being an error string rather than null or empty (#237)
  • Fix Get-SensorHistory not taking into consideration channel scaling multiplication and division values when figuring numeric display value from unknown culture via ConvertUtilities.ToDynamicDouble (#241)
  • Fix Get-SensorHistory failing to retry creating format XML after an exception previously occurred during the first generation attempt
  • Fix pipe from variable progress crashing due to ArrayEnumerator changes in PowerShell Core 7.2.0 (#252)
  • Fix Channel.Unit not setting properly when channel does not contain a customunit field at all
  • Fix GetObjectProperty XML sanitization not working properly on multiline strings (#262)
  • Fix API requests that rely on cookie authentication failing in 22.1.74+ (#268)

PrtgAPI 0.9.16

02 Jun 13:54
Compare
Choose a tag to compare

New Features

  • Implement support for generating sensor history reports showing precise uptime/downtime within a specified time range. Accessible via the new PrtgClient.GetSensorHistoryReport method or via the new -Report parameter on the Get-SensorHistory cmdlet. For more information, please see the wiki

Improvements

  • AddSensor / Add-Sensor now hints that you may need to specify DynamicType on your request parameters when it is unable to resolve the created object (a common occurrence with snmplibrary sensors)
  • PrtgAPI now stores more precise build numbers (especially useful for differentiating between various pre-release builds) via AssemblyInformationVersion attributes, exposed when troubleshooting via Get-PrtgClient -Diagnostic

Bugfixes

  • Fix ConvertUtilities.ToDynamicDouble not using "normal" rounding (MidpointRounding.AwayFromZero) resulting in a failure to properly parse values in some scenarios (#218)
  • ConvertUtilities.ToDynamicDouble can now convert theoretically any single character thousands/decimal group separator combination (#221)
  • Fix GetProbe not returning all probes in some environments due to new probe retrieving logic implemented in PrtgAPI 0.9.15 (#219)

PrtgAPI 0.9.15

07 May 08:27
Compare
Choose a tag to compare

Improvements

General

  • PrtgAPI now includes hidden channels in API results (#194)
  • Implemented support for modifying ChannelProperty.ShowInTable
  • Implemented support for modifying ChannelProperty.Name (#201)
  • Sensors, Devices, Groups and Probes now show their inherited scanning intervals when InheritInterval is false (#197)
  • PrtgAPI now trims trailing slashes in the PRTG server name (prtg.example.com/ -> prtg.example.com) (#206)

Bugfixes

General

  • Add LogStatus.FtpConnectionMode (#214)
  • Fix GetProbe / Get-Probe not working in PRTG 21.2.67 (#215)
  • Add "equal to" and "not equal to" as possible deserialization values for TriggerCondition.Equals and NotEquals respectively in newer versions of PRTG
  • Fix deserialization engine throwing a NullReferenceException when failing to deserialize an unknown value of an enum ObjectProperty
  • Fix SetChannelProperty / Set-ChannelProperty ignoring all errors returned from API requests; now only ignores errors returned when properties that are known to cause erroneous PRTG errors are specified (like ChannelProperty.PercentValue)

PowerShell

  • Fix Get-SensorHistory failing to calculate display values in some circumstances due to a rare rounding error (#218)

Known Issues

Due to a bug in (at the very least) some of the latest versions of PRTG, due to the new way in which PrtgAPI retrieves probes (which is required due to changes in PRTG 21.2.67+) PrtgAPI may not always return all probes from your PRTG server. This issue has been reported to Paessler; for now, if you find PrtgAPI 0.9.15 does not return all of your probes it is recommended you use PrtgAPI 0.9.14 with a version of PRTG prior to 21.2.67 (that does not have the new PRTG Core Server device)

PrtgAPI 0.9.14

25 Nov 10:31
Compare
Choose a tag to compare

Improvements

General

  • Implemented ClusterNode property on Log objects

C#

  • Implemented FlagEnum.Create static methods for creating FlagEnum<T> objects

PowerShell

  • Implemented support for specifying null or empty passwords to New-Credential
  • Implemented -Hashtable parameter on New-SensorFactoryDefinition. Allows generating complex sensor factory definitions in a single go that would normally require multiple New-SensorFactoryDefinition invocations
    C:\> Get-Sensor -Tags wmimem* | fdef @{name={$_.Device}},@{name="Line at 40.2 [msec]";value=40.2}
  • Implemented PowerShell type conversion on cmdlet parameters that internally get passed to other cmdlets (such as New-Sensor -Factory ..., which involves internally invoking New-SensorFactoryDefinition)

Bugfixes

General

  • Fix API requests involving cookies not working when a user incorrectly specifies to use http:// instead of https:// against a HTTPS PRTG server (Fix #181)
  • Fixed notification action property categories (Email, SMS, etc) not triggering lazy loads on NotificationAction objects retrieved notification triggers
  • Fix ServerStatus.DateTime crashing when the server DateTime format differs from the client format (e.g. US vs UK time format)

PowerShell

  • Fix Get-Sensor not retrieving sensors from groups via intermediate devices when specifying -Recurse:$false (Fix #159)

PrtgAPI 0.9.13

07 May 04:57
Compare
Choose a tag to compare

Improvements

General

  • Add support for extracting an enhanced error message when adding sensors/resolving sensor targets/parameters when an error message is not included in the AddSensorProgress response (#140)

C#

  • Add startDate parameter to PrtgClient.WatchLogs (#139)

PowerShell

  • Add -rt alias for -RawType parameter on Get-SensorTarget / New-SensorParameters
  • Fix PowerShell Progress failing when piping from a variable containing an Array/SZArrayEnumerator in .NET Core 3.1 (#136)

Bugfixes

  • Fix GetNotificationTriggers crashing when PRTG fails to properly HTML encode quotes in sensor names (#131)
  • Fix NotificationTriggerTranslator not storing unique name for Notification Action items, resulting in crash when multiple actions exist with the same name (#145)

Breaking Changes

  • Change NotificationAction.SMP.TrapCode from an int to an int? due to PRTG not forcing it have a value (#130)

PrtgAPI 0.9.12

13 Feb 01:14
Compare
Choose a tag to compare

New Cmdlets

  • Compare-PrtgTree: provides a PowerShell friendly way of comparing and reducing PrtgNode objects, as well as specifying the types of comparisons to include/exclude

Improvements

General

  • FlagEnum types now properly flatten the list of values specified to their constructor, rather than assuming none of the specified values contain flags
  • FlagEnum types now properly merge negative flags with negative flags passed to them. If only negative flags are specified, all flags but those specified will be included
  • Added complement operator ~ to FlagEnum
  • Add support for comparing/printing the values of PropertyValuePair objects contained in PropertyNode objects
  • PrtgNode comparisons now take into consideration whether their positions under their parents have changed
  • PrtgNode children are now automatically sorted according to their position
  • PrtgNode.CompareTo() now allows specifying the comparisons to include/exclude
  • Added a Node member to PrettyLine objects. Stores the TreeNode the line is represents

PowerShell

  • Add -Reduce parameter to Show-PrtgTree. Pretty prints a reduced CompareNode tree (equivalent $tree.Reduce() | Show-PrtgTree)
  • Fixed incorrect grammar in Get-SensorHistory PowerShell progress
  • Added custom table format for PropertyNode objects for displaying the underlying value

Bugfixes

General

  • Include TLS 1.2 in allowed security protocols on older versions of .NET Framework for compatibility with PRTG 20.1.55 (#128)
  • Fixed an issue wherein GetSensorHistory incorrectly assigned the same raw value to multiple channels when multiple objects exist with the same channel ID (such as the volume and speed channels of Traffic Sensors)
  • Fix CompareNode reduction not detecting differences that are only visible on grandchildren, resulting in trees potentially failing to be reduced at all
  • Fix data KB/MB/GB/TB data units failing to deserialize on Notification Triggers in PRTG 20.1.55

PowerShell

  • Fixed Get-SensorHistory not parsing byte display values properly (#124)
  • Fixed Get-SensorHistory converting values over 1000 to decimals when the last 3 digits of the display value match the decimal places of the raw value, rounded up (#125)
  • Fixed missing setter on Get-PrtgTree -Options parameter
  • Fix progress not being displayed with tree cmdlets like Get-PrtgTree when values outside of TreeParseOption.Common are specified

PrtgAPI 0.9.11

09 Dec 10:31
Compare
Choose a tag to compare

Bugfixes

PowerShell

  • Fixed Get-SensorHistory crashing when parsing display values greater than or equal to one million (#123)
  • Redesigned Get-SensorHistory display value parsing algorithm to be much more robust against determining whether a display value uses an EU or US number format

PrtgAPI 0.9.10

05 Dec 04:21
Compare
Choose a tag to compare

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 a PrtgNode 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 Tree
  • PrtgClient.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 on Get-NotificationTrigger. Allows specifying the ID of the object to retrieve triggers from in lieu of piping in the parent object
  • Implemented -Resume parameter on Clone-Object. Allows resuming objects as they are created. Note: in terms of performance it is almost always faster to pipe newly cloned objects into the Resume-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 on Get-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)
    Fix HtmlParser 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 and Set-TriggerProperty -WhatIf / progress messages not displaying array values properly
  • Fixed common PowerShell parameters such as -Verbose not being passed to internal cmdlets invoked inside New-Sensor
  • Fixed duplicate -Destination parameter on Add-Device and Add-Group
  • Fixed Duplicate -Parameters parameter on Add-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