此内容没有您所选择的语言版本。

4.6. Extended Example: Drift Monitoring


Drift monitoring is allowed for a resource by defining a default drift definition in the plug-in. In the plug-in configuration, the drift definition creates a default template that indicates that a resource supports drift monitoring. (Additional templates can be created by users or the default template can be revised when it is applied to a resource.)
At its most basic, the drift definition sets a target location for the drift system to monitor. This location can be identified from several different configuration areas for the resource:
  • fileSystem, which is any directory on the machine local to the resource
  • pluginConfiguration, which is defined property in the resource plug-in, like a home directory
  • resourceConfiguration, a resource configuration property
  • measurementTrait, a trait that is gathered about the resource
This target location is the base directory. The element which identifies where to find the value for the base directory the value name, while the actual value is the context. For example, for a base directory of /etc/, the elements in the drift definition are:
Value name: fileSystem
Value context: /etc
Copy to Clipboard Toggle word wrap
The most basic drift definition only needs to define the value name and context.

Example 4.23. Base Directory Only

     <drift-definition name="Template-File System"   
                       description="Monitor the file system for drift. Definitions should set a more specific base directory as the file system root is not recommended.">  
         <basedir>  
             <value-context>fileSystem</value-context>  
             <value-name>/</value-name>  
         </basedir>  
     </drift-definition>
Copy to Clipboard Toggle word wrap
It is possible to set more information, like subdirectories or file types which should be explicitly included or excluded. These are additional paths, beneath the base directory, and file types can be identified by patterns.
If a directory or file type is explicitly included, then all other files and directories are implicitly excluded (and vice versa, if something is explicitly excluded, everything else is implicitly included). There can be multiple paths and patterns defined.

Example 4.24. Included Paths and Patterns

<drift-definition name="Template-Base Files"
                  description="Monitor base application server files for drift. It defines monitoring for some standard sub-directories of the HOME directory.  Note, it is not recommeded to monitor all files for an application server. There are many files, and many temp files.">
    <basedir>
         <value-context>pluginConfiguration</value-context>
         <value-name>homeDir</value-name>
    </basedir>
    <includes>
	<include path="bin" pattern="*/*.sh" />
        <include path="lib" />
        <include path="client" />
    </includes>
</drift-definition>
Copy to Clipboard Toggle word wrap
NOTE
Multiple drift definitions can be defined for a resource type, but each drift definition defined only a single base directory to monitor for drift.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat