配置配置项类

OTRS::ITSM默认提供5个配置项类来表示所有IT相关元素:

如果这5个类别不能很好描述您的IT环境,可以通过OTRS::ITSM系统管理区的“通用目录”链接添加更多的类。创建了一个新的配置项类后,必须在配置项里输入类的定义。

图 11.4. 系统管理-通用目录

系统管理-通用目录


警告

CMDB数据模型和关联的配置项的设计,是不可被低估的任务。我们的经验显示:在修改OTRS::ITSM标准数据模型和/或配置项类之前,高度推荐首先在现有IT基础设施上验证概念想法。CMDB设计借助外部的帮助如ITIL实践专家已经被证明是有价值的。

Multiple input field types can be used when defining a class. These input field types are used to generate the edit form for creating new or editing already existing configuration items.

警告

Since version 6.0.18 the configuration item class definitions have to be written in YAML format.

The following block is an example of a form field called Operating System.

---
- Key: OperatingSystem
  Name: Operating System
  Input:
    Type: Text
    Size: 50
    MaxLength: 100
            

The following settings are available when adding or editing this resource. The fields marked with an asterisk are mandatory.

Key *

Must be unique and only accept alphabetic and numeric characters. If this is changed, data will not be readable from old definitions.

Name *

The label of the field in the form. Any type of characters can be entered to this field including uppercase letters and spaces.

注意

It is recommended to always use English words for names.

Names can be translated into other languages with custom translation files. See the Custom Translation File chapter in the developer manual.

Searchable

Defines whether the field is searchable or not. Possible values are 0 or 1.

Input *

Initiates the definition of the input field. An input field can contain the following attributes:

Type *

Defines the type of the element. Must be placed indented as a logical block. Possible values are:

  • Text: A single text field.

  • TextArea: A text field with multiple rows.

  • GeneralCatalog: A drop-down list for select a general catalog class. The general catalog class must be defined before use it as input type. The items of the general catalog class will be the options of the drop-down list.

  • CustomerCompany: A drop-down list for select a customer from the database back end.

  • Customer: A drop-down list for select a customer user from the database back end. The field can be used with wildcards (*).

  • Date: A field for select a date.

  • DateTime: A field for select date and time.

  • Integer: A drop-down list with integer numbers.

Required

Defines whether the field is mandatory or not. Possible values are 0 or 1.

Size

Defines the size of the text field. The value must be a positive integer.

MaxLength

Defines the maximum amount of characters that can be entered in the text field. The value must be a positive integer.

RegEx

A regular expression to restrict the possible values of the text field.

RegExErrorMessage

The displayed error message if the input does not match to definition given in the regular expression.

Class

The name of the class to be used for the drop-down list. Required for type GeneralCatalog.

Translation

Defines whether the items of a general catalog have to be translated. Possible values are: 0 or 1.

YearPeriodPast

Defines how many years in the past are available for selection from the present year in a date or date/time field. The value must be a positive integer.

YearPeriodFuture

Defines how many years in the future are available for selection from the present year in a date or date/time field. The value must be a positive integer.

ValueMin

Defines the minimum value for an integer field.

ValueMax

Defines the maximum value for an integer field.

ValueDefault

Defines the default value for an integer field.

CountMin

Defines at least how many of the current input types are available. The value must be a positive integer.

CountMax

Defines at most how many of the current input types are available. The value must be a positive integer.

CountDefault

Defines how many field should be displayed by default. The value must be a positive integer.

Sub

Defines a sub-element in the input field. The sub-element can contain its own input fields. It is useful if you have certain properties under a main property.

SuppressVersionAdd

This can be used to suppress creating a new version of a configuration item, when an attribute has changed. Possible values are UpdateLastVersion and Ignore.

  • UpdateLastVersion: If this value is set and there is no other updated attribute, the attribute is updated in the current version without creating a new version.

  • Ignore: If this value is set and there is no other updated attribute, nothing will be done, and no new version is created.

The following class definition is an example for all possible options.

---
- Key: OperatingSystem
  Name: Operating System
  Searchable: 1
  Input:
    Type: Text
    Required: 1
    Size: 50
    MaxLength: 100
    RegEx: Linux|MacOS|Windows|Other
RegExErrorMessage: The operating system is unknown.
  CountMin: 0
  CountMax: 5
  CountDefault: 1

- Key: Description
  Name: Description
  Searchable: 0
  Input:
    Type: TextArea
    Required: 0
  CountMin: 0
  CountMax: 1
  CountDefault: 0

- Key: Type
  Name: Type
  Searchable: 1
  Input:
    Type: GeneralCatalog
    Class: ITSM::ConfigItem::Software::Type
    Required: 1
    Translation: 1

- Key: CustomerCompany
  Name: Customer Company
  Searchable: 1
  Input:
    Type: CustomerCompany

- Key: Owner
  Name: Owner
  Searchable: 1
  Input:
    Type: Customer

- Key: LicenseKey
  Name: License Key
  Searchable: 1
  Input:
    Type: Text
    Size: 50
    MaxLength: 50
    Required: 1
  CountMin: 0
  CountMax: 100
  CountDefault: 0
  Sub:
  - Key: Quantity
    Name: Quantity
    Input:
      Type: Integer
      ValueMin: 1
      ValueMax: 1000
      ValueDefault: 1
      Required: 1
    CountMin: 0
    CountMax: 1
    CountDefault: 0

  - Key: ExpirationDate
    Name: Expiration Date
    Input:
      Type: Date
      Required: 1
      YearPeriodPast: 20
      YearPeriodFuture: 10
    CountMin: 0
    CountMax: 1
    CountDefault: 0

- Key: LastUsed
  Name: Last Used
  Input:
    Type: DateTime
    Required: 1
  CountMin: 0
  CountMax: 1
  CountDefault: 0
  SuppressVersionAdd: UpdateLastVersion
    

可以在图形配置区通过选择“修改类定义”来修改和修订属性:

图 11.5. 系统管理-配置项管理-修改

系统管理-配置项管理-修改


警告

为了确保OTRS::ITSM管理的数据的一致性,在系统管理区创建的信息不能按一般规则直接删除。如果你想不激活这些信息,将相应的列表选项从“有效”变成“无效”和“临时无效”即可。