Ad Widget

Collapse

Alert if any files in folder is older than 1hr

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thebossbaby
    Junior Member
    • Jul 2019
    • 11

    #1

    Alert if any files in folder is older than 1hr

    I have a folder, in Windows, which holds files that are to be processed. Once they are processed, they are then moved to another directory.

    I'm currently trying to figure out a way to monitor for files inside this directory and alert if there are any files that are older than 1hr. i.e. They have not been processed yet.

    In Zabbix, you can use vfs.file.time item but this only monitors 1 file and you have to specify the name of the file as well. The names inside the folder I'm monitoring are irrelevant.

    What would be the cleanest way to achieve this?
    Last edited by thebossbaby; 26-07-2019, 07:40.
  • thebossbaby
    Junior Member
    • Jul 2019
    • 11

    #2
    Any ideas anyone?

    Comment

    • splitek
      Senior Member
      • Dec 2018
      • 101

      #3
      there is no "out of the box" solution. For this specific need you have to write your own script. (for windows powershell script can be handy)

      Comment

      • AvaTTaR
        Member
        • Dec 2018
        • 96

        #4
        My solution for such tasks is SMB-share on windows, and mount it on zabbix-server, after that just use vfs.dir.count[{$MOUNT_DIR},,,,,,,,1h] - I think is better than you batch or ps

        Comment

        • sancho
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Mar 2015
          • 295

          #5
          splitek
          As AvaTTaR indicates
          Try this item vfs.dir.count [dir ,,, file ,, 0 ,,, 1h,]

          For example, to monitor the C:\temp directory
          Code:
          vfs.dir.count ["C:\temp" ,,, file ,, 0 ,,, 1h,]
          You can see the configuration of the item in
          https://www.zabbix.com/documentation...s/zabbix_agent

          Comment

          • AvaTTaR
            Member
            • Dec 2018
            • 96

            #6
            Hm.. I have missed that agent has the same item for directory count..

            Comment

            • thebossbaby
              Junior Member
              • Jul 2019
              • 11

              #7
              Originally posted by sancho
              splitek
              As AvaTTaR indicates
              Try this item vfs.dir.count [dir ,,, file ,, 0 ,,, 1h,]

              For example, to monitor the C:\temp directory
              Code:
              vfs.dir.count ["C:\temp" ,,, file ,, 0 ,,, 1h,]
              You can see the configuration of the item in
              https://www.zabbix.com/documentation...s/zabbix_agent
              Thanks Sancho and AvaTTaR, you guys are legends! This is exactly what I was after.

              Comment

              Working...