The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sending mail parmeet UNIX for Dummies Questions & Answers 11 05-13-2009 03:37 AM
hp ux not sending mail kkhan HP-UX 3 01-31-2008 11:27 PM
help on sending mail in ksh ting123 UNIX for Dummies Questions & Answers 2 04-05-2006 07:35 PM
e-mail client supporting HTTP mail servers babayeve UNIX for Dummies Questions & Answers 0 05-21-2005 03:10 AM
sending mail mskarica UNIX for Advanced & Expert Users 3 04-12-2005 08:59 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-18-2002
solaris73 solaris73 is offline
Registered User
  
 

Join Date: Nov 2002
Posts: 3
sending a mail to a mail client

Hi everyone!

I'm trying to create a database monitoring script that reads an alert file and sends an error message if it can 'grep' a particular string.

Is there a way to send this message to a mail client using SMTP?

Even better, is there any place on this site that has these kinds of scripts?

I hope i'm not repeating questions that have already been answered...

Here is the script i'm creating. It's very simple, cron is executing it every minute and simnce i can't have a window always open due to timeout, i'd like to have the results mailed.

This is bash, by the way, under Solaris 5.8

tail /opt/oracle/admin/prodasap/bdump/alert_prodasap.log | grep ORA > /export/home/oracle/scripts/prodasap.log

if [ -s /export/home/oracle/scripts/prodasap.log ]
then
echo "Oracle message detected in alert log file" > /export/home/oracle/scripts/prodasap.log.bak
fi

Last edited by solaris73; 11-18-2002 at 11:20 AM..
  #2 (permalink)  
Old 11-18-2002
djtrippin's Avatar
djtrippin djtrippin is offline
Registered User
  
 

Join Date: Sep 2001
Location: michigan
Posts: 79
This question looks familiar. Did you do a search of the site. I'm pretty sure I heard this one before...
  #3 (permalink)  
Old 11-18-2002
auswipe's Avatar
auswipe auswipe is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2001
Location: Wide Awake Wylie, Texas
Posts: 535
You can use something along the lines of :

Code:
mail -s "Grep Alert!" joe@blow.com < /export/home/oracle/scripts/prodasap.log
  #4 (permalink)  
Old 11-18-2002
solaris73 solaris73 is offline
Registered User
  
 

Join Date: Nov 2002
Posts: 3
I've searched other posts, but didn't find anything i could work with, really.

And mail -s "Grep Alert!" joe@blow.com < /export/home/oracle/scripts/prodasap.log didn't quite work.

Maybe i didn't explain myself properly. I need this message to be sent to a windows client, like netscape. Can this be accomplished with the mail command?

Ok, i'm reading the oracle mail file and i see this:

The original message was received at Mon, 18 Nov 2002 16:27:01 GMT
from oracle@localhost

----- The following addresses had permanent fatal errors -----
matrix3773@yahoo.com

----- Transcript of session follows -----
550 5.1.2 matrix3773@yahoo.com... Host unknown (Name server: mailhost.: host not found)

Is this the result of a misconfigured mail serer?

Last edited by solaris73; 11-18-2002 at 12:31 PM..
  #5 (permalink)  
Old 11-18-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Quote:
Originally posted by solaris73
----- The following addresses had permanent fatal errors -----
matrix3773@yahoo.com

----- Transcript of session follows -----
550 5.1.2 matrix3773@yahoo.com... Host unknown (Name server: mailhost.: host not found)

Is this the result of a misconfigured mail serer?
Your Solaris box is configured to send non-local mail to a box called "mailhost". For it to do that, it needs to use DNS or whatever else you're using to convert a hostname to an IP address. This is where it is failing.

From your Solaris box, type "/usr/sbin/ping mailhost". You will probably get "unknown host". You need to fix that.
  #6 (permalink)  
Old 11-18-2002
solaris73 solaris73 is offline
Registered User
  
 

Join Date: Nov 2002
Posts: 3
/usr/sbin/ping: unknown host mailhost

Yup, you're right.
I'll search the site and see if there's anything about this problem.
Sponsored Links
Closed Thread

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 11:34 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