LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need help to monitor Timestamp rotation of logfile (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-to-monitor-timestamp-rotation-of-logfile-4175508893/)

LittleMaster 06-23-2014 10:00 AM

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

JeremyBoden 06-23-2014 10:20 AM

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?

LittleMaster 06-23-2014 10:53 AM

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
}

chrism01 06-24-2014 06:24 AM

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.


All times are GMT -5. The time now is 11:35 PM.