References > Template Reference > Files > File Count Script

File Count Script

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




Windows credentials valid on both the SAM and target server.

Monitored Components

For details on monitors, see SAM Component Monitor Types.

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 located in the script examples folder C:\Program Files\SolarWinds\Orion\APM\SampleScriptMonitors\WindowsScripts.