Page 1 of 1
log & audit file to truncate from top
Posted: Sun May 31, 2015 1:40 am
by zaji_nms
Dear Experts
While checking found /var/log/mrtg.log is more than 5GB.
Also found same way /usr/local/nagvis/var/nagvis-audit.log (more than 17GB)
We do not want very old log (more than year or 6 months).
Please let us know any other such log files, we can truncate manually.
Please let us know how to truncate from top (need to remove old log)?
Is it safe to removed old log from this file?
No any adverse effect?
Regards
Re: log & audit file to truncate from top
Posted: Sun May 31, 2015 8:12 pm
by Box293
What version of Nagios XI are you running?
Normally mrtg does not create a /var/log/mrtg.cfg file. Can you please run these commands and post the output:
Code: Select all
cat /etc/cron.d/mrtg
cat /etc/mrtg/mrtg.cfg
This should help identify why the file is being created. It is safe to delete, we just need to find out how it's being created.
As for NagVis, please refer to the config file /usr/local/nagvis/etc/nagvis.ini.php
I believe the setting you need is
This will turn off the audit logging.
I could not see an option for log rotation or max log size. I suggest you look at the NagVis support options available
http://www.nagvis.org/free-support
If you want to remove the start of a file, simply tail the last x lines of the file to a new file, delete the old file and rename the new file.
Code: Select all
tail -n 1000 /usr/local/nagvis/var/nagvis-audit.log > /usr/local/nagvis/var/nagvis-audit.log.new
rm -f /usr/local/nagvis/var/nagvis-audit.log
mv /usr/local/nagvis/var/nagvis-audit.log.new /usr/local/nagvis/var/nagvis-audit.log
zaji_nms wrote:Is it safe to removed old log from this file?
Yes.
zaji_nms wrote:No any adverse effect?
You will no longer have access to the old contents once you remove them.
Re: log & audit file to truncate from top
Posted: Sat Jun 06, 2015 2:59 pm
by zaji_nms
Thanks Mr.Troy for the reply and guidance.
Yes we still using /etc/mrtg/mrtg.cfg as we manually adding MRTG.
You can close the case.
Regards