The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-06-2006
heprox heprox is offline
Registered User
  
 

Join Date: Jul 2005
Posts: 32
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
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0