Ad Widget

Collapse

How can Zabbix monitor files older than a specified time?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sixdigit
    Junior Member
    • Nov 2020
    • 1

    #1

    How can Zabbix monitor files older than a specified time?

    Hello all, I'm new to Zabbix and I have a problem that I need some help with.

    I want to monitor files that are older than 30 minutes in a directory. I'm thinking of using this command:
    Code:
    # find /lvm_encrypted_dir/sftp/*/incoming ! -newermt '30 minutes ago' | wc -l
    In the agent conf file, I've added this:
    Code:
    UserParameter=sftp.check.older30mins,/bin/find /lvm_encrypted_dir/sftp/*/incoming ! -newermt '30 minutes ago' | wc -l
    This is for my item:
    Code:
    Key: sftp.check.older30mins
    - This refreshes every 30s.

    For the Trigger, I used this:
    Code:
    {<SERVERNAME>:sftp.check.older30mins.last(300)}>0
    Zabbix is sending out alerts but it resolves itself after 4-5 minutes even if the files are still in the directory. I was expecting that it will only send out resolution alerts if and when it doesn't see any files in the directory anymore. What am I missing?

    Appreciate any help I can get!

    Thanks!
Working...