LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-31-2007, 12:22 PM   #1
javier_ccs
Member
 
Registered: Apr 2005
Location: Milton Keynes
Distribution: ubuntu 12.10
Posts: 90

Rep: Reputation: 15
script for logs


hello folks,

i'm trying to make a shell script that mails me when new log arrives to /var/log/auth.log

so when tail -f /var/log/messages increments its size i would receive an email with the logs....

can anyone help me? i dont want you to do it for me, just to point me in some direction....
 
Old 01-31-2007, 12:57 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You should probably have a look man pages for syslogd and syslog.conf. (man syslogd, man syslog.conf) as this allows for mailing.

I'd caution you against mailing EVERYTHING. Your messages are apt to have many things that you may wish to see in troubleshooting scenarios but wouldn't want to see all the time. For example you might want to see users that got authenticated near the time you started having issues but not all the time. You wouldn't really want all the detail all the time - you'd spend your whole day just reading the messages. If you really do want that kind of detail you'd be better off just opening up a window and running "tail -f /var/log/messages" - you'll see the messages as they add to the file and will reduce CPU load as you're not kicking off an email for every message.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
What script runs when a user logs in? GuyWhoKilledBear Slackware 6 11-27-2006 09:58 PM
how to silence script output (so I don't get so many cron logs)? BrianK Programming 2 03-01-2005 04:53 PM
Perl Script To Check Logs Crashed_Again Programming 0 11-13-2004 03:13 PM
need script to empty logs drobson Linux - General 1 06-04-2001 07:44 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration