9 years ago
Monitor the size of a folder
I had a discussion with one of the support Engineers and like to raise this as a feature request. I would like to monitor a folder size on a windows and set up an alert if the utilization reaches "...
This would be a fairly simple embedded Groovy datasource. This is a good starting point for calculating directory size:
http://mrhaki.blogspot.com/2013/01/groovy-goodness-calculating-directory.html
My recommendation is to define a custom property with the target path and use Groovy to extract that at the script initialization, for example:
def hostname = hostProps.get("system.hostname"); def filepath = hostProps.get("dirsizecheck.filepath");
You can then use "dirsizecheck.filepath" as your "Applies To" to automatically run this DS for any hosts that have that defined. Not appropriate if you want multiple instances, though -- that would require more thought. Perhaps a comma or semicolon separated list in that property -- still learning the ropes on best practices.