Submit a ticketCall us

Solarwinds & Cisco Live! Barcelona
Join us from the 29th of January to the 2nd of February at Cisco Live 2018 in Barcelona, where we will continue to show how monitoring the network with SolarWinds will keep you ahead of the game. At our booth (WEP 1A), we will demonstrate how SolarWinds network solutions can help. As a bonus, we are also hosting a pre-event webinar - Blame the Network, Hybrid IT Edition with our SolarWinds Head Geek™, Patrick Hubbard on January 24th - GMT (UTC+0): 10:00 a.m. to 11:00 a.m. There's still time to RSVP.

Home > Success Center > Server & Application Monitor (SAM) > SAM 6.5 Administrator Guide > Manage application monitor templates and component monitors > Monitor large directories using the Windows Script Monitor

Monitor large directories using the Windows Script Monitor

Table of contents
No headers

Updated: 3-9-2017

You may need to log in with an administrator account to perform this action.

  1. On the Web Console, click Settings > All Settings > SAMSettings > Create a New Template.
  2. Name the template, click Add Component Monitor, then expand the Custom Component Monitors group, select Windows Script Monitor, then click Submit.
  3. Select credentials with appropriate permissions to run the script on the SolarWinds SAM server.
  4. Copy the following Visual Basic script to get the directory size into the Script Body field:

  5. Dim folderPath
    folderPath = WScript.Arguments(0)
    Set fs=WScript.CreateObject ("Scripting.FileSystemObject")
    Set folder= fs.GetFolder(folderPath)
    WScript.Echo "Message: Folder " &folderPath & " is " & folder.Size & " bytes large"
    WScript.Echo "Statistic: " & folder.Size





  6.  
  7.  
  8.  
  9.  
  1. Enter the UNC path name for the directory to monitor into the Script Arguments field.

Use the variable ${IP} for the IP address of the target node to which the monitor is assigned when the Windows Script monitor runs.

  1. Specify the critical and warning thresholds for the desired directory size, then click Submit.
  2. Create an assigned Application Monitor by assigning the Large Directory Monitor template to the node.
  1. On the Web Console, click Settings > All Settings > SAMSettings > Manually Assign Application Monitors.
  2. Select All in the Show only list, click Large Directory Monitor and then click Next.
  3. Click Manually Assign Application Monitors and Select All in the Show only list.
  4. Click Large Directory Monitor and then click Next.
  5. Locate and select the desired node and then click Next.
  6. Enter itadmin in the Credential Name field and then enter your credentials.
  7. Click Test, click Assign Application Monitors, and then click Done.

The Visual Basic code does the following:

  1. Reads the first argument passed to the UNC path name for the directory to monitor and stores it in FolderPath.

Creates the Scripting.FileSystemObject and stores it in fs.

  1. Retreives the folder name from the saved command line argument and stores it in folder.
  2. Displays the message with the folder name and the folder size.
  3. Displays the statistic (folder size in bytes).

The script does no error checking.

 
Last modified

Tags

Classifications

Public