syslog.log and log rotation - what is going on???

Answered Question
Jul 26th, 2010
User Badges:

I am sure this has been asked before but in CW syslog.log just keeps on getting bigger and bigger. I have set the log rotation parameters to 2GB with no backups. The file is currently 2.5G (it can get upto 10G before we notice problems with CW and have to manually delete the file).


From some of the threads I have read on this topic at CSC it seems once we have configured the maximum file size we then also have to set a periodical surge policy to empty the file - is this correct? If so, then this two stage procedure seems counter productive. Isn't the whole point of specifying a file size is that once it reaches that limit the contents are cleared and the counter reset to zero hence the name 'log rotation'. And if we have to set a periodical surge policy seperately then the file size limit should become irrelevant because the file is being surged regardless of its current size. Am I right or am I missing something?


We are using LMS 3.2.

Correct Answer by Joe Clarke about 6 years 8 months ago

Log rotation alone should take care of syslog.log.  Post the NMSROOT/objects/logrot/logrot.conf file, and the output of the following command when the syslog.log file is above your configured threshold:


NMSROOT/bin/perl NMSROOT/bin/logrot.pl -v

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
Joe Clarke Mon, 07/26/2010 - 09:47
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

Log rotation alone should take care of syslog.log.  Post the NMSROOT/objects/logrot/logrot.conf file, and the output of the following command when the syslog.log file is above your configured threshold:


NMSROOT/bin/perl NMSROOT/bin/logrot.pl -v

Joe Clarke Thu, 07/29/2010 - 20:57
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

According to this syslog.log was rotated properly.  After running it, it should have been pretty close to 0 bytes, and a new archive was created in D:\PROGRA~1\CSCOpx\log (e.g. syslog.log.0.gz).

vineetsheoran Tue, 08/17/2010 - 20:34
User Badges:

Hi Joe,


Thanks for your help on this one. Running the perl script did clear the log and the file is now again building up slowly but still within the maximum file size limit specified which is good but few questions though:

1. What specific part of the perl script causes the syslog.log to flush its content?

2. Do we have to run the perl script manually everytime syslog.log exceeds its limit?


Thanks,

Vineet


P.S. Apologies for the late response.

Joe Clarke Fri, 08/20/2010 - 21:39
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

The Perl script has code which truncates the file.  You need to schedule logrot.pl to run.  On Windows, this is done with the DOS AT command.  If you are using LMS 3.2, you can schedule logrot to run in the GUI under Common Services > Server > Admin > Log Rotation.

Actions

This Discussion

Related Content