cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2015
Views
30
Helpful
13
Replies

LMS 2.6 -- Deleting old logs in syslog.log file

reyan.garcia
Level 1
Level 1

Hi,

Is there a way to delete the old logs in syslog.log file and retain the new ones? If there is, can it be done without stopping the services?

Thanks.

13 Replies 13

Joe Clarke
Cisco Employee
Cisco Employee

Yes on both counts. You can use NMSROOT\bin\logrot.pl to rotate the syslog.log file. This will truncate the file (optionally saving the old contents). More on logrot can be found in the Common Services online help. Just search for "logrot".

I've already configure the logrot tool of Ciscoworks and I set the

maximum file size to 10GB. But when I check the syslog.log file located

in c:\program files\cscopx\log\syslog.log, it is still 135GB. Please see

below screenshot for the configuration of logrot. Please advise on the

next step.

Screenshot:

C:\Program Files\CSCOpx\bin>perl logrot.pl -c

Read config successfully.

Logrot Configuration Menu

-------------------------

1. Edit variables

2. Edit log files

3. Quit and save changes

4. Quit without saving changes

Enter option: 2

Warning: No logfiles found.

a. Add logfile(s)

d. Delete logfile(s)

q. Go back

Enter option or logfile number to edit: a

Enter logfile path []: c:\program files\cscopx\log\syslog.log

Enter number of archives to keep [0]:

Enter maximum file size (in kilobytes) [1024]: 10485760

Compression extension (gz,Z,bz2): gz

Number Logfile Name Number of Archives Max Size

Compress

------------------------------------------------------------------------

-----

1. "c:\program files\cscopx\log\syslog.log" 0

10485760 gz

a. Add logfile(s)

d. Delete logfile(s)

q. Go back

Enter option or logfile number to edit: q

Logrot Configuration Menu

-------------------------

1. Edit variables

2. Edit log files

3. Quit and save changes

4. Quit without saving changes

Enter option: 3

C:\Program Files\CSCOpx\bin>

Please post the output of perl logrot.pl -v.

C:\Program Files\CSCOpx\bin>perl logrot.pl -v

Wed Nov 5 19:45:11 2008: INFO: Logfile = c:\program files\cscopx\log\syslog.log, Backup File = c:\program files\cscopx\log\syslog.log

Wed Nov 5 19:45:11 2008: INFO: Attempting to use C:\PROGRA~1\CSCOpx\bin\logrot_stat.exe to obtain logfile size.

Wed Nov 5 19:45:11 2008: INFO: Not archiving c:\program files\cscopx\log\syslog.log because it is not big enough. file size = 8001769129, conf size = 10737418240

According to this, the syslog.log file is only 7.45 GB. This might be a bug in the logrot_stat program. Please post proof of the actual byte size of this file.

Please see attachment..

Does it mean that we are hitting this bug?

CSCsi62979 Bug Details:

logrot.pl does not properly detect file sizes > 4 GB on Windows.

Symptom:

Logrot.pl ignores certain logfiles when performing rotation and/or archiving.

Conditions:

This can occur on Windows when the file to be rotated is larger than 4 GB in size. In this case, logrot.pl will think that the file is smaller than it is, and may not rotate it.

Workaround:

Adjust the logrot configuration so rotation will occur when the file reaches a smaller size. Beyond that, there is no workaround.

Most likely. However, due to a problem with NetPro, I cannot access your attachment.

Yeah, you are most likely hitting my bug. The fix is present in LMS 3.0. If you contact the TAC, they can provide you a logrot_stat.exe from LMS 3.0 that will provide the correct file size.

Thank you very much. According to the bug details page, this bug is present in CiscoWorks Common Services Software 3.0 and was fixed in version 3.1. Is it better to upgrade the LMS version to 3.0 to fix this? or upgrading the Common Services to version to 3.1 will suffice?

You would need to upgrade to LMS 3.0.

OK. Thank you very much for the help.

I've already copied the new logrot.exe to Ciscoworks directory and re-configure the settings but still same issue occurred. Please advise on the next step to resolve this issue. Thanks

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: