Filesystem monitoring extension

  • Latest Dynatrace
  • Extension

Monitor your files and folders.

Get started

Overview

Monitor your files on Windows and Linux OneAgent installations.

Targeting can be done by host, host group, management zone or environment. Tags can be applied to segregate your configurations (100 configurations maximum).

For each path check, Dynatrace will create an entity and link it to the matching host. This way, extension filtering and tagging is possible to view your data. The same can be done with alerts.

Compatibility information

  • This is a OneAgent extension compatible with Windows and Linux.
  • OneAgent version 1.310+
  • Dynatrace version 1.318+
  • Azure blob storage is supported.

Activation and setup

  1. Go to the Filesystem extension in the Dynatrace Hub.

  2. Create a new configuration.

  3. For each check, select Add check.

  4. Select the check type and enter the relevant details, and then, select Next.

  5. Enter a description for your configuration and select Activate.

Wait until the state of the deployment changes from pending to ok. This might take several minutes.

Details

Path examples

  • Count the number of log files inside /var/log/myapp:
    • Select check type = count
    • Set the path to /var/log/myapp/*.log
  • Count the number of log files inside c:\temp:
    • Select check type = count
    • Set the path to c:\temp\*.log
  • Count the number of logs files inside /var/log/myapp and any subdirectories:
    • Select check type = count
    • Set the path to /var/log/myapp/**/*.log
  • Does the directory mydir inside /tmp exist?
    • Select check type = count
    • Set the path to /tmp/mydir
    • Ensure that the count directories toggle is enabled
  • Count the number of files inside /tmp:
    • Select check type = count
    • Set the path to /tmp/*
  • Return the total size of all files files inside /var/log/myapp:
    • Select check type = size
    • Set the path to /var/log/myapp/*
  • Return the age of the oldest file in /tmp/test/:
    • Select check type = modification age
    • Unselect user newest file
    • Set the path to /tmp/test/*
  • Return the number of log files older than 1 hour in /tmp/test:
    • Select check type = modification age count
    • Set Age comparison operator to Older than
    • Set the threshold to 60
    • Set the path to /tmp/test/*.log
  • Check whether /data/mount-data is mounted:
    • Select check type = mount point
    • Set the path to /data/mount-data
  • Check that today's log has been produced: /var/mylog20222211.log:
    • Select check type = count
    • Set the path to /var/mylogYYYYMMDD.log
    • Accepts DDMMYYYY, DD-MM-YYYY, DD_MM_YYYY, YYYYMMDD, YYYY-MM-DD, YYYY_MM_DD.
    • The date will be the local date where the OneAgent/extension is running.
    • You can append dates to paths, for example C:\DDMMYYYY|-1d, to dynamically resolve the date relative to each run time. The extension recalculates the date on every run.

Schedules

If no schedule is selected, the check runs continuously. To exclude specific days, select a schedule and clear the checkboxes for the days you want to skip, for example, Sunday.

You can define multiple time windows by entering start times separated by semicolons. For each start time, the Schedule duration field determines the end time. In this example, the check runs at 10:00 and 12:00, each for 1 hour.

Advanced scheduling options let you run checks on a specific day of the month, on the n-th weekday of the month, or on selected months and days for yearly scans.

Additional metadata

Each file check supports up to three metadata fields for providing extra context. These fields map to the info1, info2, and info3 dimensions on the related metrics.

Local File Systems

  • On Linux, the extension supports local file systems accessible to the dtuser account. Files must be readable by dtuser; otherwise, the extension can't detect them. To use a different account, configure the run_as option with sudo -u <username>.

  • On Windows, The file must be at least readable by LOCAL SERVICE if not, it will be invisible to the extension.

NFS

  • On Linux, ensure dtuser or the run_as user has the required permissions.
  • On Windows, NFS drives are visible only when running as another user, either by entering credentials directly or by selecting an account from the credential vault.
  • Only standard NFS drives connected via Windows Explorer are supported.
  • Azure Blob storage is supported.
    • When selected, two new fields will appear: the Azure account and the key.
    • Make sure OneAgent has network connectivity to Azure.

Run As additional information

Windows Run As

  • On Windows, the run as user must be able to login locally.
    • Logon Type policy change to allow type 2
  • If you are using a local user for the domain enter prefix the username with ".\" example: .\username

Linux Run As

  • sudo
    • When no username is entered dtuser will run sudo on the checks to elevate privileges.
      • Ensure dtuser has sudo permissions and is setup passwordless in the sudoers file.
    • If you enter a username, it will run sudo -u <username> command However, sudo requires the calling user to have permissions. dtuser must be setup passwordless as before above.
  • sesu
    • A username must be entered. This account being used must be setup to be run passwordless. it will run sesu -<user> -c command

Checks can be disabled for specific days and at specific times.

Metrics

  • File count—Number of files matching a pattern
  • File age count—Number of files matching a pattern and an age
  • File age—Age of a specific file (oldest or newest when returning more than 1 file)
  • File size—Size of the files in bytes
  • Mount point—Mount point mounted on Unix NFS

Data

  1. To view your data, go to the Data explorer.

  2. In the metric box type, select filesystem and select the relevant metric. You can split metrics by host and path, for example.

  3. To drill down to the host or file check, hover on a data point and select View path or View host list.

Alerts

To create alerts, see metric events for alerting.

Feature sets

When activating your extension using monitoring configuration, you can limit monitoring to one of the feature sets. To work properly, the extension has to collect at least one metric after the activation.

In highly segmented networks, feature sets can reflect the segments of your environment. Then, when you create a monitoring configuration, you can select a feature set and a corresponding ActiveGate group that can connect to this particular segment.

All metrics that aren't categorized into any feature set are considered to be the default and are always reported.

A metric inherits the feature set of a subgroup, which in turn inherits the feature set of a group. Also, the feature set defined on the metric level overrides the feature set defined on the subgroup level, which in turn overrides the feature set defined on the group level.

Troubleshooting

If you are not getting the expected results, typically a metric with the value 0 (file size or count for instance) or -1 (file age), it's because the extension doesn't have sufficient privileges to see the folder content. The files are invisible to the extension and it will report the value 0 or -1.

Grant access to all users first in the location and try again. The value should be correct. Once done, narrow down the access to the correct account or group.

Don't use the file size metric for calculating the size of big volumes/mount points recursively such as c:\\**, as it will scan each file and time out. The same applies to the other metrics when using recursive search with a very large number of files or sub directories.

For more information on which user runs the oneAgent, see:

Related tags
StoragePythonOtherOtherInfrastructure Observability