n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Cacti Pi

Wed Aug 15, 2012 9:37 am

Hey all,

Broke in my new RPi today by setting up LAMP and installing Cacti.

I posted a tutorial at:
http://n00blab.com/cacti-pi/

(I will clean up the tutorial for readability tomorrow....must sleep)

First impressions : a little sluggish...

If you have any questions let me know here or comment on the blog post, I can try and help as best I can.
Attachments
cactipi2.jpg
cactipi2.jpg (26.81 KiB) Viewed 19065 times
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Thu Aug 16, 2012 3:51 am

ok, cleaned up the tutorial.

should be easy enough to follow. will follow my own instructions on pi #2 when I get the chance an perhaps post a vid.

also just attempted taking some RAM away from the graphics as I will be all cli

sudo cp /boot/arm224_start.elf /boot/start.elf

sudo reboot

should help with giving it the power it needs to run the full blown LAMP and Cacti
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Thu Aug 16, 2012 4:06 am

also gave apt-get php-apc an install....

these changes seemed to have made a nice improvement on cacti's performance
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Fri Aug 17, 2012 5:45 am

Had some issues with blank cacti graphs after php-apc install....

removed it and they are back....not sure there is a correlation, however I am not familiar with the details of caching with apc so I am going without it for now...
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Fri Aug 17, 2012 7:01 am

n00badmin wrote:Had some issues with blank cacti graphs after php-apc install....

removed it and they are back....not sure there is a correlation, however I am not familiar with the details of caching with apc so I am going without it for now...
false alarm...have found the issue with the blank graphs...nothing to do with apc...will re-install later.
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Fri Aug 17, 2012 8:26 am

n00badmin wrote:
n00badmin wrote:Had some issues with blank cacti graphs after php-apc install....

removed it and they are back....not sure there is a correlation, however I am not familiar with the details of caching with apc so I am going without it for now...
false alarm...have found the issue with the blank graphs...nothing to do with apc...will re-install later.

WOW

super annoying issue which appeared to be Cacti not graphing was actually timezone settings in PHP5.

Despite changing the timezone in /etc/php5/apache2/php.ini there is another php.ini file located in /etc/php5/cli that caused Cacti on my RPi to graph in UTC ( i'm in EDT). So in fact Cacti was graphing.....I just wasn't displaying the results as they were 4 hours ahead.

grrrrrr....
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Sat Aug 18, 2012 7:19 am

So far so good. Would be awesome if raspcontrol http://raspcontrol.com/ added a tab to view cacti graphs for the items they monitor as most of them are monitored by cacti templates upon install. :idea:

graph_image.php3.png
graph_image.php3.png (14.3 KiB) Viewed 18724 times
graph_image.php2.png
graph_image.php2.png (14.54 KiB) Viewed 18724 times
graph_image.php.png
graph_image.php.png (21.66 KiB) Viewed 18724 times
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Sat Aug 18, 2012 8:09 am

Plugged php-apc back in and threw up a write up on optimizing RPi for webserving Cacti ( and anything else for that matter). These settings have definitely improved performance.

http://n00blab.com/cacti-pi-optimized/
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Sun Aug 19, 2012 8:11 am

Hi everyone.

So I have combed through my tutorial for installing Cacti on Raspberry Pi Raspian Wheezy and can advise it is now 100% accurate and allows for simple copy and paste set up.

http://n00blab.com/cacti-pi/

I went through it step by step twice and captured a video tutorial which I am uploading to youtube now. I'll hit you guys with the link once its published.

I hope to cover more topics soon including more snmp polling tips as well as covering some very useful plugins. (ie Nectar & Thold. )

Let me know if anyone has installed successfully.

Thanks!
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Tue Aug 21, 2012 12:43 am

Video version of the tutorial coming later tonight!!!

Hope to see some Cacti monitoring examples!!!

:)
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Wed Aug 22, 2012 6:45 am

And here she is!

