Network Management

Test alert action: Execute External Program

This article shows you how to Test Alert action Execute External Program

First published date

10/16/2018 12:50 PM

Last published date

9/21/2020 8:50 AM

Overview

Steps to test Alert action Execute External Program.

Product section

Orion Platform

Cause

N/A

Resolution

To test SolarWinds functionality do the following:
 

Option 1 (Execute an External Program)

1. Create an alert
   Trigger condition = Node Status is equal to UP
2. On Trigger Actions do:
   Add Action = Execute an External Program
3. Create a C:\Test folder share
4. Create a CMD name it "test.cmd"
    Inside the file looks like this: net stop Spooler
5. Create a CMD name it "test2.cmd"
    Inside the file looks like this: net start Spooler

  • Network path to external program: \\<Server IP>\Test\test.cmd
  • Network path to external program: \\<Server IP>\Test\test2.cmd

Test and see if Print Spooler Stops and starts when you execute the alert trigger.

 


Option 2 (Execute an External VB Script)

1. Create an alert
   Trigger condition = Node Status is equal to UP
2. On Trigger Actions do:
   Add Action = Execute an External VB Script
3. Create a C:\Test  folder share
4. Create a VBS name it Stop.vbs.
    Inside the file looks like this: 

Option Explicit
On Error Resume Next
Public Sub StartApplication(App, WindowStyle)
dim aShell
set aShell= CreateObject("WScript.Shell")
aShell.Run App,WindowStyle
set ashell=nothing
end sub
                    
StartApplication "%SYSTEMROOT%\system32\sc.exe stop Spooler",0
on error goto 0

 

5. Create a VBS name it Start.vbs
    Inside the file looks like this: 

Option Explicit
On Error Resume Next
Public Sub StartApplication(App, WindowStyle)
dim aShell
set aShell= CreateObject("WScript.Shell")
aShell.Run App,WindowStyle
set ashell=nothing

end sub
                    
 StartApplication "%SYSTEMROOT%\system32\sc.exe start Spooler",0
 on error goto 0

 

  • Network path to external program: \\<Server IP>\Test\Stop.vbs
  • Network path to external program: \\<Server IP>\Test\Start.vbs

Test and see if Print Spooler Stops and starts when you execute the alert trigger.