Discussion Locked

Process checker / program launcher

0 helpful
11 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have some Windows NT systems with a homegrown application that we need to make sure is running at all times. The program cannot be installed as a service, as it will not work properly. What I am looking for is a program/service/script I can use that can check to see if program xyz.exe is running. Have it check every 15 minutes or so. If the program is running, everything will be good. If program xyz.exe is not running, I need to it launch it before it goes back to sleep.

11 replies

by joseph moore

Here is what you can do:
Run Performance Monitor on an admin workstation and have it monitor your NT server running this "homegrown application".
Click on the Alert icon to add a new alert.
Click the + button to add.
When the window comes up, click the button by the Computer text box, and browse to the machine running XYZ.exe
Then, choose Process -->Virtual Bytes, and choose your XYZ.EXE application process.
In the Alert If section, choose Under, and put 10 in the box.
Then go to the Run Program On Alert box and put in the name and path of a BAT file you are gonna make on this admin workstation (say, C:\noXYZ.BAT)
Click Add.
Now, minimize Performance MOnitor.

It will check the Virtual Bytes used by your application every few seconds. IF the number of bytes vanished (i.e. IF XYZ.EXE crashes), it will trigger the BAT file.

Now make a BAT file with the name you gave the alert and put in this:

net send /domain:yourdomainname XYZ.EXE Application Has Failed! Alert! Alert!Warning! Danger!

In place of yourdomainname, put the name of your domain.

Then, when XYZ.exe crashes, a broadcast message will go out to your domain with the alert message. It will popup on every workstation!
It might be overkill. You couldput a user name or specific workstation name as the message recipient. Just look up the syntax for Net Send for details.

Hope this helps.

by oskiller

This is a good idea, and under other conditions might work. Unfortunately, since I would need it to relaunch the application if it closed, I cannot utilize a remote perfmon alert. I cannot leave perfmon running on the system in question either - it causes problems with another application on the system.

I do appreciate the idea though.

by oskiller

Interesting idea, but if someone closes perfmon, it falls through the cracks. Also, if the program is closed and no one reopens it, it will cause problems. I might be able to manuever this in another way, so I'm not rejecting the idea yet.

by joseph moore

Ok, then how about this:
Run the Alert like I suggested above. But instead of the BAT file the Alert will trigger just doing a Net Send, have the BAT do 2 things.
First, have the BAT do the Net Send, so you know what is going on.
Then have it doa CALL command, and call the crashed "homegrown application".
So, the BAT would look like this:

Net Send /domain:yourdomain Homegrown Appliction aborted. It is now restarting.
CALL "c:\program files\homegrown application\app.exe"

Use the "" around the directory structure to support the spaces in the directory names. BAT files do not support the extended file names without "".

And, I think run this Alert on the server that runs the homegrown application. It won't take up very much resources.

by oskiller

I like the idea, but as I stated before, and maybe not clearly, I cannot run perfomance monitor on the system where the application runs. The other key application on the system will crash and burn if perfmon is run.

Server A - need to keep XYZ.exe running, and it cannot be a service. Perfmon cannot be used as it crashes ABC.exe which also needs to run constantly.

Hope this explains it better. I do appreciate the idea though.

by oskiller

Still looking for ideas...has to be something that will ensure xyz.exe is running, and if it is not running, it will start it. The application CANNOT be run as a service. There should be a way to automate this checking.

by oskiller

Point value changed by question poster. As a reminder - this should be something that can run in the background and require no user intervention.

by oskiller

I heard some interesting ideas from a number of different places. Someone here was able to write a quick VB program to do the dirty work. Thanks for the suggestions though..

This discussion is closed to new replies.