Cacti Pi – How To Install Cacti Spine on Raspberry Pi
In this post we will continue optimizing Cacti with How to install Cacti Spine on Raspberry Pi.
As per Cacti.net:
“Spine, formerly Cactid, is a poller for Cacti that primarily strives to be as fast as possible. For this reason it is written in native C, makes use of POSIX threads, and is linked directly against the net-snmp library for minimal SNMP polling overhead.”
Generally, Spine is used in large Cacti installs, where many devices need to be polled in under 300 seconds. When you expand the amount of devices you are monitoring the polling cycle gets longer and when using php.cmd it can get close to the 300 second window quite fast. Enter Spine.
In our case although I am monitoring a small network, we want to make sure the polling is completed as quickly as possible to ensure we return our precious CPU back to the Raspberry Pi for other processes.
How To Set Up Raspberry Pi Without Monitor (DHCP, ya you know me!)
In this article we will take the SD card containing Raspbian Wheezy that we created in my last post, and we are going to boot the Pi blind, aka set up Raspberry Pi without monitor.
If you plan to use the Pi as a server rather than a desktop environment, you do your work from the command line, or you just want to save money on accessories, we can completely remove any need for a monitor, keyboard, mouse, etc by taking advantage of DHCP.
How To Create Raspberry Pi SD card via Linux Command Line
This tutorial will walk you through how to create Raspberry Pi SD card via Linux command line (Ubuntu 12.04 LTS)
Instructions for creating the SD card on Windows or Mac are found here
Download desired image via torrent or direct download and place in your Downloads directory:
Cacti Pi – How to Install Cacti on Raspberry Pi
How to install Cacti on Raspberry Pi running Raspbian Wheezy
apt-get update
apt-get install apache2
apt-get install php5
apt-get install mysql-client mysql-serverĀ
*you will be prompted to set a password for the mysql root user. take note of this as you will need it later!*
apt-get install php5-mysql php5-snmp rrdtool snmp snmpd
Run the following command to confirm required php modules are present:
php -m
mysql (For configuration, see note below)
SNMP (For configuration, see note below)
XML
Session
Sockets
LDAP (Required only when using LDAP authentication)
GD (Required only for some Plugins)
Raspberry Pi setup
My Raspberry Pi setup (so far)
2 Raspberry Pi set up as headless servers in beautiful Built-To-Spec cases.
RPi 1
16GB Sandisk SD
Raspbian Wheezy 2012-07-15
LAMP
Serving Cacti which is monitoring performance of both Pi
Rpi 2
16GB Kingston SD
Raspbian Wheezy 2012-08-16
Freshly installed and awaiting lighttpd install to compare against apache2
Future Projects:
Syslog server
Tftp server
Wordpress site host
Many others…
Cacti Pi – Optimized
After successfully installing Cacti on my RPi and letting it poll for a few cycles with the default local host device setup, it was apparent that it was a little sluggish. Nothing terribly bad, but obvious when compared to my other deployments, which is understandable considering RPi’s specs.
At first I considered perhaps I had made a mistake not going with lighttpd over apache2, however I quickly found another optimization option….
http://www.penguintutor.com/linux/raspberrypi-webserver
This tutorial includes some interesting info on reclaiming some RAM reserved for graphics processing…which RPi as a server really doesn’t require.
Cacti Pi – Correcting Cacti Timezone
Correcting Cacti Timezone
Battled a super annoying issue with what appeared to be Cacti not displaying graphs, which after half a day of messing around ended up being a timezone setting…..grrrrrrrrrrrr
After discovering Cacti was indeed graphing my expected values, just 4 hours ahead of my local time (EDT, America/Toronto) I realized cacti.log was showing UTC timestamps.
After confirming my Linux system time:
pi@raspberrypi ~ $ date
Fri Aug 17 04:39:13 EDT 2012
I dug around on cacti.net and found instructions on updating php.ini with timezone values:
LINK STATUS ACTIVE
Hello World! The n00blab.com’s link status is active!!! Welcome to my tales from the core!
The N00B LAB is my online journal chronicling my adventures through Network and System Admin technology on my way to my goal to gain super user status.
In my studies thus far, I have been amazed by the quality of tutorials and information shared by other network techs and system admins online. What did we do before the internet!? Their recounts of trials and errors and experience gained has helped me progress through attaining my CCNA and JNCIA certs and building a functional home lab. I thought it only fitting that I do my part and send my successes and failures into the matrix in case it might help someone else achieve their goals.
Generally I will share my experiences gained at work in my home lab which will cover topics pertaining to Cisco, Juniper & Linux command line configurations, though may venture into random tech adventures with OSX and various mobile devices.
I hope to help other n00bs level up or just avoid headaches and will help with any questions anyone may have in which I may be of assistance.
See you in the lab n00bs,
n00badmin

