Ad Widget

Collapse

Function last(0) in a trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gbmadmin
    Junior Member
    • Mar 2020
    • 18

    #1

    Function last(0) in a trigger

    I have some default triggers that are configured with a "last(0)" function, just like:
    Code:
    {Template OS Linux:vm.memory.size[available].last(0)}<20M
    If I try to change the triggering value, I get an error whenever I leave zero in the "Last of T field". I can put "0s", or "#1", but I cannot leave the "0" value, and a "#0" is not accepted as well. Even when I don't change anything, I have to clear the field and the expression changes from
    Code:
    {Template OS Linux:vm.memory.size[available].last(0)}<20M
    to
    Code:
    {Template OS Linux:vm.memory.size[available].last()}<20M
    Maybe the "last()" part of the expression works the same as "last(0)", but it's a bit annoying not being able to set the previous expression value, because it makes you think there's an error somewhere.

    IMHO, Zabbix should accept a "#0" value, or show "last()" instead of last(0) as default.
  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #2
    last(0) is an outdated syntax from v1.*. It deprecated but still supported. Current syntax is last() or last(#1).

    Comment

    • gbmadmin
      Junior Member
      • Mar 2020
      • 18

      #3
      Great news, thanks.

      May I suggest that you get silently rid of the 0 in the editing field, so to avoid the error? See pictures.

      Click image for larger version

Name:	Schermata 2020-09-17 alle 09.29.14.png
Views:	4410
Size:	66.7 KB
ID:	409255

      Click image for larger version

Name:	Schermata 2020-09-17 alle 09.30.00.png
Views:	4450
Size:	89.8 KB
ID:	409256

      Comment

      Working...