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

**URL:** https://forums.percona.com/t/use-of-uninitialized-value-name-in-substitution-s-at-pmp-cacti-template/4392
**Category:** Percona Monitoring Plugins
**Created:** [September 11, 2015, 2:11am UTC](https://forums.percona.com/t/use-of-uninitialized-value-name-in-substitution-s-at-pmp-cacti-template/4392 "2015-09-11T02:11:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![PeppertreeIT](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@PeppertreeIT](https://forums.percona.com/u/PeppertreeIT)
#### Post date: [September 11, 2015, 2:11am UTC](https://forums.percona.com/t/use-of-uninitialized-value-name-in-substitution-s-at-pmp-cacti-template/4392/1 "2015-09-11T02:11:22Z")

</div>

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](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](https://percona.vanillacommunities.com/profile/x/x/23472), $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
