![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script to send a file in email | dr46014 | Shell Programming and Scripting | 2 | 12-10-2007 08:38 AM |
| How to write a shell script to send an email to an id | madhumathikv | Shell Programming and Scripting | 4 | 10-23-2007 06:19 PM |
| Script to check running processes on remote server. | amitsayshii | Shell Programming and Scripting | 5 | 10-06-2006 04:43 AM |
| check the status and send an email with status | isingh786 | Shell Programming and Scripting | 3 | 12-29-2005 07:22 PM |
| script that will send and email attachment | davels | Shell Programming and Scripting | 2 | 01-01-2005 05:44 AM |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
||||
|
Script to check processes and send an email
I searched through the forum and couldn't quite find what I was looking for. I have a script that looks for a process "DW" to be running. If it is not it will email a notice to an account. I would like to add the functionality to have it also email a seperate notice if there is more that one of the "DW" processes running at the same time. The script looks like:
Code:
#!/bin/ksh
DATE=$(date +%m%d%y)
TIME=$(date +%H%M)
RECIPIENT=test@mydomain.com
DPID=$(ps -ef | grep dw | grep -v grep)
if [ "${DPID}" = "" ]
then
echo "The data warehouse manager for DB $ORACLE is down at $TIME on $DATE" | mail -s "$ORACLEID DW is down" $RECIPIENT
fi
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|