LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 10:00 AM   #1
LittleMaster
Member
 
Registered: Jun 2012
Posts: 121
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, 10:20 AM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
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 10:22 AM.
 
Old 06-23-2014, 10:53 AM   #3
LittleMaster
Member
 
Registered: Jun 2012
Posts: 121

Original Poster
Blog Entries: 1

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 10:55 AM.
 
Old 06-24-2014, 06:24 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:55 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