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

Chapter 6. Using custom rule categories


You can create custom rule categories and assign MTA rules to them.

Note

Although MTA processes rules with the legacy severity field, you must update your custom rules to use the new category-id field.

Adding a custom category

You can add a custom category to the rule category file.

Procedure

  1. Edit the rule category file, which is located at <MTA_HOME>/rules/migration-core/core.windup.categories.xml.
  2. Add a new <category> element and fill in the following parameters:

    • id: The ID that MTA rules use to reference the category.
    • priority: The sorting priority relative to other categories. The category with the lowest value is displayed first.
    • name: The display name of the category.
    • description: The description of the category.

      Custom rule category example

      Copy to Clipboard Toggle word wrap
      <?xml version="1.0"?>
      <categories>
          ...
          <category id="custom-category" priority="20000">
              <name>Custom Category</name>
              <description>This is a custom category.</description>
          </category>
      </categories>

      This category is ready to be referenced by MTA rules.

Assigning a rule to a custom category

You can assign a rule to your new custom category.

Procedure

In your MTA rule, update the category-id field as in the following example.

Copy to Clipboard Toggle word wrap
<rule id="rule-id">
    <when>
        ...
    </when>
    <perform>
        <hint title="Rule Title" effort="1" category-id="custom-category">
            <message>Hint message.</message>
        </hint>
    </perform>
 </rule>

If this rule condition is met, incidents identified by this rule use your custom category. The custom category is displayed on the dashboard and in the Issues report.

Figure 6.1. Custom category on the dashboard

Custom rule category on the Dashboard
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat, Inc.