DX Infrastructure Manager

Expand all | Collapse all

Dirscan Age of File Question

Jump to Best Answer
  • 1.  Dirscan Age of File Question

    Posted 08-25-2011 09:03 PM



    I have a group with a very odd request. They need to monitor a specific file and ensure that it is updated every 24 hours, at least. This is trivial to do with dirscan, however they need the 24 hour time period to always start at the same time. For example, right now the file could be updated at 5:30am one day and then 24 hours later it may alarm. However when it is finally updated the counter will use the new time (for example, 6:30am). 


    The only thought I had on solving this was to schedule a LUA script - I'm not sure how to configure the NimBUS calls for dirscan in order to get the current age of the file in minutes.


    Any ideas? 




  • 2.  Re: Dirscan Age of File Question
    Best Answer

    Posted 08-25-2011 09:15 PM

    If you want to script this with Lua, you do not need the dirscan probe at all. The controller has a callback named file_stat that returns information about a file you would typically see when viewing a directory listing. This includes the modified time. From that it would be easy to calculate the age.



  • 3.  Re: Dirscan Age of File Question

    Posted 08-25-2011 09:58 PM
    Keith - I will take a look at that and will respond back. Thanks!

  • 4.  Re: Dirscan Age of File Question

    Posted 08-25-2011 11:22 PM

    Using the controller is the way we will move forward. Thanks!