10-29-2008 10:55 PM
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.
10-29-2008 10:59 PM
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".
11-04-2008 05:36 PM
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>
11-04-2008 05:40 PM
Please post the output of perl logrot.pl -v.
11-05-2008 04:39 PM
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
11-05-2008 10:14 PM
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.
11-06-2008 04:58 PM
11-06-2008 10:19 PM
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.
11-06-2008 10:25 PM
Most likely. However, due to a problem with NetPro, I cannot access your attachment.
11-06-2008 10:58 PM
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.
11-07-2008 01:52 AM
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?
11-07-2008 07:49 AM
You would need to upgrade to LMS 3.0.
11-11-2008 05:27 PM
OK. Thank you very much for the help.
04-07-2009 03:48 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide