How to check a Windows Process is running on a remote computer with WMI
Checking for a running process on a remote Windows machine is an ideal way to check availability of essential production services. Using Windows Management Instrumentation (WMI) this is straight forward, and can be quickly set up as a DBTuna custom command alert.
The following steps guide you through this process:
2. You can call it by running cscript.exe check_proc.vbs servername username password which will return the list of running processes from the remote server e.g.
3. Once you know the name of the process you are looking for, then you can call the script with an additional parameter of the process name.
e.g.
cscript.exe check_proc servername username password CarboniteService.exe
This command would check for the Carbonite backup process running on the remote machine.
4. Create a new Custom Command Alert within DBTuna/Alerts e.g.
N.B. Please note that the cscript command has a //Nologo parameter too, which means that if the process is found to be running then it returns nothing, but if it is missing then it triggers the alert. Make sure you check that you can call the script from the command line ok before creating the alert. Also, if you have any directories containing spaces (Program Files etc.) then you will need to double quote them.