Ad Widget

Collapse

How do you monitor directy sizes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luketrot
    Junior Member
    • Nov 2006
    • 14

    #1

    How do you monitor directy sizes

    How can I monitor the size of a Windows 2003 folder?
    Last edited by luketrot; 21-11-2006, 21:26.
  • luketrot
    Junior Member
    • Nov 2006
    • 14

    #2
    Has anyone used Zabbix to monitor a directory size? This seems like a common task.

    Comment

    • RandySpinaGE
      Member
      • Jun 2006
      • 57

      #3
      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" window
      Attached Files

      Comment

      • Calimero
        Senior Member
        • Nov 2006
        • 481

        #4
        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

        • den_crane
          Senior Member
          • Feb 2006
          • 272

          #5
          Originally posted by Calimero
          UserParameter=folder_size[*],cscript c:\folder_size.vbs //Nologo $1
          wildcards not supported in windows agent.
          Last edited by den_crane; 23-11-2006, 12:56.

          Comment

          • Calimero
            Senior Member
            • Nov 2006
            • 481

            #6
            OK. Thanks for the info. At least I won't spend another hour trying to find out how it works.

            Comment

            • navtek007
              Senior Member
              • May 2005
              • 100

              #7
              do you have any problems with time outs?

              i have used a similar script and it works from from command prompt however via zabbix i get a timeout error when the folder size is quite large (>10-15G)

              Comment

              • Calimero
                Senior Member
                • Nov 2006
                • 481

                #8
                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

                • webgordy
                  Junior Member
                  • Jan 2006
                  • 6

                  #9
                  How can I monitor the size of a Windows 2003 folder?

                  Once the script is in place, how do you create the item in the GUI?
                  Thanks,

                  Comment

                  • thomson
                    Junior Member
                    • Jan 2011
                    • 3

                    #10
                    Folder size

                    Sorry to bring this old thread to life, but is there any news about monitoring folders? I need to monitoring some windows folders.

                    \\thomson

                    Comment

                    • ehermouet
                      Member
                      • May 2011
                      • 50

                      #11
                      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

                      Working...