ZABBIX Forums  
Old 05-12-2017, 17:45
SnIpY SnIpY is offline
Junior Member
Join Date: Jan 2017
Posts: 6
Default Calculated Items in Templates

I'm having a Template A with two items:

Total Storage Space (External Check, Key:["--metric","AllocatedStorage","--instance-id","{HOST.HOST}","--access-key","{$AWS_ACCESS_KEY}","--secret-key","{$AWS_SECRET_KEY}","--region","{$REGION}"])
Available Storage Space (External Check, Key:["--metric","FreeStorage","--instance-id","{HOST.HOST}","--access-key","{$AWS_ACCESS_KEY}","--secret-key","{$AWS_SECRET_KEY}","--region","{$REGION}"])

Now I would like to add a third item to the same template, calculating the free storage space in percentage.

According to the documentation, it should look like this: 100*last("vfs.fs.size[/,free]")/last("vfs.fs.size[/,total]")

So I've created this:

But for some reason, this does not work. The error I am seeing is the following:
Macro '{$AWS_ACCESS_KEY}' value is not numeric

Any tips on how I an resolve this?
Reply With Quote
Old 05-12-2017, 18:39
kloczek kloczek is offline
Senior Member
Join Date: Jun 2006
Location: UK/London
Posts: 872

So on the begging you have:
so on first look it can be interpreted as last() arguments: "[" then "FreeStorageSpace" ..
Looks like messy quotations
Reply With Quote
Old 05-12-2017, 21:26
SnIpY SnIpY is offline
Junior Member
Join Date: Jan 2017
Posts: 6

Made some changes and changed it into this:

I did the same change to the item itself

Now the error I am seeing is the following -> Item ... is not supported.

I am seeing that error because the quotes need to be double for the item. If the quotes are not the same in the item and the calculated item, I am getting the Item not found item error.

So whats the best approach here?
1) I need double quotes in the formula, but can't seem to use them
Reply With Quote
Old 06-12-2017, 11:04
SnIpY SnIpY is offline
Junior Member
Join Date: Jan 2017
Posts: 6

Backslashes to the resque!

This eventually worked:

Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 10:19.