Ad Widget

Collapse

File Age Trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tractorboy
    Member
    • Oct 2010
    • 98

    #1

    File Age Trigger

    I would like a trigger to fire if file monitored file is >24hrs old.

    I am using vfs.file.time but how do I convert that into hours old?

    Is it also possible to graph on file age?
    Last edited by Tractorboy; 15-12-2011, 18:21. Reason: Added extra graph question.
  • JiP
    Member
    • Nov 2011
    • 41

    #2
    vfs.file.time returns number of seconds from begin of Unix era I think it's 1.1.1970. If you do something like this:

    {host:vfs.file.time[/file].now(0)}-{host:vfs.file.time[/file].last(0)}>86400

    You get alarm when files is older than one day

    Comment

    • JiP
      Member
      • Nov 2011
      • 41

      #3
      Timestamp value will be shown hummanly when item unit will be set on "s".

      For more info visit this link http://www.zabbix.com/wiki/doc/tech/...isc_zabbix_1.1

      Comment

      • Tractorboy
        Member
        • Oct 2010
        • 98

        #4
        mmmm

        Originally posted by JiP
        Timestamp value will be shown hummanly when item unit will be set on "s".

        For more info visit this link http://www.zabbix.com/wiki/doc/tech/...isc_zabbix_1.1

        Just tried to use s and the result for a file created today is 41y 12m. Not any better I'm afraid.

        I did see unixtime, which although it not much better does at least do the data conversion
        Last edited by Tractorboy; 19-12-2011, 10:08. Reason: Added extra details

        Comment

        • Tractorboy
          Member
          • Oct 2010
          • 98

          #5
          Trying it out.

          Originally posted by JiP
          vfs.file.time returns number of seconds from begin of Unix era I think it's 1.1.1970. If you do something like this:

          {host:vfs.file.time[/file].now(0)}-{host:vfs.file.time[/file].last(0)}>86400

          You get alarm when files is older than one day
          Just trying this out now. One thing that is difficult is that the tool does not allow this to be created without fully typing.

          Comment

          • Morten Vinding
            Junior Member
            • Sep 2012
            • 1

            #6
            Unix time

            Originally posted by Tractorboy
            Just tried to use s and the result for a file created today is 41y 12m. Not any better I'm afraid.

            I did see unixtime, which although it not much better does at least do the data conversion
            Sorry if this is an old tread.
            To have Zabbix convert from unixtime to human time, just set the item "Units" to "unixtime". Then Zabbix will convert to years, days, hours etc. as needed.

            /Morten

            Comment

            • angelhc
              Senior Member
              Zabbix Certified Specialist
              • Nov 2009
              • 226

              #7
              Thanks Morten, that runs ok.

              Who knows how to trigger if the file is not accessed twice a day? at different working hours?

              Thanks!
              Number of hosts 1600,Number of items +90k,Number of triggers +22k, Number of users +100, New values per second +1270

              http://zabbixes.wordpress.com/

              Comment

              Working...