Page 1 of 1

Check command for noticing file count changes

Posted: Fri Aug 19, 2016 5:49 pm
by tmattingly
Is there a check command that when passed a file path on a windows share (or UNC path) that can tell if it sees more files than the last time it was called ?

For example, the first time its called on a path eg: \\server1\share\accounting would report that the file count has changed from 0 to (lets say) 100 current files. (Because the first time it was called with that path would recognize that there was no previous calls that had a count of files)
Its called again and sees the same number of files would indicate 'no chang'e in file count.
Another file gets added.
Its called again and see the number of files increased by 1 it would then report that additional files had been added

Is there such a check command?

Tom

Re: Check command for noticing file count changes

Posted: Mon Aug 22, 2016 12:25 am
by Box293
There are a lot of plugins that do file counts, but a change difference is not common.

You may have to write a wrapper script that executes the plugin that does the counting, and then stores / compares the result in a temp file.

NSClient++ has the file counting capabilities, you just need to write the wrapper script:

http://sites.box293.com/nagios/guides/c ... es-folders

Perhaps you might find something on the Nagios Exchange:

https://exchange.nagios.org/directory/S ... le%20count