Ad Widget

Collapse

How do you use the now function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kestral
    Junior Member
    • May 2016
    • 3

    #1

    How do you use the now function

    I have seen a few examples and read the documentation but have been unable to get the now function to return a value. I'm using ver 3.0.0 of Zabbix and have tried the following

    now
    now()
    now(0)
    last(vfs.file.time[{$RHH.CTREE_BACKUP_FOLDER}\BACKUP.DAT]).now
    last(vfs.file.time[{$RHH.CTREE_BACKUP_FOLDER}\BACKUP.DAT]).now()
    last(vfs.file.time[{$RHH.CTREE_BACKUP_FOLDER}\BACKUP.DAT]).now(0)

    each attempt results in an error similar to the following

    Cannot evaluate function "now()": item "RHH.ctree:ctree.sct_trfls" not supported.

    Is anyone able to provide an example of how I should be determining the number of seconds since a file was last updated.

    Thanks,
    Andrew
  • Zabbixtrainee
    Junior Member
    • Mar 2016
    • 20

    #2
    Use fuzzytime.

    Check from manual "supported trigger functions"


    example.
    {host:vfs.file.time[path\to\file,modify].fuzzytime(1h)}=0 ,alerts when a file has been modified over an hour ago

    Comment

    • kestral
      Junior Member
      • May 2016
      • 3

      #3
      Thanks for the info ZabbixTrainee, but I was more after the time so I could figure out (and plot) how old a file was.

      As it turned out I was able to get the value from now using the following

      now("vfs.file.time[{$site.CTREE_BACKUP_FOLDER}\BACKUP.DAT]")

      It seems to need a valid key inside the brackets. This worked and returns the unixtime (seconds from epoch) so I was able to use that. It would have been simpler if the new function took no parameters.

      Comment

      Working...