Show Table of Contents
Chapter 21. Example: Remedying Resource Drift
Maintain servers, particularly production or business critical servers and applications, requires keeping rein on the configuration files and packages on those systems. When an unexpected change occurs, the system moves away from the administrator-defined state. That is configuration drift.
JBoss ON can monitor configuration files and target directories and track any changes to those area. This uses a drift definition which sets where the JBoss ON agent monitors configuration and at what frequency. If drift is detected, then the JBoss ON server can fire an alert and run an alert CLI script that reverts, or remedies, the changed configuration files.
21.1. The Plan for the Scripts
There are two different scripts in play because there are two different sets of situations for managing drift:
- First, there is a script to set up drift for a resource. This shell script runs through a series of setup steps at once:
- It creates the drift definition for a resource (through the
driftDef.jsCLI script). - It creates a generic
deploy.xmlrecipe, zips the drift directory, and creates a new bundle and bundle deployment (through thecreateBundle.jsCLI script). - After waiting for the initial snapshot, it then pins the snapshot to the definition (through the
snapshot.jsCLI script).
All of those files are generated by the shell script. - An alert definition has to be created through the UI (not the CLI), but it can be configured to use any drift detection as a condition and then to run a server-side script in response. This second script simply deploys the bundle that was made of the pristine base directory and overwrites the drift.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.