Operating System - HP-UX
1834812 Members
2367 Online
110070 Solutions
New Discussion

Configure syslogd to send messages by mail.

 
SOLVED
Go to solution
Please remove this user
Occasional Contributor

Configure syslogd to send messages by mail.

Hi all,

I?d like to know if is possible to configure syslogd to send "alert" and "emerg" messages by e-mail.

Thanks


5 REPLIES 5
Carlos Fernandez Riera
Honored Contributor

Re: Configure syslogd to send messages by mail.

It is easy to mail to a user on the box, its is easy to send alert to another syslogd in other box.

An untested solution :

configure aliases on mail and syslogd.conf
syslogd.conf
*.alert root,eric,kridle,alerts


aliases:


alerts: mymail@maycompany
unsupported
James R. Ferguson
Acclaimed Contributor
Solution

Re: Configure syslogd to send messages by mail.

Alex:

The syslogd daamon can direct messages to a file, terminals, or another host's syslogd. You could write your own script to read the syslog file of interest and mail you the notification of the events of your choice.

...JRF...
Rita C Workman
Honored Contributor

Re: Configure syslogd to send messages by mail.

Yes you can do this by adding the email address you want the messages sent to on the line that says alert or warn in your /etc/syslog.conf file.

You then need to stop the syslogd and restart it.
/usr/sbin/syslogd stop ~.../syslogd /start

You may want to read up on this at the syslogd manpage.

/rcw
Kofi ARTHIABAH
Honored Contributor

Re: Configure syslogd to send messages by mail.

I do not believe that the version of syslogd that comes with HPUX supports named pipes and therefore the obvious solution of |/usr/bin/mail would not work.

However, I would recommend using something like swatch:
http://www.stanford.edu/~atkins/swatch/
which monitors log files and carries out an action ( such as mail you, or page you etc.)

BTW: if something is an *.emerg - is it not possible that mail does not even get out?

good luck
nothing wrong with me that a few lines of code cannot fix!
nnf97
Regular Advisor

Re: Configure syslogd to send messages by mail.

You would have to write your own script to parse the syslog.log (or whatever other file that you have defined for syslogd output) file and mail out based on the contents of that file.

Regards,
Nabeel
Live Free or Die (New Hampshire)