Monitor File Age on Linux Mount

Hi all, hoping to get some direction.  I need to create an alert that monitors the file age and alerts if the file is greater then 10 minutes old.  The challenge however is that I need to initiate the monitoring from a Windows node called "NYC123" which has a mount point (appears as an interface) to a Linux machine where the file lives.  Been going around and around trying multiple things but need some input on the basics of what i'm trying to accomplish.  I believe one of the file age templates would likely do the trick, but cannot find get it to work.  Any help is appreciated.

  

Parents
  • Use this PowerShell script on the Windows node to check the file age:

    powershell
    $filePath = "Z:\path\to\your\file" # Replace with your mount point $maxAge = 10 $fileAge = (Get-Item $filePath).LastWriteTime $age = (Get-Date - $fileAge).TotalMinutes if ($age -gt $maxAge) { Write-Host "File is older than 10 minutes!" }

    In your monitoring setup, you can also include farmer names if you're tracking files related to specific farmers or farm data. This will help you pinpoint files based on the associated names or categories, triggering alerts when data is outdated.

Reply
  • Use this PowerShell script on the Windows node to check the file age:

    powershell
    $filePath = "Z:\path\to\your\file" # Replace with your mount point $maxAge = 10 $fileAge = (Get-Item $filePath).LastWriteTime $age = (Get-Date - $fileAge).TotalMinutes if ($age -gt $maxAge) { Write-Host "File is older than 10 minutes!" }

    In your monitoring setup, you can also include farmer names if you're tracking files related to specific farmers or farm data. This will help you pinpoint files based on the associated names or categories, triggering alerts when data is outdated.

Children