Saturn Technopark :: » Keepalive

Portfolio


Keepalive

Nothing too big to brag about, but in short this is a shell script designed for keeping a watch on running processes. It depends on cron to invoke itself. It checks for dead processes and tries to bring them up while sending a notification to a configured email address.

Was got inspired by a similar perl script, keepalive. But the difference is that this does not need perl. Though it does depend on other things like cron, sed, ps, hostname, sendmail, which, test, grep and awk.

If any body is creating config files, please send it to me at jijutm at gmail dot com. Which will published here in time, with due reference to the authors.

Highlights

  • Simple
  • Extensible
  • Fast and lightweight
  • Will run on bare linux

The process monitoring is defined in the Sxxfoo file. Though the naming does not have any significance other than the order of execution. Now the sample in download is configured to check a squid process which is listed as squid in ps aux output, and running as root. The init script which takes start/stop as argument to control the daemon is also configured. The script is made executable with chmod +x. For configuring more services to be monitored, the appropriate config files need to be created. Testers, please make sure you configure an accessible email in the notify_address in keepalive, the main executable. Freshmeat testers gave me the hell by testing this, with out changing the notify_address.

Downloads