Xaprb

Stay curious!

A better way to build Cacti templates

with 2 comments

The traditional way to build Cacti templates is through the Cacti web interface. This is an enormous amount of work, and the result is generally not very consistent or good quality. The process is too error-prone. You can export the templates as XML, but they tend to have problems such as version incompatibilities with other Cacti installations, and it’s hard to adapt them for user preferences such as different graph image sizes and polling intervals.

The way I build Cacti templates is exactly the opposite. I create a data structure in a file, which looks like many configuration file syntaxes you’ve probably worked with. It represents the graphs, templates, scripts, and so on. From this, a tool generates the XML template file, which is a universal template definition, and is a breeze to import into Cacti. It is completely consistent and has zero cruft in it. This process prevents errors, and the results are perfect every time. (There’s a test suite, by the way.)

All the tools, documentation, how-tos, examples, and pre-fabricated scripts and templates you need are at the Better Cacti Templates open-source project. If you want to build your own templates, pay special attention to the documentation on creating graphs.

Written by Xaprb

May 25th, 2010 at 9:56 am

Posted in Cacti,SQL,Sys Admin,Tools

2 Responses to 'A better way to build Cacti templates'

Subscribe to comments with RSS

  1. Hey Baron –
    I’m using your templates (and have for awhile), but I just want to graph Avg. QPS. And I’m surprised you don’t do that? Reason?

    I find cacti & snmp a pain to work with, but I’ve got a simple script that returns the QPS and I’m just about to embark on creating my own cacti template from your tutorial, but really I don’t want to! Do I need to upgrade my better templates? or just bite the bullet & create my own template?

    erin

    22 Oct 10 at 6:30 pm

  2. “Questions” is in the MySQL Command Counters graph.

    Xaprb

    23 Oct 10 at 10:14 am

Leave a Reply