Created
November 24, 2010 23:58
-
-
Save davidtolsma/714662 to your computer and use it in GitHub Desktop.
Command run in conjunction with monitor_process utility to email users when a process is down
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/ksh -f | |
script_name=`basename $0` | |
process_name=$1 | |
machine_name=$2 | |
# Must pass two arguments only | |
# checking for it here | |
if [[ $# != "2" ]]; then | |
clear | |
print '\nUsage: '$script_name' <process_name> <machine_name> ' | |
print 'Example: '$script_name' iman_supervisor sgzaata1' | |
print '\n' | |
# can't go on so i'll exit | |
exit | |
fi | |
# usage: $script_name process_name $machine_name | |
echo $process_name "process is down on $machine_name" | \ | |
mailx -s "*****$process_name IS DOWN!!!" \ | |
[email protected] [email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment