Using Cacti with Clearwater¶
Cacti is an open-source statistics and graphing solution. It supports gathering statistics via native SNMP and also via external scripts. It then exposes graphs over a web interface.
We use Cacti for monitoring Clearwater deployment, in particular large ones running stress.
This document describes how to
- create and configure a Cacti node
- point it at your Clearwater nodes
- view graphs of statistics from your Clearwater nodes.
Setting up a Cacti node (automated)¶
Assuming you’ve followed the Automated Chef install, here are the steps to create and configure a Cacti node:
- use knife box create to create a Cacti node -
knife box create -E <name> cacti
- set up a DNS entry for it -
knife dns record create -E <name> cacti -z <root> -T A --public cacti -p <name>
- create graphs for all existing nodes by running
knife cacti update -E <name>
- point your web browser at
cacti.<name>.<root>/cacti/(you may need to wait for the DNS entry to propagate before this step works)
If you subsequently scale up, running
knife cacti update -E <name>
again will create graphs for the new nodes (without affecting the
Setting up a Cacti node (manual)¶
If you haven’t followed our automated install process, and instead just have an Ubuntu 14.04 machine you want to use to monitor Clearwater, then:
install Cacti on a node by running
sudo apt-get install cacti cacti-spine
accept all the configuration defaults
login to the web UI at
http://<IP address>/cacti(using the credentials admin/admin) and set a new password
modify configuration by
going to Devices and deleting “localhost”
going to Settings->Poller and set “Poller Type” to “spine” and “Poller Interval” to “Every Minute” - then click Save at the bottom of the page
going to Data Templates and, for each of “ucd/net - CPU Usage - *” set “Associated RRA’s” to “Hourly (1 Minute Average)” and “Step” to 60
going to Graph Templates and change “ucd/net - CPU Usage” to disable “Auto Scale”
going to Import Templates and import the Sprout, Bono and SIPp host templates - these define host templates for retrieving statistics from our components via SNMP and 0MQ. For each template you import, select “Select your RRA settings below” and “Hourly (1 Minute Average)”
set up the 0MQ-querying script by
ssh-ing into the cacti node
running the following
sudo apt-get install -y --force-yes git ruby1.9.3 build-essential libzmq3-dev sudo gem install bundler --no-ri --no-rdoc git clone https://github.com/Metaswitch/cpp-common.git cd cpp-common/scripts/stats sudo bundle install
Pointing Cacti at a Node¶
Before you point Cacti at a node, make sure the node has the required
packages installed. All nodes need clearwater-snmpd installed
sudo apt-get install clearwater-snmpd). Additionally, sipp nodes
sudo apt-get install clearwater-sip-stress-stats).
To manually point Cacti at a new node,
- go to Devices and Add a new node, giving a Description and Hostname, setting a Host Template of “Bono”, “Sprout” or “SIPp” depending on the node type), Downed Device Detection to “SNMP Uptime” and SNMP Community to “clearwater”
- click “Create Graphs for this Host” and select the graphs that you want - “ucd/net - CPU Usage” is a safe bet, but you might also want “Client Counts” and “Bono Latency” (if a bono node), “Sprout Latency” (if a sprout node), or “SIP Stress Status” (if a sipp node).
- click “Edit this Host” to go back to the device, choose “List Graphs”, select the new graphs and choose “Add to Default Tree” - this exposes them on the “graphs” tab you can see at the top of the page (although it may take a couple of minutes for them to accumulate enough state to render properly).
Graphs can be viewed on the top “graphs” tab. Useful features include
- the “Half hour” preset, which shows only the last half-hour rather than the last day
- the search box, which matches on graph name
- the thumbnail view checkbox, which gets you many more graphs on screen
- the auto-refresh interval, configured on the settings panel (the default is 5 minutes, so if you’re looking for a more responsive UI, you’ll need to set a smaller value)
- CSV export, achievable via the icon on the right of the graph.