Installing Cacti on Ubuntu 14.04 LTS

Installing Cacti on Ubuntu 14.04 LTS

Installing Cacti on Ubuntu 14.04 LTS

You’ve got a couple servers that you want to monitor using a graphical representation. There are a few options but my favourite is Cacti, it’s pretty straight-forward to work with and most changes can be done on the admin section of the web interface.

So installing Cacti on Ubuntu 14.04 LTS. It should be pretty much the same on Debian Wheezy so you could probably use that too.

First the prerequisites need to be installed:

lyle@cacti:~$ sudo apt-get update
lyle@cacti:~$ sudo apt-get install apache2 php5 php5-mysql php5-snmp mysql-client mysql-server snmpd rrdtool

You will be faced with a pop-up on screen that looks like this:

cacti01This will be the password for your MySQL root user so please use a password that you will remember.
On the next screen you will be asked to confirm the password. Do so.
Once you do that the installation will continue, most of the manual configuration has been take out of the whole installation process. Now we install the actual cacti package.

lyle@cacti:~$ sudo apt-get install cacti

Now there will be some more graphical configuration required:

Just select OK here and move on. Next it will ask you for a webserver to use, we’ll be using Apache2 since that’s what we installed in the prerequisites.cacti03
Next it’s going to ask if you want to configure the Cacti database, say Yes.cacti04
Now it will ask for your MySQL root password, the same one that you set earlier.cacti05
Next you will be asked for a password for the Cacti database, set one and then confirm it. Some more configuration will happen automatically and then Apache2 will restart.
Before we get to the fun part, we need to start the snmpd service.

lyle@cacti:~$ sudo /etc/init.d/snmpd start

You will now be able to browse to the Cacti install page in your web browser.cacti06 Click Next
Make sure that New install is selected and click Nextcacti07
If everything is green, which it should be if you followed the all the instructions, click Next.cacti08
Next you will be faced with a login screen (default username and password is both admin so, admin/admin)cacti09
Type in the username and password, then you will be prompted to change the password. Make it anything that you will remember.
In about 5 minutes you’ll see your first graphs start populating under the graphs tab after you login.graph_image
This is the basic setup, once you intend to monitor more servers you will need to install the SNMP daemon on those servers and make sure that the rocommunity is set to anything you’d like, I use public just to make things easier.
On a server that you wish to add do the following:

root@vdc-app01:~# echo "rocommunity public" > /etc/snmp/snmpd.conf

Then restart the snmpd service on that box so that the changes can take effect.

root@vdc-app01:~# /etc/init.d/snmpd restart

Once that is done you will need to add the new box as a device on your Cacti web interface. I wont go into much detail with that in this post, but here’s a quick walk-through. Click the console tab -> on the left click Devices -> On the right, click Add -> Here you will usually just need to fill in the hostname or IP address of the device that you wish to monitor and a host template that matches what you need to monitor on that device. Make sure the SNMP community is what you set earlier or you’ll get a SNMP error on the top of the device page.

One thought on “Installing Cacti on Ubuntu 14.04 LTS

  1. Malik

    Great article, i have been following lots of articles for Cacti but there was an error for snmp always when i go for devices,

    but here i found the solution … to echo “rocommunity public” > /etc/snmp/snmpd.conf

    Thanks a Million

Leave a Reply

Your email address will not be published. Required fields are marked *