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
log & audit file to truncate from top
log & audit file to truncate from top
Zajil NMS
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: log & audit file to truncate from top
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:
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.
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.cfgAs for NagVis, please refer to the config file /usr/local/nagvis/etc/nagvis.ini.php
I believe the setting you need is
Code: Select all
audit_log=0I 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.logYes.zaji_nms wrote:Is it safe to removed old log from this file?
You will no longer have access to the old contents once you remove them.zaji_nms wrote:No any adverse effect?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: log & audit file to truncate from top
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
Yes we still using /etc/mrtg/mrtg.cfg as we manually adding MRTG.
You can close the case.
Regards
Zajil NMS