Installation and Usage of the DriveMonitor script.
Author: Wade WhitmoyerCreated: 05-28-2013 11:06 AMLast Updated: 08-18-2021 11:13 AM

Products to which this article applies

  • Intelli-Site

Introduction

The DriveMonitor script polls the Windows Disk Manager of one or more computers to determine the amount of free space available on each of its fixed drives. In the event the available free space on a disk falls below the user-specified threshold, an email notification is sent to the specified address. The results of each polling cycle are inserted into an SQL database table specified by the user. This table must be in the Intelli-Site database for Intelli-Site to display.  

The DriveMonitor.vbs file can be located anywhere on the machine.  We suggest a shortcut to it be placed in the startup folder for "All Users". The DriveMonitor script will have no visible window, but will show in the process list as wscript.exe

Procedure

Installation and Usage:

  • Create the log table:
    • Open Intelli-Site and enter Design mode.
    • Expand "Database"->"Cardlist".
    • Right-click the "Tables" node and choose "Add Node and Edit"
    • In the resulting Window Enter "DriveMonitor" into the "New Table Name" field.
    • Click the "Add Field" button and enter the parameters for each field as follows:
      • Field Name: "Server" Type:"Text"
      • Field Name: "Drive" Type:"Text"
      • Field Name: "FreeSpace" Type:"Text"
      • Field Name: "TimeStamp" Type:"Date"
    • Click "OK"
  • Install and Configure the Script File:
    • Copy the vbs file to a location of your choice to which all users have write access. For simplicity, we will place the file in the Windows folder and use the %WINDIR% variable for the path.
    • Open the Windows Start Menu, right-click the "Startup" folder and choose "Explore All Users".
    • In the resulting Explorer window, click the "File" menu and choose "New"->"Shortcut".
    • Follow the instructions on the screen to create a shortcut for the DriveMonitor.vbs file.
    • Right-click the resulting shortcut icon and choose "Properties".
    • Change the "Target:" field to the following:
      • Method 1:
        • "wscript %WINDIR%DriveMonitor.vbs" and append the appropriate parameters as follows:
          • /emailFrom:
            • Email account from which to send alert emails
          • /emailTo: 
            • Email address to send alert emails to
          • /emailPassword:
            • Password for the sender's email account
          • /SMTPServer:
            •  Email server name
          • /SMTPPort:
            • SMTP Port for sending emails
          • /SMTPUseSSL
            • Connect to email server using SSL
          • /WaitTime:
            • Amount of time in minutes between checking disk space
          • /SQLServer:
            • SQL Server name for logging
          • /Database:
            • Database name for logging results
          • /dbUser:
            • SQL username, if none specified, windows authentication will be used
          • /dbPassword:
            • SQL password
          • /AlertHigh:
            • Minimum percentage of disk space before warning email is sent expressed as decimal
          • /hosts:
            • list of machines to monitor separated by commas, no spaces, please
        • Apply your changes.
      • Method 2:
        • "wscript %WINDIR%DriveMonitor.vbs /D"
        • Apply your changes.
        • Edit the DriveMonitor.vbs and set the default values to match your requirements.

Products to which this article applies

  • Intelli-Site