Submit a ticketCall us

Get a crash course on Network Monitoring delivered right to your inbox
This free 7-day email course provides a primer to the philosophy, theory, and fundamental concepts involved in IT monitoring. Lessons will explain not only how to perform various monitoring tasks, but why and when you should use them. Sign up now.

Home > Success Center > Network Performance Monitor (NPM) > Test alert action: Execute External Program

Test alert action: Execute External Program

Table of contents

Updated September 9, 2016

Overview

Steps to test Alert action Execute External Program.

Environment

All NPM versions

Steps

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.

 

 

 

Last modified
22:56, 8 Sep 2016

Tags

Classifications

Public