Hi Sam,
The API calls made by Get-NotificationTrigger do not return that information, however this can be achieved very easily with a bit of PowerShell magic
C:\> $triggers = Get-Probe | foreach { $_ | Get-Trigger | Add-Member Name $_.Name -PassThru }
C:\> $triggers | fl
Name : Local Probe
ObjectId : 1
ParentId : 0
Inherited : True
Type : State
TypeName : State Trigger
SubId : 1
Latency : 600
Channel :
Unit :
OnNotificationAction : Ticket Notification
OffNotificationAction : None
Threshold : Down
Condition : Equals
EscalationLatency : 900
EscalationNotificationAction : Ticket Notification
RepeatInterval : 0
Instead of piping Get-Probe straight into Get-Trigger, we pipe it into a foreach cmdlet that performs three functions
1. Retrieves all triggers from the input Probe
2. Adds a new property "Name" to each trigger containing the name of the input Probe
3. Writes the updated input Probe to the pipeline
You will also find an example showing this exact technique on the Channels page of the wiki, showing how the name of each Sensor can be added to each channel
Regards,
lordmilko
Add comment