About: keepalive

About keepalive: What Is It?

The keepalive script and related status/restart scripts encompass a very simple methodology: automation.What does it do?
Basically, the keepalive script is a simple daemon that runs on a UNIX host.� It monitors processes and takes the appropriate action when it determines that a process needs to be restarted.

How does it do it?
The keepalive script is simple.� It’s written in PERL as a daemon which periodically will execute all of the scripts in the keepalive.d directory that start with the letter S followed by a number.� It calls each of those scripts with the “status” option, and the script will check the state of whatever process it was written for, and return a 1 (state is ok) or a 0 (state is bad).

If the keepalive daemon gets a state of 0 (state is bad), it will execute that same script with the “restart” option, and, shortly thereafter, it will check the process status again.� It will continue to do this one more time until it gives up, logs an error, sends an email notification (if so configured), and goes on to the next process.

Where to go from here?
It is a simple design.� I doubt anything of the codebase will ever really change.� However, the scripts in the keepalive.d directory will change depending upon what you are trying to monitor and how you wish to restart it.

Restart/status script submissions are more than welcome!� I will definitely post any submitted scripts!

Is this Yet-Another-Monitoring-Tool?

In some sense, yes, it is. You have tools like Big Brother (which I have never, ever, been fond of because of its need for both a client and a server, but it is a good application) and Nagios (my personal favorite) which provide similar services. However, this script provides a stand-alone method for monitoring services and automating the way things are reacted upon. It is a simple setup, very easy to get it up and going, and extremely easy to extend. Is this good for large scale installations? I doubt it. But for those situations where you have a few systems that have critical services, this application is an excellent tool to have in your toolbox.