References > Component Monitor Types > File Monitors > File Count Monitor

File Count monitor

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.

Statistic

The number of files in the directory that match the file extensions filter.

Agent-less or Orion agent for Windows requirements

Implementation of these components relies either on WMI or windows file share access to the target machine.

Orion agent for Linux requirements

Python implementation leverages native filesystem access directly from the python script running locally on the target agent machine. Due to the configuration settings, switching between agent-less and Orion agent for Linux will not establish a correct connection as the file path in UNC format will not work on a Linux-based computer. For details, see Linux system configurations for component monitors.

Field Descriptions

Description

This field provides a default description of the monitor. You have the ability to override the default description by adding to or replacing the text, which is automatically saved. The variable to access this field is ${UserDescription}.

Enable Component

Determines whether the component is enabled. Disabling the component leaves it in the application in a deactivated state not influencing either SolarWinds SAM application availability or status.

Credential for Monitoring

Select a credential that has read access to the file. If the credential you need is not already present in the credentials list, use the Quick Credentials section to add a new credential.

Full Directory Path

This field is the path to the directory. Specify the path in Universal Naming Convention (UNC) format. For example: \\computername\c$\. The path can include the variable ${IP} which represents the target node's IP address. There is a limit of 260 characters for this field.

File Extensions Filter

Specifies which files to include in the count based on the file extension. You can specify multiple file extensions separated by commas or spaces. To include all files, specify *.

Example for counting all files regardless of file extension
File Extensions Filter: *Example for counting files with .exe, .dll, and .bat extensions
File Extensions Filter: exe, dll, bat.

File Attributes Filter

Specifies which files to include in the count based on the file attributes. The default value is All Files.

Include Subdirectories

Specifies the file count should also include files located inside subdirectories

Convert Value

Checking the Convert Value check box opens the Formula box. From here, you have the ability to manipulate the returned value with a variety of mathematical possibilities. You can choose common functions from the drop down lists to manipulate the returned value, or you can select the Custom Conversion option. See setting Conversion value for more information.

Statistic Warning Threshold

This field allows you to specify when a threshold that indicates a warning level has been breached. Logical operators are in the drop down followed by a blank field for you to enter the value of this threshold. For example: Less than 15 for warning, Less than 5. for critical. See setting Application Monitor Thresholds for more information.

User Notes

This field allows you to add notes for easy reference. You can access this field by using the variable, ${UserNotes}.