Documentation forServer & Application Monitor

File Count Script

This script checks the number of files in a directory. Specify the path as the script argument. The statistic is the number of files in the directory.

Prerequisites

None.

Credentials

Windows credentials valid on both the SAM and target server.

Component monitors

To learn more about component monitors, see Use SAM templates, application monitors, and component monitors.

File Count

This component monitor counts the number of files in a directory, optionally including its subdirectories. Files that do not match the file extension or file attribute type are ignored.

This monitor may fail if you attempt to count more than 20,000 files in a directory using the wildcard * filter extension. To get an accurate count of the files in such large directories, you must instead create a Windows Script monitor that runs the File Count script, like the sample provided here: C:\Program Files (x86)\SolarWinds\Orion\APM\SampleScriptMonitors\WindowsScripts.