Scan disk usage on a remote machine using VShell® for Windows and VRALib
This tip describes how to determine the current disk usage on
remote machines running VShell 3.8 for Windows or newer. This benefits the system
administrator who needs an easy way to monitor drive space on remote systems without
physically visiting each machine.
Scanning disk usage uses the VRALib COM interface, version 6.7 or newer. The VRALib
API allows scripting of SSH2 connections and can provide remote drive information
through the FileSystemObject when connected to VShell 3.8
VRALib is included with the Windows versions of the VShell and ClientPack products.
VShell 3.8 or newer versions have added support for drive
enumeration via the email@example.com SFTP
extension. This allows VShell to return information about all drives on the remote system,
including fixed drives, CD-ROM drives, removable drives, and network drives. The drive path
and letter, drive type, file system type, total size, and free space can be determined for
each of the drives.
The example Visual Basic script in the link below shows how to use VRALib to gather
and report the disk usage for all fixed drives on a remote machine. The script takes optional
command-line arguments for hostname, port, username, and password. Alternatively, the default
connection parameters can be specified from within the script. The script will print the drive
path, filesystem, total size, free space, and the calculated percentage of free space for all fixed
drives on the remote system.