LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-23-2014, 11:00 AM   #1
LittleMaster
Member
 
Registered: Jun 2012
Posts: 100
Blog Entries: 1

Rep: Reputation: Disabled
Need help to monitor Timestamp rotation of logfile


Hi All,
Need help to monitor Timestamp rotation of logfile .I have around 100+ Linux server many of the server i could find logs are not getting rotated fine .Kindly any one help me whether its possible to monitor log rotation

Regard
LittleMaster
 
Old 06-23-2014, 11:20 AM   #2
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 939

Rep: Reputation: 174Reputation: 174
Don't know what distro you are using?
Ubuntu (and others) seems to use anacron - which runs logrotate.
My /etc/logrotate.d/rsyslog contains (in part)
Code:
/var/log/syslog
{
	rotate 7
	daily
	missingok
	notifempty
	delaycompress
	compress
	postrotate
		invoke-rc.d rsyslog rotate > /dev/null
	endscript
}
It's quite reliable.

Presumably it would be possible to modify this to send you an email - if necessary?

Last edited by JeremyBoden; 06-23-2014 at 11:22 AM.
 
Old 06-23-2014, 11:53 AM   #3
LittleMaster
Member
 
Registered: Jun 2012
Posts: 100
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Im using Redhat 5.

My logrotate looks like below

/var/log/tcp.log /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

Last edited by LittleMaster; 06-23-2014 at 11:55 AM.
 
Old 06-24-2014, 07:24 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
You could put a job in cron to check and eg email you if logrotation goes wrong.
You really need to look into logfiles to see what's happening and also try running the logrotate manually and see what happens.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
trying to create shell script to monitor logfile size and email an alert message cat555 Programming 3 11-13-2008 02:59 AM
Shell scripting: Print output to logfile, error to logfile & screen stefanlasiewski Programming 18 05-22-2008 01:47 PM
Script for Logfile Rotation....help Kjell Persson Linux - Newbie 1 03-18-2006 10:09 PM
Monitor rotation mdkusr Linux - Hardware 1 01-12-2006 02:57 PM
What is a good logfile scanner/tool to help monitor logfiles? jdruin Linux - Security 2 11-20-2003 11:44 PM


All times are GMT -5. The time now is 04:19 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration