System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Mail from one hp server to another ....

 
SOLVED
Go to solution
vaishakh k
Advisor

Mail from one hp server to another ....

Dear all,

How can i set in hpuxserver such that if any problem occured in database a mail should be send from that server to another hpserver which is connected with that server.

For example how can i mail the mail automatically from /var/mail/root to another server when it created.

Thanking in advance.
waiting for your response.
5 REPLIES
Steven E. Protter
Exalted Contributor
Solution

Re: Mail from one hp server to another ....

Shalom,

First thing you need to check is that the servers sendmail daemon is up and running. A server can send mail without sendmail running. It can not receive it.

vi /etc/rc.config.d/mailsvrs

See that the SENDMAIL start parameter is set to 1 for auto start. In general it is not these days.

/sbin/init.d/sendmail start

That manually starts the daemon.

Next you need simple name resolution at a minimum which can be /etc/hosts so that sendmail knows that mail addressed to server2 is supposed to go.

echo "Mail message | mailx -s "Subject" user@server2

This will be processed by sendmail and sent to the ip address that resolves server2 shortname on port 25. It will then be accepted by the server2 in this example if that resolves.

/etc/hosts resolution

192.168.0.20 server2

If /etc/resolv.conf has files as a resolution method, then the mail will travel this way.

nslookup server2
ping server2

If both tests work and the sendmail daemon is running on server2, you are in business.

Most IT shops have a mail relay server so that mail from unix servers can be routed into the actual mail system of the company, which often times is a Microsoft Exchange server.

sendmail is a demanding topic, but very fun to work with once mastered. For more information http://www.sendmail.org

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
vaishakh k
Advisor

Re: Mail from one hp server to another ....

Thank Steven,

Actually my question is,
"Is it possible to do that as if WHENEVER THE MAIL IS GENERATED in first server it should be transferred to the second one through the mail system?

If it possible what can i do for that?

Thanking in advance

vaishakh
Dennis Handly
Acclaimed Contributor

Re: Mail from one hp server to another ....

>Actually my question is,
"Is it possible to do that as if WHENEVER THE MAIL IS GENERATED in first server it should be transferred to the second one through the mail system?

Which part are you having problems with? The detection of the problem or sending the mail?

Sending mail is as SEP said:
echo "Mail message | mailx -s "Subject" user@server2

Detection of the error is left to your DBA.
vaishakh k
Advisor

Re: Mail from one hp server to another ....

Hai Dennis,

By usuing
echo "Mail message | mailx -s "Subject" user@server2

I send the mail to my second server (hostname=edb1). But after login to the second server i will not see the mail ..

can u please tell me in which path the mail will save.
After typing echo "Mail message | mailx -s "Subject" user@server2... it is showing area for message typing like,
>hai
>
>

after that how the mail will send "by clicking crtl+c"


Thanking in advance,
vaishakh.
Dennis Handly
Acclaimed Contributor

Re: Mail from one hp server to another ....

>After typing echo "Mail message | mailx -s "Subject" user@server2... it is

Oops, sorry I copied a quoting problem:
echo "Mail message" | mailx -s "Subject" user@server2

You can either echo a short message.
Otherwise you can have it read from the stdin or a file:
mailx -s "Subject" user@server2 < file
mailx -s "Subject" user@server2
message
...
.

(A single "." to terminate.)

Or a here document:
mailx -s "Subject" user@server2 <message
...
EOF

There are various interactive mailx commands.