Monday, November 5, 2012

# script # work

Shell Scrip to Monitor Process and Script Availability


SHELL SCRIPT TO MONITOR PROCESS AVAILABILITY

The script does the following 4 things

  •  checks if the script is running; displays time-stamped result into /var/log/messages
  • checks if the script is not running; displays time-stamped result into /var/log/messages
  • checks if the process is running; displays time-stamped result into /var/log/messages
  • checks if the process is not running; displays time-stamped result into /var/log/messages



You may replace the $SERVICE to any other process running on the server. To add this to crontab to run at 1 min interval use the following syntax

* * * * * /usr/local/bin/

Sample outputs


No comments:

Post a Comment