"Mailx" command on solaris.

Friends,

I have some doubt in 搈ailx?Command.

My requirement is: I扐ll included "mailx" command in some scripts for Critical warning msg or space Check scripts, that will send a mail to particular domain user. For example if /var mount point above 80% that script will send a message to particular group or me.

1.How this mailx command works?

2.My previous admin configured the mailx command in the servers.Now the mailx command is working for me. its send a msg to particular group. But its sending through our Milwaki server(172.20.47.106).

I don抰 want to send mail through milwaki server unsessary. I have Lotus mail server (172.22.14.202) in pune(INDIA) itself. Where should I have to specify this ipaddress in Solaris box?

3.I抦 not specifying any ipaddress, its automatically sending through (172.20.47.106). I can see it on /var/adm/messages.

4.Is their any files to specify the mail server information?

Snap shot

# tail /var/adm/messages

Nov 6 18:24:48 sendmail[13155]: [ID 801593 mail.info] kA6Csj7X013155:

to=gnanavel.sekar@test.com ctladdr=d07563 (214/1), delay=00:00:03, xdelay

=00:00:03, mailer=relay, pri=30089, relay=gdthor [172.20.47.106], dsn=2.0.0, sta

t=Sent (Message accepted for delivery)

I appreciate for your valuable suggestions .

Thanks

GnanavelSekhar

gnanavel.sekhar@rediffmail.com

[1423 byte] By [Sun.Gnanavel] at [2007-11-26 11:16:12]
# 1

I do something similar to what you want on my Solaris 9 server. Here's how I use mailx to notify me when the server reboots:

echo " "`uname -n`" just ["`/usr/bin/date`"] rebooted" | mailx -s "Subject: "`uname -n`" reboot detected" me@example.org

You should be able to adapt the basic concept above for your needs.

To send the email to 172.22.14.202 rather than 172.20.47.106 try explicitly address the mail to the user at 172.22.14.202 you wish to receive the mail. For instance instead of addressing the email to you@example.com (where example.com is 172.20.47.106) address it to you@lotus.example.com (where lotus.example.com is 172.22.14.202) Hope that helps you.

bosconet at 2007-7-7 3:31:18 > top of Java-index,General,Sys Admin Best Practices...