Submit a ticketCall us

ebook60.pngHow to be a Cisco® ASA ace

Our eBook, Thou Shalt Not Pass…I Think?! can help you overcome the challenges of monitoring and managing Cisco ASA firewalls. This eBook is a great read if you’ve been frustrated with monitoring firewalls, managing ACL configs, and troubleshooting VPN connections.

Get your free eBook.

Home > Success Center > Server & Application Monitor (SAM) > SAM 6.6 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: April 13, 2018

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

Before coding and testing a script, review Windows script information and components and best practices for SAM. 

To monitor

  1. On the Web Console, click Settings > All Settings > SAM Settings > Create a New Template.
  2. Name the template, click Add Component Monitor, select Windows Script Monitor, and click Add.
  3. Provide a brief Description.
  4. Select credentials with appropriate permissions to run the script on the target server.
  5. In the Script Arguments field, type the Universal Naming Convention (UNC) path name for the directory to monitor.

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. Copy the following Visual Basic script, which retrieves the directory size, into the Script Body field:

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

  1. Specify the critical and warning thresholds for the desired directory size, and 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 > SAM Settings > 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.

When monitoring occurs, the Visual Basic code in the template will:

  1. Read the first argument passed to the UNC path name for the directory to monitor and store it in FolderPath.
  2. Create the Scripting.FileSystemObject and store it in fs.
  3. Retrieve the folder name from the saved command line argument and store it in FolderPath.
  4. Display the folder name and folder size as output.
  5. Display the folder size, measured in bytes.

The script does not perform error checking.

 
Last modified

Tags

Classifications

Public