#100
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.
I configured automatic discovery on the local network. There’s not much to find, but I see my mobile phone there (pocophone)..
Adding my phone as a generic device..
And it’s monitored with ping. Shows it going offine when I went out with the phone..
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
- cacti.net
- RRDtool - wikipedia
- RRDtool - project home
- rrdtool-1.x - source