Nagios to monitor a directory that adds new log files

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
eocastilleja
Posts: 15
Joined: Mon Jul 25, 2016 3:52 pm

Nagios to monitor a directory that adds new log files

Post by eocastilleja »

Hello,
I would like Nagios to monitor a directory that adds a new log file every hour. I would like it to monitor and alert me to any abnormal changes in the new log's size compared to the norm.

How can I do this?

Thanks
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios to monitor a directory that adds new log files

Post by mcapra »

Here's a plugin that does that:
https://exchange.nagios.org/directory/P ... ir/details

Quick example of usage from the CLI:

Code: Select all

[root@localhost libexec]# ./check_filesize_dir -d /tmp -w 50 -c 100
WARNING: These files are over WARNING Size:  /tmp/yourfilename.test (50.00 MB)
[root@localhost libexec]# ./check_filesize_dir -d /tmp -w 51 -c 100
OK: No files to big
Former Nagios employee
https://www.mcapra.com/
eocastilleja
Posts: 15
Joined: Mon Jul 25, 2016 3:52 pm

Re: Nagios to monitor a directory that adds new log files

Post by eocastilleja »

Thank you. I have that working but can Nagios do this for me and create some sort of report or graph that keeps record of these changes?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios to monitor a directory that adds new log files

Post by mcapra »

Internally, the numbers used to create proper graphs/reports are referred to as "Performance Data". This particular plugin doesn't appear to be providing performance data, so Nagios Core won't be able to do any graphing with it's output.

This particular plugin would have to be modified to include performance data in accordance with the plugin development guidelines.

You could do really simple reports on when the check returned critical or when the check recovered, but that's about it. Nothing very granular in terms of what files were over the threshold and by how much.
Former Nagios employee
https://www.mcapra.com/
Locked