I have a Zabbix 3.0 template for ZFS that does low level discovery to find ZFS pools (for example) and then have item prototypes that load information for each pool:
zfs.get.fsinfo[{#POOLNAME},available]
zfs.get.fsinfo[{#POOLNAME},used]
Which retrieve available and used space in each pool respectively. This works great.
Now I also want to display total space (which I know is not entirely real, but it's still something my users want to be able to see).
So I create a calculated prototype item. It obviously needs to have the pool name in it somehow, and eventually I figured out this way to key it:
Key: zfs.storage.total[{#POOLNAME}]
Formula: last("zfs.get.fsinfo[{#POOLNAME},used]")+last(zfs.get.fsinfo[{#POOLNAME},available])
But when I apply this template to a host, the calculated item never appears. Any graphs that use it also never appear. The other items (like available and used space) appear just fine.
What am I doing wrong? What is the correct way to do this? It's confusing because this formula is almost a copy & paste from the documentation.
In your formula the first key is correctly enclosed with double quotes, the second key isn't. Could you fix it and wait for the next LLD to check the prototype creation?
You can also try the "hostname:key" notation using the template name in the same way you do in any trigger prototype:
last("YourTemplateName:zfs.get.fsinfo[{#POOLNAME},used]")