Skip to content

Releases: lordmilko/PrtgAPI

PrtgAPI 0.8.6

04 May 12:03
Compare
Choose a tag to compare

New Features

PowerShell

  • Implemented support for specifying a hashtable of -RawParameters to Set-ObjectProperty

New Methods

  • PrtgClient.GetSchedules: Retrieve all monitoring schedules supported by PRTG

New Cmdlets

  • Get-PrtgSchedule: Retrieve all monitoring schedules supported by PRTG

Improvements

General

  • Implemented support for retrieving Proxy Settings for HTTP Sensors, Scanning Intervals and Schedules, Dependencies and Maintenance Window settings from devices, groups and probes

PowerShell

  • New-SearchFilter now accepts a -Value of type object rather than string
  • Implemented support for opening notification actions and schedules via Open-PrtgObject
  • Removed unnecessary call to PrtgClient.GetGroups in Get-Sensor when specifying -Resolve:$false

Bugfixes

General

  • Fixed an issue wherein NotificationAction objects returned as part of a NotificationTrigger did not lazily deserialize all of their properties
  • Probe parameters now prevent filtering by a ParentId other than 0
  • PrtgAPI now correctly serializes DateTime and TimeSpan objects specified in search filters
  • A more descriptive error message is now thrown when attempting to filter by a Status of 0

PowerShell

  • Fixed several instances of cmdlets not properly unwrapping PSObject values
  • Fixed a bug wherein Channel parameter of Set-ChannelProperty was not mandatory on Default and Dynamic parameter sets
  • PrtgAPI now consistently displays all results when performing queries like Get-Sensor ping -Count 1. For more information, see Case Sensitive Filtering below

Case Sensitive Filtering

When filtering on a table cmdlet using FilterOperator.Equals PRTG can become case sensitive when multiple filters are used together (such as Name + Tags). Since the common parlance of PowerShell is to be case insensitive, PrtgAPI circumvents this by filtering using FilterOperator.Contains even if a wildcard is not specified.

If a -Count is used in conjunction with a literal -Name (e.g. Get-Sensor ping -Count 1) query's results may contain items whose names do not actually match (e.g. SSH Ping). As PrtgAPI will automatically remove any non-matching items, fewer results than expected may be displayed.

In order to accommodate the common case of Get-Sensor <name> -Count <count>, when PrtgAPI detects that -Name and no other filter besides ParentId has been specified, the Name filter operator will be changed to FilterOperator.Equals.

PrtgAPI 0.8.5

23 Apr 15:04
Compare
Choose a tag to compare

Bugfixes

  • Fixed an issue wherein DynamicSensorParameters prohibit assigning non-sensor target enumerable values to custom parameters

PrtgAPI 0.8.4

23 Apr 06:15
Compare
Choose a tag to compare

New Methods

  • PrtgClient.GetDeviceTemplates: Retrieves all device templates supported for use in an auto-discovery

New Cmdlets

  • Get-DeviceTemplate: Retrieves all device templates supported for use in an auto-discovery

