So I'm trying to pull a list of Group Names with their corresponding notification triggers using PRTGAPI, Get-Sensor | Get-Trigger gives me ObjectId & OnNotificationAction but I am struggling to find a way to list the object name instead of the OID. This is probably an easy fix but I have to admit I'm a dunce when it comes to scripting and the closest I've gotten is something like this

Get-Sensor | Get-Trigger | select * | Format-Table -AutoSize -Wrap | Export-Csv -Path 'C:\Users\austin\Desktop\prtg.csv'

Any help you can give would be greatly appreciated!


Article Comments

Hello Austin,

According to the documentation, the Get-Sensor Object holds the property name. This property is getting lost while piping two "Get-X" in a row here.

So it will be cumbersome to put this in a PS one liner. So you need to get the names from the first get command and the triggers from the second one and then aggregate them for the table output.

Hope this helps you to continue the task. Please bear with us that we cannot provide a final version of such specific queries regarding customizations in our Tech Support.

Best regards,
Felix


Apr, 2022 - Permalink