Use of uninitialized value $name in substitution (s///) at pmp-cacti-template...

I would like to use your template creation scripts to make some new graphs for cacti but I am struggling with the instructions on the web.

If I take your example from the web site as it is it complains that both the script and the meta data require a version. So after some investigation I have added the version as shown below. (it’s also been rehashed)

cat eg2.def

{ name => ‘Disk Sectors Read/Written’,
base_value => ‘1024’,
hash => ‘hash_00_VER_971210171b9761bb20510ca4405680de’,
version => {
version => ‘1.1.5’,
hash => ‘hash_06_VER_1c482d38768d2c14787a4db2810618fb’,
override => { ‘title’ => 1 },
dt => {
hash => ‘hash_01_VER_a2e117b652ee5b869e2830f2287f736c’,
input => ‘Get Disk Stats’,
DISK_sectors_read => {
data_source_type_id => ‘3’,
hash => ‘hash_08_VER_5905977254bb1f12d6f363feecbf17a3’,
DISK_sectors_written => {
data_source_type_id => ‘3’,
hash => ‘hash_08_VER_05281903c2ed20c3d1595a3bfa3d2b2e’,
items => [

Colors from

{ item => ‘DISK_sectors_read’,
color => ‘542437’,
task => ‘hash_09_VER_f3f77506dc160c8a882805e75e15157a’,
type => ‘AREA’,
hashes => [
{ item => ‘DISK_sectors_written’,
color => ‘53777A’,
task => ‘hash_09_VER_12460ac6de2f33b830b4d2f8d0ace1f5’,
type => ‘AREA’,
cdef => ‘Negate’,
hashes => [

Now when I feed that into pmp-cacti-template like this:

~/percona-monitoring-plugins-1.1.5/cacti/bin/pmp-cacti-template --script ~/check_ss_get_by_ssh/ss_get_by_ssh.php eg2.def
(By way of explanation of the directory structure I have added some extra stuff to ss_get_by_ssh for nagios & for swap used which is what I really want to graph, and that’s all working fine)

I Get the following:

Percona Disk Sectors Read/Written HT Percona Disk Sectors Read/Written Version t1.1.5:s1.1.5 t1.1.5:s1.1.5 Use of uninitialized value $name in substitution (s///) at /home/alan/percona-monitoring-plugins-1.1.5/cacti/bin/pmp-cacti-template line 759.

For me line 750 is the one with $name in it below:

sub es { # Element start
my ( $name ) = @_;
$name =~ s/VER/$ver/g;
print(("\t" x $indent++), “<$name>\n”);
push stack, $name;

My copy of pmp-cacti-template has a few variations that may cause the l line numbers to no longer match the original, principally to find out which of meta data or script the version could not be found in.

Any advice or perhaps a working example would be much appreciated.
Many thanks