the log files seem getting bigger, is it possible to shrink the log files? or delete/remove older than specific date
-rw-r--r--. 1 nagios nagios 11011641755 Oct 15 11:23 event_handler.log
-rw-r--r--. 1 nagios nagios 6206885128 Oct 15 11:23 eventman.log
-rw-r--r--. 1 nagios nagios 5687960481 Oct 15 11:23 sysstat.log
how to shrink log files?!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: how to shrink log files?!
Depending on your version of XI these should rotate automatically, but there isn't anything in them except debug information so you can safely do the following
Code: Select all
cat /dev/null > /usr/local/nagiosxi/var/event_handler.log
cat /dev/null > /usr/local/nagiosxi/var/eventman.log
cat /dev/null > /usr/local/nagiosxi/var/sysstat.logRe: how to shrink log files?!
what's the automatic rotate interval(size or time)?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: how to shrink log files?!
It's supposed to be 5Mxpertech wrote:what's the automatic rotate interval(size or time)?
Code: Select all
/etc/logrotate.d/nagiosxiRe: how to shrink log files?!
do you mean every 5 minutes the newly log data will overwrite old log data?
can we edit/change the rotate time interval?
can we edit/change the rotate time interval?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: how to shrink log files?!
Sorry, every 5MB (which in your case clearly isn't happening)xpertech wrote:do you mean every 5 minutes the newly log data will overwrite old log data?
Yes, XI uses the linux log rotation and the config can be found herexpertech wrote:can we edit/change the rotate time interval?
Code: Select all
/etc/logrotate.d/nagiosxiIt is worth pointing out there were some bugs in this and if you are not on the latest version of XI (5.6.7) you could be experiencing that.
Re: how to shrink log files?!
if rotate every 5MB automatically, why log files oversize in my case?
-rw-r--r--. 1 nagios nagios 11011641755 Oct 15 11:23 event_handler.log
-rw-r--r--. 1 nagios nagios 6206885128 Oct 15 11:23 eventman.log
-rw-r--r--. 1 nagios nagios 5687960481 Oct 15 11:23 sysstat.log
-rw-r--r--. 1 nagios nagios 11011641755 Oct 15 11:23 event_handler.log
-rw-r--r--. 1 nagios nagios 6206885128 Oct 15 11:23 eventman.log
-rw-r--r--. 1 nagios nagios 5687960481 Oct 15 11:23 sysstat.log
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: how to shrink log files?!
xpertech wrote:It is worth pointing out there were some bugs in this and if you are not on the latest version of XI (5.6.7) you could be experiencing that.