Hi guys and girls
Is there a way to monitor a Linux directory for files older than x minutes?
Cheers
If you know how to accomplish this via command, then it can be made into a simple script and executed via a custom Linux/Unix script monitor.
I use this in NPM, I have a script that does exactly this. (files older then 150 mins)
export OLD=`find /home/dave/out -maxdepth 1 -mmin +150 -type f |wc -l`
if [ $OLD -ge 1 ]
then
echo -n " Critical - The area has files older then 150 Mins"
else
echo -n " Dave is OK"
fi
I then call the script from SNMP as below
# exec area to run scripts and return value
exec 1.3.6.1.4.1.98.1.5 check_age /bin/check-age.sh
A custom poller then polls this OID and reports errors as required.
Glad to hear about Dave...
There is a Linux File Age Monitor posted in the Content Exchange here. Is that what you need?