Ad Widget

Collapse

Calculated item sum

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ezols
    Member
    • Dec 2021
    • 33

    #1

    Calculated item sum

    Hey,

    Can you please help me to understand what im doing wrong, im exploring calculated item, want to do sum for 1d, 7d and 1month.
    Click image for larger version  Name:	image.png Views:	0 Size:	96.1 KB ID:	484325
    Formula - sum("log[/home/ubuntu/scripts/logs/approved.log]",1d)

    Im not sure if formula is working as looks like it doesnt get that far.

    The item error - Cannot evaluate expression: function argument "log[/home/ubuntu/scripts/logs/approved.log]" is not a numeric value at "sum("log[/home/ubuntu/scripts/logs/approved.log]",1d)"

    I have preprocessing step to extract value and type is numeric:
    Click image for larger version  Name:	image.png Views:	0 Size:	42.1 KB ID:	484326

    Test of item:
    Click image for larger version  Name:	image.png Views:	0 Size:	46.4 KB ID:	484327
    Last edited by ezols; 23-05-2024, 09:39.
  • ezols
    Member
    • Dec 2021
    • 33

    #2
    Switched to vfs.file.contents without regex:
    sum(vfs.file.contents[/home/ubuntu/scripts/logs/test.log],1d)

    Upgraded 7 beta 3 to rc2 and now seems to work.

    !!*Take my words back, still doesnt work.!!

    Exact same item and calculated item works on zabbix 5.
    Click image for larger version  Name:	image.png Views:	0 Size:	129.6 KB ID:	484334

    zabbix 7
    Click image for larger version  Name:	image.png Views:	0 Size:	91.6 KB ID:	484335

    content of test.log is just 3
    Last edited by ezols; 23-05-2024, 11:00.

    Comment

    Working...