Seconds Since File Updated

Version 3

    I had need to monitor a log file and alert if not updated within 5 minutes during the day and 1 hour during the night. I did this using Powershell. Here is the script in its most basic form.



    • Enter the path to the file (I'm using it for a log but it can be any file type) in the script arguments using the ${IP} variable (eg. \\${IP}\c$\Program Files\example\audit.log)
    • Set the execution mode to 'remote host'
    • You can alert in two ways: the simplest is to set a warning/critical threshold on the script output which will appear once you've run a test and the other (which was my case) the times differ depending on the time of day so I created multiple alerts to watch this component set to be active at different times of day. I can share this too for anyone who think they might find it useful.