I work with cacti to monitorize sensors and temperature. The other day I got an error related with file size limit. The error message is similar to this:
/bin/bash: line 1: 23691 File size limit exceededphp /var/www/html/cacti/poller.php > /dev/null 2> |
This occurs because the cati log file has exceeded the limit. To solve this[1], we can include the cacti log file in logrotate. So we need logrotate installed in our system. In resume we must do the following steps:
1. We create a new logrotate file for cacti.
# vim /etc/logrotate.d/cacti
2. Add the followings lines:
/var/www/html/cacti/log/cacti.log {
# keep two weeks of versions online
rotate 14
# rotate the log each day
daily
# compress the logs
compress
# create new file with the correct user/group attributes
create 644 apache apache
# add a YYYYMMDD extension instead of a number
dateext
}
|
3. Then, we force the rotation:
# logrotate -f /etc/logrotate.conf |
References
[1] http://www.question-defense.com/2008/09/29/how-to-rotate-the-cacti-logs-file-cactilog
[2] Logrotate manual: http://linuxcommand.org/man_pages/logrotate8.html

0 comentarios:
Publicar un comentario en la entrada
Por favor, no escriba al estilo SMS y use signos de puntuación en caso necesario