github lordmilko/PrtgAPI v0.9.6
PrtgAPI 0.9.6

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

New Cmdlets

  • New-Sensor: Allows creating supported sensor types via dynamic PowerShell parameters
    # Create a new ExeXml sensor
    Get-Device -Id 1001 | New-Sensor -ExeXml "Veeam Backups" "Get-VeeamBackupStatus.ps1" -Mutex "veeam1"
    
    # Create a new sensor factory
    Get-Sensor -Tags wmicpu* | New-Sensor -Factory "CPU Overview" { $_.Device } -sn "Average Usage" -se Average -DestinationId 1001 -FactoryErrorMode WarnOnError

Improvements

General

  • All NewSensorParameters types now automatically initialize their Priority, InheritTriggers, InheritInterval, Interval and IntervalErrorMode properties to the default values used by all sensor types
  • Implemented new type FactorySensorParameters. Provides native support for creating new sensor factory objects
  • Implemented support for specifying raw GPS location coordinates to SetObjectProperty
  • Implemented support for specifying a custom location label/name for devices, groups and probes when setting an ObjectProperty.Location (#60)
    • If the specified location contains multiple lines, the first line will be treated as a label (unless doing so causes the rest of the address to become invalid)
    • A custom label can also be explicitly specified by specifying the ObjectProperty.LocationName parameter in conjunction with ObjectProperty.Location
  • SetChannelProperty now considers the unit of a channel when modifying channel properties that require a unit factor (#63)
    • If only a sensor ID or channel ID is specified, PrtgAPI will automatically retrieve the appropriate Channel objects
  • SetObjectProperty / SetChannelProperty no longer overrides explicitly defined parameters that conflict with dependent values. For example, specifying UpperErrorLimit with LimitsEnabled = false will now set LimitsEnabled to false instead of flipping it to true
  • All exception messages should now end in a period or question mark
  • AddSensor now validates that the sensor type is actually supported before trying to add a sensor

C#

  • All PrtgClient methods that operate on a single object now support accept an argument of type Either<,>, allowing you to specify an IPrtgObject or int for the ID parameter
    //Manipulate an object without having to access its ID!
    client.PauseObject(sensor);
    
    //Specify an ID explicitly
    client.PauseObject(1001);
  • All TriggerParameters constructors now support specifying a value of type Either<IPrtgObject, int>
  • Implemented new property ConstructorScope for use with custom RawSensorParameters types. When wrapped with using in the constructor, instructs PrtgAPI not to set the dependencies of any properties defined within its scope. Once the scope has been disposed, dependencies will become settable
  • All PrtgClient methods now perform proper input validations
  • Implemented new SetChannelProperty overloads that support specifying a channel directly

PowerShell

  • Implemented support for viewing online PowerShell help. Invoking Get-Help <cmdlet> -online against any PrtgAPI cmdlet will now open the corresponding wiki page in your web browser
  • Get-Sensor, Get-Device, Get-Group, Get-Probe, Set-ObjectProperty and Set-ChannelProperty now show their dynamic parameters under Get-Help
  • Get-SensorTarget now supports filtering by a list of values
  • Implemented PowerShell table format for ModificationEvent objects

New-SensorFactoryDefinition

  • Implemented new fdef alias for New-SensorFactoryDefinition
  • -ChannelId is now an optional parameter. If no -ChannelId is specified, defaults to 0
  • Implemented new Summary parameter set. Allows generating a leading summary channel
Get-Sensor -Tags wmicpu* | fdef { $_.Device } -sn "Average Usage" -se Average
  • -Aggregator parameter now allows specifying either a custom ScriptBlock or one of several well known summary types (e.g. Sum, Min, Max, Average)

Breaking Changes

C#

  • Renamed PrtgClient.SetObjectProperty overloads that operate on channels to PrtgClient.SetChannelProperty
  • ScanningInterval and TriggerChannel now throw an ArgumentException instead of an InvalidCastException when a value cannot be parsed
  • Removed tags parameter from ExeXmlSensorParameters, HttpSensorParameters and WmiServiceSensorParameters constructors
  • Removed inheritInterval, interval, intervalErrorMode parameters from ExeXmlSensorParameters constructor
  • Changed ExeXmlSensorParameters properties SetExeEnvironmentVariables and UseWindowsAuthentication from bool? to bool
  • Changed HttpSensorParameters properties UseCustomPostContent and UseSNIFromUrl from bool? to bool

Bugfixes

  • Fixed SSL certificate errors not being ignored properly when a server protocol or port is explicitly specified (#67)
  • Fixed input tags not being identified correctly when the input name or value contained "radio" or "checkbox" (#59)
  • Fixed the PrtgWebClient throwing a NullReferenceException when the WebRequest.DefaultWebProxy is null (#62)
  • Fixed many instances where PrtgAPI did not validate input parameters properly, typically resulting in a NullReferenceException
  • Fixed incorrect XmlEnum values on WmiServiceStatus.StopPending, ContinuePending and PausePending (#64)
  • Fixed AddSensor not validating sensors were created successfully in PRTG 18.1+. If a sensor cannot be created under a given device, PrtgAPI will now throw an exception specifying the reason for the failure
  • Fixed CloneObject failing to parse ID of created sensors in PRTG 19.1. Note: due to a known issue in PRTG 19.1, devices and groups will not return their ID after they have been created, which will result in a PrtgRequestException. This issue has been reported to Paessler, who have confirmed this behavior is not expected

Don't miss a new PrtgAPI release

NewReleases is sending notifications on new releases.