Get-NotificationTrigger - There was an error deserializing the object of type PrtgAPI.NotificationTrigger
See original GitHub issueThe following error is generated when the sensor name contains quotation marks:
PS > get-sensor -Id 5725 | Get-NotificationTrigger
Get-NotificationTrigger : There was an error deserializing the object of type PrtgAPI.NotificationTrigger. Encountered unexpected character 'E'. At line:1 char:23 + get-sensor -Id 5725 | Get-NotificationTrigger + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-NotificationTrigger], SerializationException
+ FullyQualifiedErrorId : System.Runtime.Serialization.SerializationException,PrtgAPI.PowerShell.Cmdlets.GetNotificationTrigger
Sensor name: Disk Free: D:\ Label: Exchange “DATA” -> Generates the error Sensor name: Disk Free: D:\ Label: Exchange DATA -> No error
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
PrtgAPI.XML 0.7.2
Indicates a "Notify Changed" event occurred on an EXE/XML sensor, or that a WMI sensor encountered an error. </summary> </member> <member name="F:PrtgAPI.
Read more >PrtgAPI.XML 0.9.2 - PowerShell Gallery
PrtgAPI.XML ... Specifies the type of object that should be used in conjunction with a ... A new subnode (such as a notification...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @astapelfeld,
I have managed to reproduce the issue by creating a new state trigger on an object whose name contains a quote. At a glance it appears PRTG is (once again) transmitting completely illegal JSON/XML around
Specifically, the
href
attribute of theobjectlink
JSON property in the response above decodes to the followingThis is illegal; the quotes surrounding the word DATA should be double encoded so that they come out as single encoded when processed by a parser.
I will look into implementing a workaround for this. Thanks for raising this issue
Hi @lordmilko , The problem is solved in the pre-release. Thank you!