Full video walkthrough of Cacti install on Raspberry pi!!!

Hope this helps you guys monitor the performance of your RPi!!!!

http://n00blab.com/cacti-pi/
n00badmin
CCNA JNCIA
www.n00blab.com

bitwelder
Posts: 3
Joined: Fri Aug 03, 2012 2:10 pm

Re: Cacti Pi

Wed Aug 22, 2012 7:41 am

Nice post, thanks!

Could you please also explain briefly your hardware configuration?
Do you store everything on the SD card or do you have additional USB stick or perhaps an HDD plugged in?

rasbeer
Posts: 242
Joined: Wed Mar 07, 2012 8:35 am

Re: Cacti Pi

Wed Aug 22, 2012 12:26 pm

Whenever I try to open www.n00blab.com I get a download instead of a webpage (using Chromium 18.0.0125.168 on Ubuntu 11.10) :s

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Wed Aug 22, 2012 1:05 pm

Could you please also explain briefly your hardware configuration?
Do you store everything on the SD card or do you have additional USB stick or perhaps an HDD plugged in?
Hey Bitwelder!

Being I have only had the RPi for just over a week I have kept things very simple. I am currently running Raspian Wheezy (2012-07-15) with a Kingston 16 GB SD card. Everything is being stored to the SD.

Currently Cacti is the only thing running on it and it is only monitoring itself. Here's some key performance indicators thus far:
rootfs.png
rootfs.png (14.9 KiB) Viewed 18441 times
cpu.png
cpu.png (17.45 KiB) Viewed 18441 times
eth0.png
eth0.png (20.12 KiB) Viewed 18439 times
One of the great things about Cacti and rrdtool is that the database and storage is predictable. (currently using just a bit more than the image install itself) The storage does not increase as you store more and more historical data as the rrd files that provide the data to be graphed are simply updated with new values.

Obviously if you add more and more devices you will need to accommodate the growth in the SQL and rrd databases.

As you can see CPU use is something I am going to investigate and try to optimize. (currently between 15-21 % use) I have a second RPi that I am going to install using lighttpd to see if it makes a large difference. Also going to look into ramfs and other optimization options. Will be sure to post the results/findings.

I will also try and push my set up by adding 4 more devices to Cacti for monitoring to see how it performs.

This is why I prefer Cacti to something like raspcontrol (although I will suggest they try and add ability to add a tab for snmp data or integrate cacti as its open source) as it allows you to collect historical and maintain current and historical data which can be very helpful in troubleshooting and trending.

How many devices/data points are you looking to monitor?
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Wed Aug 22, 2012 1:17 pm

rasbeer wrote:Whenever I try to open http://www.n00blab.com I get a download instead of a webpage (using Chromium 18.0.0125.168 on Ubuntu 11.10) :s
hmmmm....

A download of what?

Do you see the issue if you click this link ?

http://n00blab.com/cacti-pi/

I will install chromium on my Ubuntu 12.04 LTS machine and see if I can replicate it.
n00badmin
CCNA JNCIA
www.n00blab.com

bitwelder
Posts: 3
Joined: Fri Aug 03, 2012 2:10 pm

Re: Cacti Pi

Wed Aug 22, 2012 4:59 pm

n00badmin wrote: How many devices/data points are you looking to monitor?
I'm probably going to monitor 2-3 devices, but then also add syslog-ng/rsyslog to collect all logs from a Cisco router and host the nut monitor for the UPS.
I really wish to keep all Raspi storage on solid state, but I'm also a bit worried about SD/USB memory to wear out.

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Wed Aug 22, 2012 5:44 pm

ok, well i am adding 2 cisco routers and a juniper fw to cacti on the pi to see how it performs.

I was also thinking of making it my syslog server/tftp/ etc.


Ill keep u up to date and advise my findings on the blog and here.

Ill keep an eye out on any threads regarding memory degradation on the SD performance

