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

http://www.colourlovers.com/palette/694737/Thought_Provoking

{ item => ‘DISK_sectors_read’,
color => ‘542437’,
task => ‘hash_09_VER_f3f77506dc160c8a882805e75e15157a’,
type => ‘AREA’,
hashes => [
‘hash_10_VER_9e0ee9dd4398f3c84c1e1dd4ad287e0d’,
‘hash_10_VER_73d20c0c3b199ebeee3e0f694f9b1932’,
‘hash_10_VER_92fa99042c57a6ebca46a6963c357ac4’,
‘hash_10_VER_ebc853e0180faf6434aad9d6d2d9f074’
],
},
{ item => ‘DISK_sectors_written’,
color => ‘53777A’,
task => ‘hash_09_VER_12460ac6de2f33b830b4d2f8d0ace1f5’,
type => ‘AREA’,
cdef => ‘Negate’,
hashes => [
‘hash_10_VER_16d5af92816aa76257bb308600b0ef8d’,
‘hash_10_VER_6a9a32eeb3f56d361e46e01067e4b4ef’,
‘hash_10_VER_3057c8e4b22c7ac34e4787ad98dd3eb7’,
‘hash_10_VER_2adb75463062258dbd7b461474a29b1b’
],
},
],
},

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
Alan