Improvements

  • Device templates can now be specified to NewDeviceParameters. Specifying one or more templates will automatically set the AutoDiscoveryMode to AutomaticTemplate (#11)
  • Manual auto-discoveries performed by AutoDiscover / Start-AutoDiscovery can now specify one or more device templates to limit the scope to the discovery
  • Implemented new property Is64Bit on ServerStatus returned by GetStatus / Get-PrtgStatus
  • CustomParameter objects can now specify a ParameterType to indicate whether their values should be treated a single values (name=val), multi values (name=val1,val2) or multi parameters (name=val1&name=val2)
  • Custom parameters used by RawSensorParameters / DynamicSensorParameters now use ParameterType.MultiParameter by default (#12)

PowerShell

  • Added new parameter -Template to Add-Device. When used in conjunction with -AutoDiscover, retrieves all device templates that match one or more specified wildcards
  • Implemented new parameter -Downtime on Get-SensorHistory. When -Average is not specified, sets the average based on the scanning interval of the sensor, allowing the Downtime column to be included in response. For more information see the wiki
  • Implemented new parameter -ProbeStatus on Get-Probe. Allows filtering for probes with a specified ProbeStatus
  • Set-ObjectProperty now allows specifying multiple raw values at once for use with a single raw property

Bugfixes

  • Results returned by GetSensorTypes / Get-SensorType no longer include duplicate types returned by PRTG
  • Raw settings that allow for multiple selections (such as Traffic Mode of SNMP Traffic sensors) returned by GetObjectPropertiesRaw / Get-ObjectProperty -Raw now display correctly

PowerShell

  • Fixed a bug wherein Get-SensorHistory would not stream properly when an -EndDate is specified
  • Fixed an issue wherein several cmdlets would perform their actions before displaying initial progress
  • Fixed an issue wherein sensor target resolution would crash when PRTG did not include an error message in its error response (such as when its Host value has changed)

Breaking Changes

  • Renamed Probe property Condition to ProbeStatus

PrtgAPI 0.8.3

02 Apr 01:39
Compare
Choose a tag to compare

Improvements

  • Improved -Verbose log messages when executing recurse cmdlets

Bugfixes

  • Fixed a bug wherein Get-Sensor would retrieve all sensors within PRTG when piping from a group with no immediate child devices that has the same name as another group with -Recurse:$true
  • Get-Sensor, Get-Device and Get-Group will now revert any changes made to SearchFilter objects if an exception is thrown while recursing

PrtgAPI 0.8.2

30 Mar 01:48
Compare
Choose a tag to compare

New Features

  • PrtgAPI can now generate dynamic sensor parameters for almost any sensor type, allowing almost all sensor types to be programatically created. Parameters for sensor types that require additional information before device interrogation (such as Oracle Tablespace) cannot be dynamically generated.
  • Sensor Targets can now be retrieved for unsupported sensor types. Supports all sensor types excluding types that require additional information prior to device interrogation (such as Oracle Tablespace)
  • Multiple object and channel properties can now be modified in a single request

Improvements

General

  • NewSensorParameters now include properties for common sensor parameters, including Name, Interval, Priority, etc
  • Common sensor parameters that are not specified will not be included in the parameter set, allowing PRTG to instantiate these fields with their default values
  • RawSensorParameters now have an indexer, allowing instances to be accessed like a Dictionary
  • SensorType on RawSensorParameters can now be modified
  • Implemented native support for creating new HTTP sensors via HttpSensorParameters
  • Sensor history records returned by GetSensorHistory / Get-SensorHistory are now ordered from newest to oldest

C#

  • Multiple object properties can now be modified in a single request by specifying a collection of PropertyParameter, ChannelParameter or CustomParameter objects to SetObjectProperty / SetObjectPropertyRaw
  • GetSensorHistory now supports specifying a count, limiting the number of results returned within the specified timespan

PowerShell

  • RawSensorParameeters now presents as a hybrid PSObject, allowing values to be modified and retrieved from real property names
  • New-SensorParameters now have an -Empty parameter. Allows constructing a completely empty set of RawSensorParameters for allowing instantiation without constructing a hashtable
  • Set-ObjectProperty / Set-ChannelProperty now support specifying object property names as parameters, allowing multiple properties to be modified in a single request
  • Get-ObjectProperty now supports specifying multiple individual properties to retrieve
  • Get-SensorHistory will now stream records from PRTG when an -EndDate is specified
  • Implemented -Count parameter on Get-SensorHistory. Allows limiting the number of results returned within the specified timespan

New Methods

  • PrtgClient.GetDynamicSensorParameters: Create sensor parameters for a specified sensor type
  • PrtgClient.Targets.GetSensorTargets: Retrieve sensor targets for unsupported sensor types
  • PrtgClient.StreamSensorHistory: Stream large collections of sensor history records from a PRTG Server

New Cmdlets

  • Get-SensorType: Retrieve sensor types supported by PRTG

Bugfixes

PowerShell

  • Fixed a bug wherein Get-ObjectLog would fail to retrieve records -Since AllTime against certain objects

Breaking Changes

General

  • Switched meaning of start date and end date when used with GetSensorHistory / Get-SensorHistory for consistency with GetLogs / Get-ObjectLog. StartDate now refers to the point in time closest to now, whereas EndDate now refers to the point in time furthest from now

C#

  • Sensor parameters no longer accept Priority and InheritTriggers in their constructors
  • All enum and bool properties on NewSensorParameters are now nullable

PrtgAPI 0.8.1

11 Mar 03:32
Compare
Choose a tag to compare

Improvements

C#

  • Implemented support for resolving objects created via AddSensor, AddDevice, AddGroup and AddNotificationTrigger. Can be disabled by setting optional parameter resolve to false
  • Installing PrtgAPI from NuGet no longer imports PowerShell Help files into solution
  • PrtgAPI.cmd is now included in NuGet, allowing a PrtgAPI PowerShell prompt to be easily opened from your NuGet packages folder

PowerShell

  • Get-Sensor, Get-Device, Get-Group and Get-Probe can now filter for objects that contain all specified tags via -Tags parameter. Filtering for objects that contain any specified tag (previous -Tags behavior) can now be performed with new -Tag parameter
  • PrtgAPI.cmd can now be used regardless of the folder name the PrtgAPI module is installed in

General

  • NotificationAction objects now include enhanced properties detailing the specifics of each notification type they perform and the users these alerts are sent to

Bugfixes

C#

  • Implemented missing call to ConfigureAwait(false) on several methods

PowerShell

  • Fixed a bug wherein progress did not complete when an exception is thrown by a multi operation cmdlet

General

  • Resolved an issue wherein ErrorLimitMessage and WarningLimitMessage cannot be modified and LimitsEnabled cannot be set to true via SetObjectProperty / Set-ChannelProperty on PRTG 18.1.38+. Attempting to modify these properties when a limit value has not been set on the UpperErrorLimit, LowerErrorLimit, UpperWarningLimit or LowerWarningLimit of a channel will now generate an InvalidOperationException specifying the IDs of the sensors that require a limit
  • Fixed a bug wherein PrtgUrl construction would crash when the search filters of a request have been explicitly set to null

Breaking Changes

PowerShell

  • -Tags parameter of Get-Sensor, Get-Device, Get-Group and Get-Probe now performs logical AND instead of logical OR. Previous -Tags behavior can be attained via new -Tag parameter

PrtgAPI 0.8.0

23 Feb 00:41
Compare
Choose a tag to compare

New Features

General

  • Compatible operations now support specifying multiple Object IDs in a single request (e.g. acknowledging, pausing, modifying properties, etc). Cmdlets of operations that now support specifying multiple Object IDs will now execute in Batch Mode by default, queuing all records received from the pipeline so they can be processed at once via a single API call. All operations that support Batch Mode now execute infinitely faster. Batch Mode can be disabled by specifying -Batch:$false
  • Sensor Targets used for creating new sensors including EXE/Advanced Script files, WMI Services and Microsoft SQLv2 database queries can now be resolved from PRTG. Sensor Targets resolved from one object can then be passed assigned to sensor parameter objects and assigned to any device within PRTG.
  • Implemented support for retrieving all raw properties (settings) of an object. In C#, these are returned as a dictionary, whereas in PowerShell these are returned as a PSObject

PowerShell

  • Implemented new -PassThru parameter on all operation cmdlets that take pipeline input. When specified, the input object to the cmdlet will also be emitted after executing the cmdlet's operation, allowing for mutiple operations to be chained together in a single pipeline
  • Implemented new -SourceId parameter to Clone-Object, allowing a single object to be cloned to multiple objects passed in through the pipeline
  • PrtgAPI will now automatically resolve any new objects that are created by PrtgAPI cmdlets by default (including Add-Sensor, Add-Device, Add-Group, Add-NotificationTrigger and Clone-Object). Resolution of created objects can be disabled by specifying -Resolve:$false
  • PrtgAPI will now show progress when executing a pipeline containing Select-Object surrounded by PrtgAPI cmdlets. PrtgAPI will only show progress when Select-Object is used as the first or second cmdlet in the pipeline. If Select-Object is used at any point beyond the second cmdlet, progress will be disabled for the entirety of the pipeline
  • When piping Get-Sensor, Get-Device or Get-Group from parent groups returned by Get-Group, PrtgAPI will now recurse all child groups under the parent group, returning all target objects under the entire object hierarchy. Resolution of objects only under the parent group can be performed by specifying -Recurse:$false

New Methods

  • PrtgClient.AddDevice: create a new device from a set of device parameters
  • PrtgClient.AddGroup:: create a new group from a set of group parameters
  • PrtgClient.Targets.GetExeXmlFiles: list all files under the Custom Sensors\EXEXML folder of a device's PRTG Probe
  • PrtgClient.GetObjectPropertiesRaw: Retrieves all raw properties defined on an object
  • PrtgClient.GetObjectProperty: Retrieves a property from a PRTG object as an object of its true type
  • PrtgClient.GetObjectProperty<T>: Retrieves a property from a PRTG object cast to its true type
  • PrtgClient.Targets.GetWmiServices: list all WMI Services installed on the target device
  • PrtgClient.Targets.GetSqlServerQueries: list all files under the Custom Sensors\sql\mssql folder of a device's PRTG Probe

New Cmdlets

  • Add-Device: create a new device from a set of device parameters
  • Add-Group: create a new group from a set of group parameters
  • New-DeviceParameters: create a set of parameters for creating a new device
  • New-GroupParameters: create a set of parameters for creating a new group
  • Get-SensorTarget: resolve sensor targets (such as WMI Services or EXE/Script files) that can be used for creating a new sensor

Improvements

General

  • Improved deserialization performance by 100%
  • PrtgAPI will now throw much more informative exception messages when failing to deserialize enum members
  • RestartCore / RestartProbe (C#) and RestartPrtgCore / RestartProbe (PowerShell) now support waiting for the specified targets to restart before completing. C# methods provide a progress callback to allow monitoring or aborting the wait request
  • Implemented support for creating WMI Service sensors
  • PrtgAPI will now automatically resolve any DescriptionAttribute defined on an enum used in a set of custom request parameters
  • If an IEnumerable is assigned to a SearchFilter, PrtgAPI will now iterate over the collection constructing a filter for each item
  • Increased default maximum number of items returned by ContentParameters from 50,000 to unlimited
  • ContainerSettings and SensorSettings ToString now returns the object's Name

Object Properties

  • Implemented support for retrieving and modifying Hostv4, Hostv6, ServiceUrl, AutoDiscoveryMode, AutoDiscoverySchedule and Comments
  • Implemented Host property alias for Hostv4
  • Implemented support for modifying and retrieving Microsoft SQL v2 sensor properties
  • Implemented support for retrieving a device's IPVersion. IPVersion is automatically updated upon setting Hostv4 or Hostv6
  • Implemented support for modifying all password related fields. Settings objects now contain Has- properties (HasWindowsPassword, HasLinuxPassword, etc) to indicate whether these values have explicitly been set on the target object
  • Get-ObjectProperty parameter -RawProperty can now take multiple property names. If a single property is specified, its value is returned as a string. If multiple properties are specified, a PSObject containing all property values is returned
  • Implemented new -Raw parameter for Get-ObjectProperty. If specified, Get-ObjectProperty will return all raw properties defined on the object
  • Implemented new -Property parameter on Get-ObjectProperty. Allows specifying a single property to retrieve.

C#

  • Implemented support for specifying a SortDirection on TableParameters
  • Methods that support streaming (and do not do any filtering) now take an optional argument specifying whether the request should be executed serially

PowerShell

  • Probes will now show their Condition (Connected / Disconnected) by default when shown in table view instead of their Status (Up / Paused)
  • Devices will now show their Host by default when shown in table view
  • Sensors, Devices, Groups and Probes now order their output according to their position under their parent object as shown in the PRTG UI
  • Get-Channel now supports filtering based on an array of Channel IDs
  • PrtgAPI objects now show their Name property in progress records displayed by inter-cmdlet progress
  • Implemented support for cloning NotificationTrigger objects with Clone-Object. Equivalent to piping to New-TriggerParametersfollowed byAdd-Trigger`
  • When adding a new sensor Add-Sensor will now automatically remove any spaces PRTG erroneously adds around the new sensor name
  • Cmdlets will now show inter-cmdlet progress when piping from a single variable inside a nested pipeline

Bugfixes

General

  • PrtgAPI will now validate the response returned from PRTG when attempting to resolve an address for use with ObjectProperty.Location

C#

  • Fixed a bug wherein RenameObject did not rename probes properly
  • Fixed Parameter.SortBy not working due to a missing ParameterTypeAttribute

PowerShell

  • Fixed several scenarios wherein progress records would not complete after the execution of multiple PrtgAPI cmdlets chained together
  • Install-GoPrtgServer no longer emits output when creating the PowerShell profile when it did not previously exist
  • Fixed a bug wherein -Status parameter did not properly work when attempting to filter devices, groups and probes
  • Fixed New-SensorParameters including the sensor type in the CustomParameters list, resulting in the sensor type being specified twice in the API request
  • Fixed Set-ChannelProperty Manual parameter set not displaying cmdlet target properly when invoked with -WhatIf
  • Fixed a bug wherein inter-cmdlet progress would not be enabled by default after updating your GoPrtg credential with Update-GoPrtgCredential

Breaking Changes

General

  • Renamed ExeName object property to ExeFile on both enum ObjectProperty and ExeXmlSensorParameters
  • Split settings property SSHElevationUser into SSHElevationSuUser and SSHElevationSudoUser properties
  • Changed SensorSettings.DependentObjectId from string to int?

C#

  • Moved Priority property to base NewSensorParameters class. NewSensorParameters constructor now requires a Priority be specified, with RawSensorParameters including Priority as an optional argument. If Priority is not specified to RawSensorParameters, a default priority of Three will be used

PowerShell

  • Combined Clone-Sensor, Clone-Device and Clone-Group into single Clone-Object cmdlet
  • Renamed -StartIndex parameter of New-SensorFactoryDefinition to -StartId
  • Renamed -Name and -Value properties of New-SensorParameters to -First and -Second. Meaning of these parameters is dependent on the type of sensor parameters being generated
  • Renamed -Item parameter of New-SensorFactoryDefinition to -Sensor

PrtgAPI 0.7.3

20 Nov 11:35
Compare
Choose a tag to compare

New Methods

  • C#: BackupConfigDatabase: Create a backup of your PRTG Configuration Database
  • C#: ClearSystemCache: Clear Geo Map, Active Directory and Graph Data caches
  • C#: LoadConfigFiles: Reload sensor lookups, device icons and report templates from disk
  • C#: RestartProbe: Restart the PRTG Probe Service of a PRTG Probe
  • C#: RestartCore: Restart the PRTG Core Service

New Cmdlets

  • PS: Backup-PrtgConfig: Create a backup of your PRTG Configuration Database
  • PS: Clear-PrtgCache: Clear Geo Map, Active Directory and Graph Data caches
  • PS: Load-PrtgConfigFile: Reload sensor lookups, device icons and report templates from disk
  • PS: Restart-Probe: Restart the PRTG Probe Service of a PRTG Probe
  • PS: Restart-PrtgCore: Restart the PRTG Core Service

Improvements

  • PS: Get-Sensor, Get-Device, Get-Group and Get-Probe -Tags and -Name parameters now properly parse wildcards containing asterisks in the middle of the pattern

Bugfixes

  • C#: Fixed a bug wherein logs would not properly filter by status

Breaking Changes

  • C#: Renamed PrtgClient.DeleteObject to PrtgClient.RemoveObject

PrtgAPI 0.7.2

13 Nov 23:29
Compare
Choose a tag to compare

New Features

  • Sensors can now be created from scratch. For sensor types supported by PrtgAPI, a sensor parameters type can be used to specify all the settings that will be used for the sensor, with PrtgAPI validating that all required fields have values. For sensor types currently unsupported by PrtgAPI, facilities are provided for constructing a set of custom parameters, optionally including full levels of type safety
  • PRTG event logs can now be retrieved from any object. If no object is specified, PrtgAPI automatically retrieves logs for today from the root node. Logs can be retrieved from a specific time frame, with a specific status, and can also be limited so that only a certain number of logs are retrieved

New Methods

  • C#: AddSensor: Create a new sensor from a set of sensor parameters
  • C#: GetLogs: Retrieve event logs for a PRTG object
  • C#: GetSensorTypes: List all sensor types supported by PRTG
  • C#: GetStatus: retrieve the status, configuration and version info of a PRTG Server

New Cmdlets

  • Add-Sensor: create a new sensor from a set of sensor parameters
  • New-SensorParameters: create a new set of sensor parameters of a specified type
  • Get-SensorFactorySource: retrieve the source sensors or channels of a Sensor Factory sensor
  • Get-ObjectLog: retrieve event logs for a PRTG object (or if no object is specified, for the whole server)
  • Get-PrtgStatus: retrieve the status, configuration and version info of a PRTG Server

Improvements

  • PS: Move-Object, Set-ObjectPosition, Simulate-ErrorStatus, Sort-PrtgObject and Start-AutoDiscovery now support -WhatIf
  • PS: Clone-Sensor, Clone-Group and Clone-Device now only make 4 retries when the new object can't be resolved instead of 5
  • PS: Implemented Get-ObjectSetting alias for Get-ObjectProperty
  • PS: Cmdlets that perform streaming now only calculate the total number of objects needed to retrieve once instead of twice
  • ExeName of EXE/XML sensors can now be retrieved and modified
  • InheritTriggers property of objects can now be modified
  • If PrtgAPI detects more than 20,000 objects will need to be streamed, PrtgAPI will instead stream objects "serially" (500 items at a time)
  • If PrtgAPI fails to deserialize an enum value due to it posessessing a value unknown to PrtgAPI, an exception will now be thrown describing the value that was missing

Bugfixes

  • C#: Fixed a bug in GetObjectTotals wherein totals for probe objects would not be properly calculated
  • C#: Fixed a bug wherein AddNotificationTriggersAsync and SetNotificationTriggersAsync were validating arguments with a synchronous method instead of an async one
  • PS: Edit-NotificationTriggerProperty now throws an an exception when the specified property does not exist on the target trigger parameter type
  • PS: Fixed an issue wherein New-SearchFilter would not work when specifying enum properties whose values require serialization
  • SetObjectProperty now properly validates values for numeric types
  • Fixed a bug wherein PrtgUrl construction would crash when an array of zero SearchFilter objects is specified
  • Fixed a bug wherein NotificationTypes property of sensors, devices, groups and probes did not properly report when sensors aren't inherited
  • Fixed a bug wherein PrtgAPI would crash attempting to parse a webpage containing an empty dropdown list
  • Fixed an issue wherein progress would fail when performing variable progress on a chain containing Action -> Action or Action -> Object -> Action
  • Fixed incorrect XmlEnum values for Access.None and Access.Inherited types

Breaking Changes

  • C#: Renamed SensorParameters.StatusFilter to SensorParameters.Status
  • PS: Renamed New-NotificationTriggerParameter to New-NotificationTriggerParameters
  • Renamed NotificationTypes.TriggerInheritance to NotificationTypes.InheritTriggers
  • SearchFilter objects now prevent specifying null as a value. If you wish to specify no value, specify an empty string
  • Moved Comments property from base type ObjectTable to more derived type SensorOrDeviceOrGroupOrProbe
  • Moved property Status from SensorOrDeviceOrGroupOrProbeOrMessageOrTicket to more derived type SensorOrDeviceOrGroupOrProbe

PrtgAPI 0.7.1

15 Oct 04:40
Compare
Choose a tag to compare

Improvements

  • PS: Improved error message when attempting to modify a GoPrtg server you are connected to under a different username
  • An exception will now be thrown if you attempt to create a TriggerParameters object from an inherited NotificationTrigger object

Bugfixes

  • PS: Fixed a bug wherein Edit-NotificationTriggerProperty would fail to parse enum values

Breaking Changes

  • C#: Implemented new trigger parameter constructors for creating trigger parameters from existing NotificationTrigger objects
  • C#: Removed redundant ModifyAction parameter from existing trigger parameter constructors taking NotificationTrigger objects. This constructor is now solely for creating brand new notification triggers