Hi,
Very new to Nagio and evaluating it as a monitoring solution for a company.
One of the tasks we need monitored is the count of files in a folder... so basically if there are files in a folder at a specific time... it's working well... if the folder is empty... we need an alert.
Is this something Nagio can help with?
Thanks in advance!!
Josh
Can Nagio monitor a folder for files
Re: Can Nagio monitor a folder for files
This should be pretty easy to do. You could make a bash script that does
And uses that (minus 1 since the first line it outputs is not a file) for a non-recursive file count. The grep removed all directory listings, and the wc -l gives a count of the files. Then it's just a matter of giving the proper exit code based on the file count.
Code: Select all
ls -l | grep --invert ^d wc -lFormer Nagios employee