We are having issues where lot of core file are being generated and dumped in /var/core. I would like to know how can I set up alert so it alert whenever a core file exists in the /var/core. I see there is a check_file_age plugin it alerts if the file does not exist, I want to get an alert if file exists. Please let me.
Thanks in advance.
Alert if file exists
Re: Alert if file exists
You will be better off using the folder_watch.pl plugin that ships with Nagios XI. You could run something like this:
You will get OK status from the plugin if the directory is empty, and will get CRITICAL if there is one or more files in it.
Code: Select all
/usr/local/nagios/libexec/folder_watch.pl -D /var/core -F '[^\0]+' -C 'ls -lA' -r -w 0: -c 0 -fBe sure to check out our Knowledgebase for helpful articles and solutions!