Sponsored Content
Top Forums Shell Programming and Scripting file generation and mail notification Post 302228722 by otheus on Monday 25th of August 2008 09:14:29 AM
Old 08-25-2008
Okay, sounds simple enough. Put in /usr/local/bin/XXXX and associated files in /usr/local/lib/

Code:
#!/bin/sh

LOGDIR=<path where logfiles are kept>
LOGFILE=<name of logfile>
SENDMAIL=/usr/sbin/sendmail
EMAIL_ON_SUCCEED=/usr/local/lib/email-success.txt
EMAIL_ON_FAIL=/usr/local/lib/email-fail.txt

if test -f "$LOGDIR/$LOGFILE" ; then
   cat $EMAIL_ON_SUCCEED | $SENDMAIL -t
else 
   cat $EMAIL_ON_FAIL | $SENDMAIL -t
fi

The Email files must be formatted as follows, where ???? is whatever makes sense for you:
Code:
From: ????
To: ????
Subject: The Oracle process ????

Hello, the oracle process ????

That's it, really, unless there's something I missed.
 

5 More Discussions You Might Find Interesting

1. AIX

notification mail when password expired

Hallo, can anybody help me with my issue? Iīd like to know if it is possible to send me a mail (to @mail.com for example) when some account password will expired? eg. few days ago of this expiration. We donīt use this account every day, it is used for DB2 and DB2 has problem every 90īs day because... (2 Replies)
Discussion started by: JiriVenera
2 Replies

2. UNIX for Dummies Questions & Answers

mail notification on file generation

I'm very new to unix. I need help in writing a shell script that will automatically take output file from a particular folder from a server and if the file is generated send email notifications to certain group of ppl and if it is not generated send a mail wid error msg.. can any1 help me on... (2 Replies)
Discussion started by: anzie.sharma
2 Replies

3. Infrastructure Monitoring

Mail Notification in nagios

Hi guys, I have configured Nagios in My Ubuntu8.4 machine through Quickstart Guide, All things are working fine. Now i want to get Services Notification mails on my personal Email-id,what configuration is needed to get the mails,any assistance would be appreciable. Thanks in advance. (3 Replies)
Discussion started by: daya.pandit
3 Replies

4. Shell Programming and Scripting

AIX mail notification

plzzz help me, I want to send emails for exchange group members when the used file-system % gets more than 90%, this notification must include df -g, netstat -i,and errpt with the hostname thx in advance (0 Replies)
Discussion started by: majd_ece
0 Replies

5. Shell Programming and Scripting

Script for sending notification mail

hi all, needed a script to send a notfication mail if the specified folder had the copy of the files that are older than 15 days i.ee for example my folder name is SAi and the files are as follows sai.txt copyofsai.txt copyofcopyofsai.txt hemanth.txt copyofcopyofhemanth.txt... (4 Replies)
Discussion started by: hemanthsaikumar
4 Replies
biff(1) 						      General Commands Manual							   biff(1)

NAME
biff - Notifies users when mail arrives SYNOPSIS
biff [y | n] DESCRIPTION
The biff command informs the system whether you want to be notified when mail arrives during the current terminal session. The following command enables notification: biff y The following command disables notification: biff n When mail notification is enabled, the From: and Subject: header lines and up to the first five lines of the message are displayed. The total display is 560 characters, or seven lines terminated by newline characters, whichever occurs first. The biff y command is often included in the $HOME/.login or $HOME/.profile file to be executed each time you log in. The biff command operates asynchronously. For synchronous notification, use the MAIL variable of sh or ksh, or the mail variable of csh. EXAMPLES
To display the current setting, enter: biff To be notified during the current terminal session whenever mail arrives, enter the following in your $HOME/.login or $HOME/.profile file: biff y FILES
Read by login shell (after login. User profile. SEE ALSO
Commands: comsat(8), csh(1), ksh(1), mail(1), mailx(1), Bourne Shell sh(1b), POSIX Shell sh(1p) biff(1)
All times are GMT -4. The time now is 01:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy