www.question-defense.com | Engage: Visit :: Login :: Register

Cacti is an open source tool that polls network devices and provides a web based interface to view historical data about these devices. It is a really great tool to monitor disk usage, network traffic, and pretty much anything else you can think of. When installing cacti it is easy to forget about the log that cacti generates and over time the log can grow in size especially if your configuration includes a logging level of DEBUG. Below I describe how to rotate the cacti log as well as turn down the logging level to LOW on a CentOS 5 server.

First lets set up logrotate to rotate the cacti log.

1. Install logrotate: yum install logrotate
2. Create Cacti config: vi /etc/logrotate.d/cacti
Add the below contents to the new file
[quickcode:cacti]
/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 cactiuser cactiuser
# add a YYYYMMDD extension instead of a number
dateext
}
[/quickcode]
Make sure the path is the correct location for your cacti.log file.
3. Run logrotate: logrotate -f /etc/logrotate.conf


As long as cron is installed on your server then by default logrotate will run once daily which you can check out in /etc/cron.daily. Modify any of the paramters above such as “rotate 14″ which keeps two weeks of backup log files on the local server.

Now lets make sure that the logging level is not turned up to DEBUG.

1. Visit Cacti Install: In your browser visit your cacti installation such as http://example.com/cacti
2. Go to Console: Click the console tab at the top of the browser
3. Visit Settings: In the left nav near the bottom click on Settings. The settings page will look like the below.

Cacti Configuration Settings

4. Change Log Level: As you can see in the example above click the Poller Logging Level drop down and switch to LOW. This will show only statistics and errors as described in the drop down.

Now not only will your logs be rotated but they will be much smaller in size. Check out the book below for more tools to use for Linux server administration.

Linux Administration Handbook (2nd Edition) (Paperback)

By (author) Evi Nemeth, Garth Snyder, Trent R. Hein


List Price: $54.99 USD
New From: $39.00 In Stock
Used from: $10.50 In Stock

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail

Related posts:

  1. The Configuration File Now Needs A Secret Passphrase (blowfish_secret) When installing phpMyAdmin to manage your MySQL database there are...
  2. Using httperf for posting xml data against ruby applications I recently ran into an issue with load testing ruby...
  3. How to Configure yum-updatesd to Notify By Email On most new CentOS server installs yum-updatesd is installed by...
  4. Linux Commands to Install ImageMagick and RMagick This is what I had to do to get it...
  5. Ruby on Rails File Upload Plug-ins Basically, I dug up 5 plug-ins (plugins) that can do...
Tags: , , , , , , ,
3 Responses to “How To Rotate The Cacti Logs File: cacti.log”
  1. Genna Lakey says:

    I would like to say, excellent post. Im unsure if it has been talked about, but when using Chrome I can never get the whole site to load without refreshing alot of times. Could just be my laptop. Thanks

    [Reply]

    alex Reply:

    Hello Genna Lakey,

    Thanks for the compliment regarding the post.

    Also thanks for bring the Chrome issue to my attention. What operating system are you using and is it 32-bit or 64-bit? I am currently using Chrome on Windows 7 64-Bit and the site loads fine the first time and I also have just now tested using Chrome on Windows XP 32-bit. While the issue may be isolated to your laptop we could try to narrow it down some more if you are still having the issue. Anyway let me know the OS and 32/64 bit and I will try to duplicate on the same thing and then we will know if it is isolated issue or not.

    Thanks for your time.
    alex

    [Reply]

  2.  
Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.

*