Lemme know how it goes.
n00badmin
CCNA JNCIA
www.n00blab.com

rasbeer
Posts: 242
Joined: Wed Mar 07, 2012 8:35 am

Re: Cacti Pi

Wed Aug 22, 2012 6:44 pm

n00badmin wrote:
rasbeer wrote:Whenever I try to open http://www.n00blab.com I get a download instead of a webpage (using Chromium 18.0.0125.168 on Ubuntu 11.10) :s
hmmmm....

A download of what?

Do you see the issue if you click this link ?

http://n00blab.com/cacti-pi/
I opened the "download" file in a text editor:

Code: Select all

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Wed Aug 22, 2012 10:04 pm

chromium.jpg
chromium.jpg (62.22 KiB) Viewed 18372 times
Loads fine in Chromium in Ubuntu 12.04 LTS.

Not sure whats happening on your machine. Loads fine across all my devices on a multitude of browsers.

The tutorial can also be found here as a workaround.....

http://youtu.be/yX8oR-Fkj9M
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Sat Aug 25, 2012 6:32 pm

So I took a look at my RPi's CPU performance graph in Cacti and it seems interesting.

As you can see there seems to be a gradual climb in use over approximately 3 hour periods then it drops down again.....creating a kind of cliff like pattern...

hmmm.... any ideas? look normal? what you guys think.

All that's running is Cacti poller, LAMP and php-apc....
Attachments
pi_cpu_12hr.png
pi_cpu_12hr.png (18.26 KiB) Viewed 18251 times
n00badmin
CCNA JNCIA
www.n00blab.com

rasbeer
Posts: 242
Joined: Wed Mar 07, 2012 8:35 am

Re: Cacti Pi

Sun Aug 26, 2012 10:40 am

n00badmin wrote:
chromium.jpg
Not sure whats happening on your machine.
It's working now :)

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Wed Aug 29, 2012 4:32 am

Can someone who is running cacti on their LAMP RPi post their cpu utilization graph?

still trying to figure out this strange utilization pattern...slow climb then drop off...

i am only running cacti on lamp with php apc...

just find the pattern strange and would like to compare.

THANKS!
Attachments
image.jpg
image.jpg (24.52 KiB) Viewed 18044 times
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Wed Aug 29, 2012 4:52 am

Ah! just learnt the 'top' command.

will see what i can dig up!
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Wed Aug 29, 2012 9:52 pm

Figured it out using Top.

The Pi is polling itself thus everytime the 5 min poll comes up the Pi is busy. this graph is useless as it does not give a true representation of average cpu use.

Will post more on this tonight
n00badmin
CCNA JNCIA
www.n00blab.com

n00badmin
Posts: 46
Joined: Tue Aug 14, 2012 2:09 pm

Re: Cacti Pi

Thu Aug 30, 2012 4:29 am

ok...

So here's the deal with that graph I've been trying to figure out.

Cacti's poller, by default polls every 5 minutes. So in my case, due to the fact RPi was only polling itself, when that 5 minute mark came the CPU use was very busy processing the php activities, snmp polls of itself etc.

Cacti would get a CPU use value between 60% - 90% every 5 minutes. Cacti would then average that amount over 300 seconds (5min).

The reason this is a useless graph is it only gives you a representation of the CPU utilization every 5 minutes...and on a machine running cacti...that's its busiest time.

If you use the TOP command and watch it through a few polls you will see the CPU util is very low between the polls cacti does. so My graph showing that my cpu is being utilized between 15-30% on average during the day, just isn't accurate.

The CPU graph in my opinion only makes sense on the 1 min interval polled from a different machine. something I may try in the future.

Mystery solved.

Also, stay tuned, I have another Cacti Optimization tutorial coming up... how to install Cacti Spine...the much faster and more efficient poller written in C. It makes a pretty big difference in the polling time on the RPi.

gnight for now
n00badmin
CCNA JNCIA
www.n00blab.com

Return to “Networking and servers”