Fork me on GitHub

Project Notes

Cacti

About the cacti network monitoring tool, including how to run it in Docker.

Notes

Cacti is a network graphing/monitoring tool that uses RRD time-series files for storage. It is one of the many tools that are part of the RRDtool ecosystem.

Features

Graphs

  • graph templates
  • tree view for graph hierarchies
  • list view
  • preview view
  • support for all of RRDTool’s graph item types including AREA, STACK, LINE[1-3], GPRINT, COMMENT, VRULE, and HRULE.

Data Sources - uses RRD files via RRDTool library

Data Gathering

  • custom scripts that can be used to gather data
  • built-in SNMP support, ability to retrieve data using SNMP or a script with an index
  • cacti provides the poller: Spine, formerly Cactid

User Management - for defining users, permissions. Users can have their own graph settings.

What it doesn’t have:

  • there’s no API for management/configuration
  • there’s no API for data access/queries

Requirements

Cacti requires MySQL, PHP, RRDTool, net-snmp, and a webserver that supports PHP such as Apache or IIS.

Running in Docker

Traditionally, cacti is directly installed on a suitable Linux or Windows host - see downloads.

But with so many dependencies, running in Docker is a very attractive option these days. A brief scan of dockerhub shows there are no official images, but two reasonably popular attempts:

The smcline06 version appears to have the more active github repo so I’m trying that.

I’m using a docker-compose.yml based on the smcline06 single-instance example.

$ docker-compose up

After initial startup, logging into localhost with default credentials admin/admin will prompt for a password change and then proceed with a guided installation process.

install_success

I configured automatic discovery on the local network. There’s not much to find, but I see my mobile phone there (pocophone)..

discovery

Adding my phone as a generic device..

add_generic_device

And it’s monitored with ping. Shows it going offine when I went out with the phone..

graphs

Shutting down…

$ docker-compose down

The docker compose configuration defines a number of named volumes. They remain after shutown, ready to be reused on startup. If I wasn’t planning to reuse the cacti isntallation, I could removed them with docker volume rm

$ docker volume ls | grep cacti
local               cacti_cacti-backups
local               cacti_cacti-data
local               cacti_cacti-db

Credits and References

About LCK#117 infrastructuremonitoring
Project Source on GitHub Return to the Project Catalog

This page is a web-friendly rendering of my project notes shared in the LittleCodingKata GitHub repository.

LittleCodingKata is my collection of programming exercises, research and code toys broadly spanning things that relate to programming and software development (languages, frameworks and tools).

These range from the trivial to the complex and serious. Many are inspired by existing work and I'll note credits and references where applicable. The focus is quite scattered, as I variously work on things new and important in the moment, or go back to revisit things from the past.

This is primarily a personal collection for my own edification and learning, but anyone who stumbles by is welcome to borrow, steal or reference the work here. And if you spot errors or issues I'd really appreciate some feedback - create an issue, send me an email or even send a pull-request.