cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

Running powershell script with advanced alert manager

I need to know if we can run a Powershell script with advanced alert manager. (I know we can but how??)

Scenario: I have set an alert for C drive , now I want My SolarWinds to clear the temp folder in C drive each time the threshold is breached for any server (for which I am, planning to write a Powershell script).

I want my Powershell to pick the affected server name from the alert triggered (like it does in service restart case).

If it is possible with some other way please share or if anyone have tried any such thing!

Thanks in Advance!

3 Replies
Level 8

Hi Aparna,


I need help with the scripting part actually, how to pass the SolarWinds variable and all that.Please share with me a sample script if you have it in your environment.

0 Kudos

Hi Sakshi,

You can do it this way

  • Write your PowerShell script and call it from a batch file from your primary polling engine
  • Go to Alert Manger
  • Navigate to Trigger Actions
  • Select execute an external program.
  • <path>\batchfile.bat "${N=SwisEntity;M=Application.Node.IP_Address}" (this variable is for a component alert, you will need to use the corresponding variable for IP_Address per alert.
0 Kudos

Try this .. create a batch file in your primary polling engine that would accept affected Node IP Address (better than caption) as an argument, have it call your powershell script in which you may pass the same IP Address so that it knows which server to clean up. From the alert action, execute an external program, you can call your batch file. Please let me know if that worked out.

0 Kudos