# FileWatcher Monitoring Extension

File watcher extension

An AppDynamics extension to be used with a stand-alone Java machine agent to provide metrics from file modification.

Metrics Provided

We provide following metric related to modification of a file.

- IsModified: 1 if file is modified in last minute and 0 if not.

- Size: A positive integer indicating the current size of the file.

- FileCount: Count of files in a directory.

Options/Configurations

isDirectoryDetailsRequired: false

If false then all the files under the directory will be ignored and only the directory level metrics will be published for the directories specified above. For files given above it will have no effect

isOldestFileAgeMetricRequired: true

If true then an extra metric will be shown that will give age of the oldest file (in seconds when the file was last modified and compared to current time) in the directory specified above. For files given above it will not display this metric

isFileCountRequired: true

If true then an extra metric will be shown that will give number of files in the directories specified above. For files given above it will not display this metric

ignoreHiddenFiles: true

If true then all the hidden files will be ignored monitoring.

Installation

2. Copy the FileWatcher directory to '<MACHINE_AGENT_HOME>/monitors'.

Configuration

Note-

Please make sure to not use tab (\t) while editing yaml files. You may want to validate the yaml file using a yaml validator http://yamllint.com/

1. Configure the file to be watched by editing the config.yaml file in <MACHINE_AGENT_HOME>/monitors/FileWatcher/. Below is the format

Important - displayName has to be unique for the file or folder

# List of filesfileToProcess:  - displayName: "test3"    path: "/Users/abhi.pandey/Documents/testFolder/test3.txt"  - displayName: "test1"    path: "/Users/abhi.pandey/Documents/testFolder/"  - displayName: "test2"    path: "/Users/abhi.pandey/Documents/testFolder/testFolder2/"#For the shared directory on windows the path should be like# path: "\\\\1.2.3.4\\abc\\def\\ProductI# If false then all the files under the directory will be ignored and only the directory level metrics will be published# for the directories specified above.# For files given above it will have no effectisDirectoryDetailsRequired: false# If true then an extra metric will be shown that will give age of the oldest file (in seconds when the file was last# modified and compared to current time) in the directory specified above.# For files given above it will not display this metricisOldestFileAgeMetricRequired: true# If true then an extra metric will be shown that will give number of files in the directories specified above.# For files given above it will not display this metricisFileCountRequired: true# If true then all the hidden files will be ignored monitoring.ignoreHiddenFiles: true# Make sure the metric prefix ends with a |metricPrefix: "Custom Metrics|FileWatcher|"

2. Configure the path to the config.yaml file by editing the <task-arguments> in the monitor.xml file. Below is the sample

 <task-arguments>
<!-- config file-->
<argument name="config-file" is-required="true" default-value="monitors/FileWatcher/config.yml" />
....
</task-arguments>

FileWatcher Extension Metrics-

Contributing

Always feel free to fork and contribute any changes directly via [GitHub][].

Community

Find out more in the [Community][].

Support

Version: 1.2

Controller Compatibility: 3.7 or later

[Community]: http://community.appdynamics.com/

[AppDynamics Center of Excellence]: mailto:ace-request@appdynamics.com

 Version: 2.0 Compatibility: 3.7+ Last Update: 05/07/2015
Attachments: