Log Rotation to avoid 2GB logfile errors

Anything that you think should be in Cacti.

Moderators: Developers, Moderators

Post Reply
jordon
Posts: 20
Joined: Mon Nov 27, 2006 2:58 am

Log Rotation to avoid 2GB logfile errors

Post by jordon »

Started getting similar error as user who submitted the bug report below, using Redhat EL 4 - I don't know why it isn't rotating the log, but maybe it's possible to add instructions into the error message that's e-mailed to users when the 2GB limit is reached about how to make the log rotate?

http://bugs.cacti.net/view.php?id=838

I'm currently wondering if it's a RHEL-only issue.

Thanks
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

I agree with you, Cacti should / could warn when the logfile size is near 2 Gb.

But rotation of the log has to be done at the OS level (with logrotate in your case).
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
hgd26
Posts: 25
Joined: Fri Oct 06, 2006 5:36 am

Post by hgd26 »

fmangeant wrote:Hi

I agree with you, Cacti should / could warn when the logfile size is near 2 Gb.

But rotation of the log has to be done at the OS level (with logrotate in your case).
Like this:

Code: Select all

cat /etc/logrotate.d/cacti
        /srv/www/htdocs/cacti/log/cacti.log {
            weekly
            rotate 5
            copytruncate
            compress
            notifempty
            missingok
        }
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Yep, logrotate is your best bet.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests