Ad Widget

Collapse

how to check folders?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Colttt
    Senior Member
    Zabbix Certified Specialist
    • Mar 2009
    • 878

    #1

    how to check folders?

    i would like do following:

    1.)check a folder if exist a file longer than 5minutes give me an alert..
    2.)on check no *.bmp-files must exist on a special folder - when yes check if a program is running otherwise start an program

    is that possible? how?
    Debian-User

    Sorry for my bad english
  • Tractorboy
    Member
    • Oct 2010
    • 98

    #2
    Firstly

    Originally posted by Shad0w
    i would like do following:
    1.)check a folder if exist a file longer than 5minutes give me an alert..
    is that possible? how?
    There is a file.time agent. So this gives you the time of the file.

    The trigger would be {YourKeyforyourfile.now(0)} -{YourKeyforYourFile.last(0)} >5*60

    This checks a specific file.

    If you need to check a folder and see if any file exists greater than five minutes of age then I am not sure. Best is try regular expressions of the above. If this doesn;t work then I'd suggest building a vbs command and using filesystemobject (Assuming windows), or suitable unix sh if not. This would return the unixtimestamp of the oldest file, and you should then be able to continue the trigger as above.

    Comment

    • Tractorboy
      Member
      • Oct 2010
      • 98

      #3
      Originally posted by Shad0w
      i would like do following:

      2.)on check no *.bmp-files must exist on a special folder - when yes check if a program is running otherwise start an program

      is that possible? how?
      Not sure I fully understand, but if a file exists then you can create a trigger, and from that an action. The action can run a remote command, which would be your program.

      The alternate is to build a simple file watcher service and have that running on your server, but thats a developer type activity, which may not suit.

      Hope this helps.

      Comment

      Working...