Forum Discussion
2 Replies
- Mike_Moniz
Professor
It may be possible but sounds complex and I worry about how long it would take to collect that data. As far as I know, Windows doesn't provide a fast way to get the size of a folder, so you will need to recursively add up the size of all the files or use a 3rd party tool that does it for you. I can see that easily taking over the 2-minute (default) limit of script DataSources. And you generally want your DataSources to run as fast as possible to not bog down the scheduler. You may need to get fancy with perhaps a separate script that collects the data seperately and stores it where LM can get to it, or limit it to specific folders, etc.
Googling "wmi folder size" seems to show it's possible to do, but perhaps it would be faster to use something like psremote instead.
- andrewj-t
Neophyte
I had a similiar situation where I wanted to monitor the size of certain folders on a central windows file server. What I ended up doing was enabling the FSRM role on the server, and created soft quotas on the folders I wanted to track. There is a Community LogicModule tagged with FSRM that can track these via WMI.
The main advantage of using FSRM, is that since the FSRM service tracks the space, you wouldnt need to recursively calculate the size of each folder when you wanted to poll it.
Probably not something you would want to do for every folder on the server, but could be useful if there are specific ones you are interested in tracking.