[ZBX-8517] User macro not expanded in calculated items prototypes Created: 2014 Jul 24 Updated: 2017 Oct 24 Resolved: 2017 Oct 24 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Documentation (D), Server (S) |
Affects Version/s: | 2.2.4 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Minor |
Reporter: | Gabriele Paggi | Assignee: | Unassigned |
Resolution: | Cannot Reproduce | Votes: | 0 |
Labels: | calculateditems, macros | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
RHEL 5 and RHEL 6 |
Description |
Hello, I have an LLD rule that discovers Oracle tablespaces and sets up two items prototypes (tablespace size and tablespace usage). This is working OK. 100*last("oracle.tbs_free[\"{$MONUSER}\",\"{$MONPASS}\",\"{#ORASID}\",\"{#TBS}\"]",0)/last("oracle.tbs_size[\"{$MONUSER}\",\"{$MONPASS}\",\"{$ORASID}\",\"{#TBS}\"]",0) I see that {#ORASID} and {#TBS} correctly get replaced with their values but {$MONUSER} and {$MONPASS} don't, so the item doesn't get populated (generates "cannot evaluate function last error. According to the documentation they should be replaced: I'm not sure if this is a duplicate of this other, now closed, issue: Thanks! Gabriele Paggi |
Comments |
Comment by Marc [ 2014 Jul 24 ] |
Could it be |
Comment by Gabriele Paggi [ 2014 Jul 24 ] |
That issue seems to be about aggregating arguments but, ralphhu's last comment added on 2013 Apr 18 16:10, shows the same issue I'm facing. |
Comment by Marc [ 2014 Jul 24 ] |
I meant the root cause that the issue (and it's duplicates) share not the scenario of the issue itself. |
Comment by Gabriele Paggi [ 2014 Jul 24 ] |
I had a look at |
Comment by Martins Valkovskis [ 2014 Jul 24 ] |
If I understand this right, the user macros are not resolved because they're part of the quoted item key. If so then it is as per documentation: "User macros will NOT be expanded if used to reference a function, host name, item key..." |
Comment by Marc [ 2014 Jul 24 ] |
gpaggi, i believe i had misunderstood your issue. shouldn't: rather be (ORASID): User macros should not be resolved at this point. They'll be resolved on host level on usage. |
Comment by Gabriele Paggi [ 2014 Jul 24 ] |
Marc sorry, that's a typo I did: it's {#ORASID} in both keys. last("oracle.tbs_size[\"db_mon\",\"xxxx\",\"{$ORASID}\",\"{#TBS}\"]",0) On host level I see the same error "cannot evaluate function last..." I got before. Even if the key is now correct it seems its value doesn't get replaced and fed into last. As a workaround I now have my script on the host to return also the percentage of used tablespace but it would be nice to understand how to have that computed in a calculated item prototype. |
Comment by Marc [ 2014 Jul 25 ] |
Since it's not clear whether you encounter a bug, I suggest to ask for community support in forums or IRC: or commercial support: |
Comment by Aleksandrs Saveljevs [ 2015 Jan 20 ] |
Could not reproduce with Zabbix 2.2.4: a calculated item, created from a prototype, which references another created item with user macro, works well. Gabriele, if the issue is still relevant for you, could you please attach screenshots of all item prototype configuration and the "cannot evaluate function last ..." error that you are getting? |
Comment by Rostislav Palivoda [ 2017 Oct 24 ] |
Please reopen if required. |