[ZBX-24541] Calculated item issue in zabbix 7 Created: 2024 May 24 Updated: 2024 May 26 Resolved: 2024 May 26 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Problem report | Priority: | Trivial |
Reporter: | Edvards | Assignee: | Zabbix Development Team |
Resolution: | Won't fix | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() ![]() ![]() ![]() |
Description |
Issue: Want to create calcualted item which would sum the item value of 1 day. Cannot evaluate expression: function argument "vfs.file.contents[/home/ubuntu/scripts/logs/test.log]" is not a numeric value at "sum("vfs.file.contents[/home/ubuntu/scripts/logs/test.log]",1d)" How to reproduce:
test.log contains just digit 3 then create calculated item:
Either its a bug or sytax has changed? I understand that there is no docs for zabbix 7 calcualted items yet. I tested exactlly the same on zabbix 5 and was succesfull to acomplish what i wanted.
|
Comments |
Comment by Alexander Vladishev [ 2024 May 26 ] |
Zabbix has two different functions called "sum". One is mathematical, and the other is aggregate. You are trying to use the mathematical one, where each parameter is either a constant or a mathematical expression. Please note that text data can be converted to a number. For example, the result of this function will be 5. sum("1", 1 + 3) In this case, you need to use the aggregate function "sum." The syntax of this function is different: sum(/host/key, <period>): sum(/<host name>/vfs.file.contents[/home/ubuntu/scripts/logs/test.log], 1d) In calculated items, the host name can be omitted. This would result in the following expression: sum(//vfs.file.contents[/home/ubuntu/scripts/logs/test.log], 1d)
|