Ad Widget

Collapse

[ZBX 3.4.7] discovery rule to create predictive calculated item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eljibe
    Member
    • Apr 2014
    • 31

    #1

    [ZBX 3.4.7] discovery rule to create predictive calculated item

    Hi guys,

    I created a template named FILESYTEM DISCOVERY, using the vfs.fs.discovery key.
    For testing purposes I used the following filter:
    Code:
    {#FSNAME} matches ^(/|/boot)$
    I created a "free space on {#FSNAME}" item prototype using the following key that works perfectly fine:
    Code:
    vfs.fs.size[ {#FSNAME},free]
    I then proceeded to create a calculated item prototype called Time Left until {#FSNAME} is full, using the following formula:
    Code:
    timeleft("FILESYSTEM DISCOVERY:vfs.fs.size[{#FSNAME},free]",#3,,0,linear)
    I get a lot of different errors, the last of which is :
    Code:
    Cannot evaluate function "timeleft(#3,,0,linear)": item "FILESYSTEM DISCOVERY:vfs.fs.size[ /boot,free]" does not exist
    Exact same thing with /

    Once the discovery is done, I can create the very same Item (not the prototype), and it works perfectly fine.
    Code:
    timeleft("vfs.fs.size[ /,free]",#5,,0,linear)
    The problem usually being between the keyboard and the chair, can you point me to what I am not seeing ?

    Jean-Bernard
    Last edited by eljibe; 29-05-2018, 12:06.
  • eljibe
    Member
    • Apr 2014
    • 31

    #2
    SO, problem was indeed between keyboard and chair...
    turns out that
    Code:
    timeleft("vfs.fs.size[ /,free]",#5,,0,linear)
    is quite different from
    Code:
    timeleft("vfs.fs.size[/,free]",#5,,0,linear)
    So, yes a tiny space made the difference. Seems I'm dumb.
    Please note that I did not use the "function("host:item", param) but the function(item,params)
    Last edited by eljibe; 29-05-2018, 12:12. Reason: explanation

    Comment

    • eljibe
      Member
      • Apr 2014
      • 31

      #3
      Another thing. vfs.fs.size[/,free] was updated every 30 seconds. So I changed the update rate to 5m for my formula. Since items and values exist in great enough numbers, it works. It's kind of disapointing that if you have some values but not enough, your item goes unsupported.
      But I should have thought this through.

      Comment

      Working...