sending a mail to a mail client


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers sending a mail to a mail client
# 1  
Old 11-18-2002
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  
Old 11-18-2002
This question looks familiar. Did you do a search of the site. I'm pretty sure I heard this one before...
# 3  
Old 11-18-2002
You can use something along the lines of :

Code:
mail -s "Grep Alert!" joe@blow.com < /export/home/oracle/scripts/prodasap.log

# 4  
Old 11-18-2002
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  
Old 11-18-2002
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  
Old 11-18-2002
/usr/sbin/ping: unknown host mailhost

Yup, you're right.
I'll search the site and see if there's anything about this problem.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. Red Hat

Problems sending mail: Difference between Mail and Mailx?

Whats the difference between mail and mailx? I'm trying to troubleshoot a problem where I can send mail from server A with this `echo $MESSAGE | mail -s "$SUBJECT" -r $FROM $RECIPIENTS` command but executing the same command from server B throws me this error (Both servers are RHEL) ... (1 Reply)
Discussion started by: RedSpyder
1 Replies

3. UNIX for Dummies Questions & Answers

Sending mail

How can i send a mail when user login in unix ENV. How can i know present use mailID?? Moved out of Contact Us Forum - Please Do Not Post Technical Questions in Non-Technical Forum(s) (1 Reply)
Discussion started by: arun508.gatike
1 Replies

4. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

5. Shell Programming and Scripting

Stop sending mail after certain number of mail

Hi guys... I am busy writing a script to notify me via an mail if my application is down. I have done that. Now I want this script to stop sending mails after five mails were sent but the script should keep on checking the application. When the application is up again that count should be... (5 Replies)
Discussion started by: Phuti
5 Replies

6. UNIX for Dummies Questions & Answers

sending mail

i want to send an email from the unix machine to the windows machine. now windows dont have any specified folder for the mail. mail has to be sent to the email-id like abc@xyz.com unix machine itself can not directly send mail. it has to be transferred via mail server. (11 Replies)
Discussion started by: parmeet
11 Replies

7. Solaris

how to forward mail in /var/mail/username to external mail

Dear All, Now I use solaris 10 and I try to forward mail from /var/mail/username to their external mail so what should I do? thank u in advance (2 Replies)
Discussion started by: unitipon
2 Replies

8. HP-UX

hp ux not sending mail

Hi.. In Hp ux box,, mails are not being sent. they are getting queued up in mail queue. (3 Replies)
Discussion started by: kkhan
3 Replies

9. UNIX for Dummies Questions & Answers

Sending Mail

Please help me out i want to know how to send email from unix machine to any email-id. mail to be sent is web based mail. (1 Reply)
Discussion started by: parmeet
1 Replies

10. UNIX for Dummies Questions & Answers

e-mail client supporting HTTP mail servers

Hi all I want to know, is there any e-mail client in linux which supports HTTP mail servers. i am using fedora2. as far as investigated or tried I only find POP or IMAP mail server configuration in mozilla mail, ximian and there were no option such as HTTP. I can easily see my e-mail while i am... (0 Replies)
Discussion started by: babayeve
0 Replies
Login or Register to Ask a Question