Ad Widget

Collapse

File date Check last change

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rbr4g4
    Junior Member
    • May 2016
    • 3

    #1

    File date Check last change

    Let try to explain before what I need.
    Well, I need to set up a monitor to files that were changed in the last 24 hours.
    Eg, If a file at E:\folder1\bkp.sql was not changed in the last 24 hours, it should show at Dashboard as a information and send me mail to Admin with this information

    Does someone has something close of this configuration ?

    For information, I'm working with Zabbix_client installed at Windows machine.

    Thanks in advanced
  • zabb
    Junior Member
    • Oct 2014
    • 5

    #2
    Re: File date Check last change

    Hi,
    you can count the files younger specific age with powershell if you enable remote commands on server. Alert if item < x.
    Script not THAT beautiful but works for me
    Code:
    if (!([System.Object[]](gci E:\folder1 -Filter *.* | ? { $_.LastWriteTime -gt (Get-Date).AddDays(0).AddHours(-24).AddMinutes(0)})).Count) {Write-Host "0"} else {([System.Object[]](gci E:\folder1 -Filter *.* | ? { $_.LastWriteTime -gt (Get-Date).AddDays(0).AddHours(-24).AddMinutes(0)})).Count}
    zabb

    Comment

    Working...