Counting the number of files in a folder requires two watchers, a directory Monitor then a threshold monitor. I have included steps which include how to configure the monitor directives using the VAIM UI and manually defining the monitor directives in the sysedge.cf.
Configuring Directory and Threshold watchers using VAIM UI: First: Identify the directory you want to monitor.
Then configure the Directory Monitor using the UI.
In this example, we will monitor files located in C:\Program Files\CA\SystemEDGE\config\port161 folder. Note: If you notice the space between Program Files, in the UI, you do not need to enclose the space.
Validate in the Explore -> Select Agent -> Summary Tab and validate the threshold entry state is Active. Manual create directory and threshold monitor directives in sysedge.cf Manually entering Monitor Directory and Threshold Directives in the c:\Program Files\CA\SystemEDGE\data\port161\sysedge.cf file. Directory Monitor Directive
template watch logfile <index> <flags> <file> <regexpr> <descr> <action> <interval> <severity> watch logfile 11 0x4800 'c:\Program Files\CA\SystemEDGE\data\port161' .* '' '' 60 none
Threshold Monitor Directive
template monitor oid <oid> <index> <flags> <interval> <stype> <oper> <thresh> <descr> <action> <supIndex> monitor logMonitorEntry 'c:\Program Files\CA\SystemEDGE\data\port161' logMonitorLogFileCount 15 0x0 60 absolute >= 11 'Monitor for Sysedge Port 161 Folder' '' logMonitorEntry 'c:\Program Files\CA\SystemEDGE\data\port161' logMonitorLogFileCount ok