Operating System - HP-UX
1835807 Members
2476 Online
110085 Solutions
New Discussion

Re: How to email a message automatically in HP-UX

 
Nagarathinam
Advisor

How to email a message automatically in HP-UX

Dear Experts,
I like to have my system posted the status at periodic intervals to my email-id.
Some one can help me how it can be configured in HP-9000 R380 with HP-UX 11.00 ?

Thanks in advance

A.Nagarathinam
9 REPLIES 9
Scott Van Kalken
Esteemed Contributor

Re: How to email a message automatically in HP-UX

you can use mailx

for example:

uptime | mailx -s "uptime" you@youremail.com


Trond Haugen
Honored Contributor

Re: How to email a message automatically in HP-UX

Depending on what you want to send you could set up a cron job like this:
top -d1 | mailx -s "top output" YOUR-MAIL-ADDRESS
Or if you already have the data in a file:
mailx -s "System stats" YOUR-MAIL-ADDRESS < /tmp/file

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Michael Tully
Honored Contributor

Re: How to email a message automatically in HP-UX

You can run a system command like 'uptime' out of cron say every 30 minutes.

0,30 * * * * /usr/bin/uptime | elm -s "System State" myname@domain.com

HTH
~Michael~
Anyone for a Mutiny ?
Nagarathinam
Advisor

Re: How to email a message automatically in HP-UX

Thank you all for your instant reply.

But When I try this on my machine I receive the following.

Apr 8 02:58:07 Primary sendmail[15962] unable to qualify my own domain name (Primary)

NIS map mail.address specified, But NIS not running.

What should I do to elimate this message?

Suggestions are welcome.

A.Nagarathinam
Deepak Extross
Honored Contributor

Re: How to email a message automatically in HP-UX

You can setup a cron job to use mailx or sendmail. In case you have the system status in a file, you can attach it using uuencode.
See this thread for details:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x84cf28e43106d6118ff40090279cd0f9,00.html
Wodisch
Honored Contributor

Re: How to email a message automatically in HP-UX

Hi,

you have to configure your local sendmail to permit it to work. You perhaps will need to modify your hosts file and DNS-client setup, in addition:

/etc/mail/sendmail.cf
/etc/mail/sendmail.cw
/etc/aliases
/etc/hosts
/etc/resolv.conf
/etc/nsswitch.conf
/etc/rc.config.d/mailservs

HTH,
Wodisch

Simeon Fox
Advisor

Re: How to email a message automatically in HP-UX

When I enabled this on my system, hp told me to configure:

/etc/resolv.conf
/etc/nsswitch.conf

You will also need to register your unix server on the DNS

I use a sendmail command in conjuciton with a cron script to post filesystem space alerts to my Outlook Inbox - it works very well.
Wilmar Ricio
Occasional Advisor

Re: How to email a message automatically in HP-UX

Add this to your /etc/hosts
exchange_server_ip_address company.com

Add this to your /etc/sendmail.cf under
#who I masquerade as (null for no masquer..)
DMcompany.com

hope this help.
Jeff Schussele
Honored Contributor

Re: How to email a message automatically in HP-UX

Hi A.,

Make sure in your /etc/nsswitch.conf file that the following lines are as such:

aliases: files
sendmailvars: files

I suspect you have NIS specified in those lines.
As to your "Unable to qualify my own domain name" situation make sure you have the fully qualified doamin name EX: myhost.mydoamin.com
entry as an alias in your /etc/hosts file - just separate tha short hostname & the long with some white space..
This & the earlier posts on setting up sendmail - especially setting the relay host should get you going.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!