3. Adding new devices to cacti

A device can be anything which is SNMP enabled. It could be a router, a switch....

In our example, we are going to add the server we configured in the first part of this tutorial. The server is on localhost, but it could be anywhere on a network, as long as our manager host is allowed to connect to its SNMP port.

3.1. Creating a new device

To create a new device, first make sure you are in the "Console", if not, click on the "Console" tab on the top left and click on Create devices for network. This will bring you to a new page where you are going to give details about the SNMP host.

Fill up the form and make sure you have the following value properly set:

Hostname to localhost or whichever url/address your SNMP server can be found at

Host Template to ucd/net SNMP Host

SNMP Community to mycommunity or whatever your community is called

SNMP Version to Version 1

SNMP Port default is 161 which should be fine for 99% settings. Change accordingly to your SNMP server settings

Then Click create and you should get to a page where you get something similar to:

If you get the latest output, this means that the connection between the manager and the SNMP host could not be established, either firewalled or refused by the host. Use snmpwalk -Os -c mycommunity -v 1 snmp.server.ip system to troubleshoot.

3.2. Creating a new Graph for a device

OK, sweet, we have enabled our first host to be monitored by cacti. Now, let's add a few graphs.

Click the "Create Graphs for this Host" and check the boxes you want to monitor (CPU Usage, Load Average, Memory Usage).

Under "Data Query [SNMP - Interface Statistics]", check the interfaces you want to monitor and finaly in "Select a graph type" choose the kind of stats you want. I chose "In/Out Bytes with Total Bandwidth".

Here we are!!! Now click on the "Graph" tab and select your host from the tree.

Voila! Mind that you will need some times before you can see datas.

4. Conclusion

Once you have been able to set up a first host to work with cacti, it is fairly easy to add other host from your network. Simply cnfigure the snmp server in such a way that the machine hosting cacti will be able to contact them.

In this tutorial, the security was preserved by binding the service to localhost and changing the default community name from public to mycommunity. If you start deploying SNMP over the network, I would recommend that you only accept traffic to port 161 (default SNMP port) to trusted host. Iptbables will become of great help.