Run a Powershell script Alarm action

I'm trying to run a powershell script for failed jobs alarm to push to a Webhook in MS Teams. The PS works when run from both my Spotlight server and the monitored server directly from Powershell Command window but not when the alarm is triggered? WinRM is running on the monitored server and the account used has access to the server also. Any tips?

Script:Invoke-RestMethod -Method post -ContentType 'Application/Json' -Body '{"text":"Hell World!"'-Uri [my Teams Channel]

Many thanks,

Steve

Parents
  • Hi Stephen,

    Have you tested the PowerShell command with the same account used for the connection being monitored in Spotlight?

    I would also look at your Spotlight logs to determine if Alarm Action rule is running when the alarm is raised, and if so, detect background errors: C:\Program Files\Quest Software\Diagnostic Server\Agent\log\Action.log

    Gita
    Spotlight Support

Reply
  • Hi Stephen,

    Have you tested the PowerShell command with the same account used for the connection being monitored in Spotlight?

    I would also look at your Spotlight logs to determine if Alarm Action rule is running when the alarm is raised, and if so, detect background errors: C:\Program Files\Quest Software\Diagnostic Server\Agent\log\Action.log

    Gita
    Spotlight Support

Children
No Data