Emails myself when a process dies
Hallo,
First I just wanna say that LQ is THE BEST Linux forums on the whole WWW... If I had unlimited money, I would donate no question at all! OKej, now my question. How do I mail myself if a certain process dies on my server? My mail server is with Google Apps. Thanks! |
Not enough detail. Process on which server? What is it running? What's it's OS? And then your email ISP is Google Apps?
Without enough detail to really know, I might suggest a cron job that runs every few minutes and checks to see if that process is running. If it is not, use a command line email such as mailx to send a mail to your address. Of course, your server needs to be configured so that it can do that. |
The absolute easiest way would be to launch the process wrapped into a shell script, like this one:
Code:
#!/bin/sh |
Say I have a process called PROCESS1 with a PID of 99999.
When It dies a email is sent to me. I use Google Apps. Also, I use webmin... any easy ways? |
Quote:
easy way is what i92guboj quoted above or some sort of shell or perl script that checks every so minutes and if it doesnt find a process that matches a name - then sends an alert. best way is set up some sort of monitoring system. nagios, zabbix, open nms, there is a big choice. |
All times are GMT -5. The time now is 03:18 AM. |