Skip to content

Instantly share code, notes, and snippets.

@davidtolsma
Created November 24, 2010 23:58
Show Gist options
  • Save davidtolsma/714662 to your computer and use it in GitHub Desktop.
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
#! /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!!!" \
me@here.com me@here.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment