Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Attention: The Community will be in read-only mode on 12/14/2017 from 12:00 am pacific to 11:30 am.

During this time you will only be able to see content. Other interactions such as posting, replying to questions, or marking content as helpful will be disabled for few hours.

We apologize for the inconvenience while we perform important updates to the Community.

New Member

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

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
Cisco Employee

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

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".

New Member

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

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>

Cisco Employee

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

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

New Member

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

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

Cisco Employee

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

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.

New Member

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

Please see attachment..

New Member

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

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.

Cisco Employee

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

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

Cisco Employee

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

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.

New Member

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

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?

Cisco Employee

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

You would need to upgrade to LMS 3.0.

New Member

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

OK. Thank you very much for the help.

New Member

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

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

982
Views
30
Helpful
13
Replies
CreatePlease to create content