You are here
CACTI Template Hashes – What I learned. data networks and data 

CACTI Template Hashes – What I learned.

In keeping with the whole human knowledge belongs to the world idea, here’s a primer for creating CACTI templates using a CLI method that should enlighten and save hours and hours and hours.

Learned lesson:  Don’t fully use random 32 character MD5 for hash,  you’re bound to run into duplicates.  Drop the tail by 4 characters and append a universal counter++ ( 9999 unique serials using digits [0-9] ). Also, probably dropping another 2 characters somewhere and inserting a 2-digit hex job-batch number will also help avoiding duplicates in an installed system.

Here’s some code to generate hashes, but strict warning, hashes must be system-wide unique.  I urge you to use the code loosely, then chop the end off and add your own serial number.

http://code.google.com/p/mysql-cacti-templates/source/browse/trunk/meta/unique-hashes.pl?r=164

Learned lesson: Data Source names must begin with a letter, not a number.  So if you’re going to define them in a calculated fashion, you must place a character in front.  Otherwise everything breaks.

Learned lesson: Cacti graph export is broken.  It is erroneously generating <items> hashes under <hash_090021>.  This led to crazy frustration when trying to figure out the templates, but you must map a data source to the graph item.

Learned lesson: the keys you provide to the script that creates the template (also used to name graphs, etc.) should never contain a “less-than” or “greater-than” ( < > ) sign, as this will screw up XML processing when you go to import the script.

Learned lesson: template files larger than 2 MB have either be copy and pasted into the import field text box, or you will have to modify the /etc/php5/apache2/php.ini file to allow uploads greater than 2M or POSTs greater than 8M (defaults).

Definition order and sub-order:

<hash_000021

<hash_100021

                    <hash_090021

<hash_010021

                    <hash_080021

<hash_030021

                    <hash_070021

<hash_150021

<hash_060021

A whole bunch of cross-reference, but it’s easy to see how a template gets generated with one that is easy to study (for example, DNS_BIND stuff).

 

Template Hashes:

Syntax example:

<hash_100021720f4065c62dee0244cab9d7b3fae14e>

Always there.

Item type

Version 0x21 of cacti

32-bit hash, random, unique.

 

Item types:

Graph 0000
Graph.item 1000
Graph.item.taskitemid 0800
Graph.item.gprintid 0600
Graph.input 0900
DS 0100
DS.datainputid 0300
DS.item 0800
DS.datainputfieldid 0700
RRA.item 1500

Related posts

3 thoughts on “CACTI Template Hashes – What I learned.

  1. loglix

    Hello, how do you update hashes on a template that has been developed on an older version of Cacti so that it matches with a more current version of Cacti ?

    1. realworldnumbers

      Sorry for the long response time! Obviously, i’ve been thinking about your response since May. You’ll have to do a search and replace string, looking for, say,

  2. […] information:  If you’re looking for information about Cacti Hashes, I wrote an article a while back about […]

Leave a Comment