How can I monitor the size of a Windows 2003 folder?
Ad Widget
Collapse
How do you monitor directy sizes
Collapse
X
-
Load unix like environment on windows (I would use cygwin)..
this will give you commands like du and awk (among others)
then I created a .bat file and put this line in c:\zabbix\zabbix_agentd.conf
UserParamter=lukes_dir,c:\cygwin\forluke.bat
stopped the windows agent...removed....installed....started
(probably didnt have to remove... the start probably reads the config file)
tested in windows
tested on zabbix_server (linux) system
Thats ONE way
Here are 2 files conatining DOS CMD window and Linux "get" windowComment
-
If you don't want to install cygwin, you can use Windows Script Host.
Example:
Create a text file : c:\folder_size.vbs
Paste:
Option Explicit
Dim objFSO, objFolder
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(WScript.Arguments(0))
WScript.StdOut.Write objFolder.Size
Set objFolder = Nothing
Set objFSO = Nothing
WScript.Quit(0)
Edit you agent configuration file:
UserParameter=folder_size_tmp,cscript c:\folder_size.vbs //Nologo d:\tmp
UserParameter=folder_size_windows,cscript c:\folder_size.vbs //Nologo c:\windows
UserParameter=folder_size[*],cscript c:\folder_size.vbs //Nologo $1
NB: I didn't manage to get the last line working... It fails miserably. That's why I have two "fixed" folder_size_XXX parameters.
You can then add folder_size_tmp to monitored items on host.
That's another way.
Last edited by Calimero; 23-11-2006, 12:04.Comment
-
Depending on the number of files (size doesn't matter
) it can take quite some time as it's a recursive process.
Once you've run the script windows will cache as much info as possible so that next time the script lists recursively files, most info will be read from cache... But cache expires/is removed (depending on how much RAM you have, I guess as I'm no windows expert)...
You can increase the Timeout value in your zabbix agent conf file, but I guess you increase it too much (< 5 ou < 10sec maybe).Comment
-
Hi,
tks for this script but it's no work for me :'(
Received value [Fodler does not exist] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]
not supported... folder exist and work when it is only him...
edit: i think it's because my folder is too big (200gb)... how i can correct that ?Last edited by ehermouet; 08-10-2012, 17:01.Comment
Comment