Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

forwarding entries in /var/adm/messages file to email address

Status
Not open for further replies.

stevenriz

IS-IT--Management
May 21, 2001
1,069
Would like to forward new entries in the /car/adm/messages file to an email address. I thought I knew how to do this but it isn't working. Any thoughts? Thanks!
Steve
 
I am reading aroung the internet and seeing that it might not be possible by default but I am thinking if we modify the syslog.conf file. Wherever we see this....

user.err /var/adm/messages

add something like this right below it....
user.err root

Then forward all root email to another email address such as a pager if certain conditions apply (kernel panic etc)...

Thoughts?
 
Just a thought. Do you realize when you have device failures, it will stream to that log file? I mean, lots of messages, especially for hard drive errors. Do you really want a text message for any of that? If you really wanted it, you could tail the log file as a file handler in perl, and then pump it into an email for every message you recieve.

___________________________________
[morse]--... ...--[/morse], Eric.
 
I thought I would send the emails to a mail server then upon certain terms failure, overheat etc I would then send only those to my pager. Then once in a while clean out that particular email account.
 
if I edit syslog.conf, is there anything I need to restart in order for the server to see the changes?
 
To take new config you restart syslogd service.

Aonther Simple way:
Run a script thru cron every 5 min- say to check for new entries in messages file, if found send these new entries in a mail.
I hope one will be intend to receive only critical/error alerts .... so do it accordingly....

-sbs
 
what would this sort of script look like do you think? I am not much of a scripter...
 
Hi stevenriz,
Hope you know shell scripts. Use simple commands like cp, diff, egrep, mail etc.
Tell me which portion you didn't understand?
 
ummm errr never wrote scripts other then cp and executing things. never did diff or egrep using a script.... We do have a guy here that is good at scripting I could ask if it is a lot to ask....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top