05-14-2002
Hi Jacob,
Try something like:
numberOfProcesses=`ps -ef|grep myProcessName|grep -v grep|wc -l`
if [ $numberOfProcesses = 0 ]
then
( echo "From: missingProcesses@yourHostName"
echo "To:
yourAddress@wherever.com"
echo "Subject: myProcessName is not running"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
echo "The process is not running"
echo " "
) | /usr/lib/sendmail -i -t
fi
And schedule that little script as a cron.
Hope this helps
10 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
I have been a member for almost a year now. I have always recieved email notifications when I select "subcribe to this thread" at the bottom of posts that I reply to.
However, over the last month or so, I have not been recieving email notification of replys to posts I respond to.
I have... (6 Replies)
Discussion started by: Kelam_Magnus
6 Replies
2. UNIX for Dummies Questions & Answers
Hi.
I want to add email notification so when the my script finishes it sends out an email of the results to our team. If there are errors the subject on the email should say there were errors.
If any having idea/sample scripts pls share with me. (2 Replies)
Discussion started by: redlotus72
2 Replies
3. UNIX for Dummies Questions & Answers
In my last job someone gave me the command to put in my .profile that let me know when a job I had running in the background finished. It was a word about 5 char long. I can't remember it! (4 Replies)
Discussion started by: nkeller
4 Replies
4. Programming
Hi,
I have a requirement.
Scenario:
A parent job invokes a child job and gets killed. The child becomes orphan and gets attached to init. Child job is removed from the pid table as soon as it gets completed.
Requirement is i need the status of the child job even after the parent job is... (7 Replies)
Discussion started by: anjul_thegreat
7 Replies
5. Shell Programming and Scripting
Hey guys
Just need some help with crontab.Iam looking for a script that will alert particular user about its change through sendmail.We are using bash here.
--CoolKid (3 Replies)
Discussion started by: coolkid
3 Replies
6. Solaris
I would like to setup a Cron job to check weather X process is running or not. if it is not running then start that X process with a log message....
can any one help writing a script?
thanks (3 Replies)
Discussion started by: chandravadrevu
3 Replies
7. AIX
Hi,
I'm fairly new to Aix and am looking for some help on the following.
I have setup a cron job under root and want it to send the email once it's run to an external email address. I can get it to send the output in an email to me by using mail on the end of the crontab entry. But I would... (1 Reply)
Discussion started by: elmesy
1 Replies
8. Shell Programming and Scripting
Hello everyone,
I have a server in another country, so I would like to run a notification sound, that I can hear in my computer after a job is finished, I found so many commands, like:
COMMAND HERE
spd-say 'Done'
But I cannot hear any sound, the command line does NOT return any error,... (6 Replies)
Discussion started by: Abu Rayane
6 Replies
9. Shell Programming and Scripting
Hi All,
I need write a linux script which emails each record to the employee manager email-id which will be specified inside the file.
Each employee can have a different manager too..
file contain 200 to 300 records
Employee ID, Employee Name, Employee Email-ID, Manager, Manager... (4 Replies)
Discussion started by: tradingspecial
4 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I am getting error below when testing email. is there a way I can configure email on Solaris?
SunOS -s 5.10 Generic_147440-04 sun4u sparc SUNW,SPARC-Enterprise
echo "hello" | sendmail -v abcd
WARNING: local host name (-s) is not qualified; see cf/README: WHO AM I?
abcd... Connecting... (1 Reply)
Discussion started by: roshanbi
1 Replies