如何添加CMDB配置项之间的关系?

与 OTRS 相关的各种安装配置等问题

Moderator: never

micshi
OTRS wizard
Posts: 191
Joined: 05 Jul 2011, 16:10
OTRS Version?: 3.2.2
Real Name: Micshi
Location: Beijing
Contact:

如何添加CMDB配置项之间的关系?

Postby micshi » 09 Dec 2012, 15:28

默认情况下,CMDB模块只定义了以下5种配置项之间的关系:
Alternative to - Alternative to
Connected to - Connected to
Depends On - Requried for
Includes - Part of
Relevant to - Relevant to

在我单位的实际应用中,仅这些配置项的关系是远远不够用的。我们还希望为CMDB添加更多的配置项的关系,例如:
Contains - Contained by
Cools - Cooled by
Defines resources - Gets resources from
Exchanges data with - Exchanges data with
Hosts - Hosted on
In Rack - Rack contains
In Room - Room contains
Runs on - Runs
Virtualizes - Virtualized by
......
那怎样才能添加上述新的配置项关系呢?
1. 首先,在/opt/otrs/Kernel/Config/Files目录下,创建一个xml文件CI_Relationships.xml(文件名无所谓,可以随便起个名字)。

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<otrs_config version="1.0" init="Config">
    <ConfigItem Name="LinkObject::Type###Contains" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'Contains'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Contains</Item>
                <Item Key="TargetName">Contained by</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###Cools" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'Cools'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Cools</Item>
                <Item Key="TargetName">Cooled by</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###DefinesResourcesFor" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'DefinesResourcesFor'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Defines resources for</Item>
                <Item Key="TargetName">Gets resources from</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###ExchangesDataWith" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'ExchangesDataWith'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Exchanges data with</Item>
                <Item Key="TargetName">Exchanges data with</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###Feeds" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'Feeds'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Feeds</Item>
                <Item Key="TargetName">Fed by</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###Hosts" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'Hosts'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Hosts</Item>
                <Item Key="TargetName">Hosted on</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###InRack" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'InRack'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">In Rack</Item>
                <Item Key="TargetName">Rack contains</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###InRoom" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'InRoom'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">In Room</Item>
                <Item Key="TargetName">Room contains</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###InZone" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'InZone'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">In Zone</Item>
                <Item Key="TargetName">Zone contains</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###Manages" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'Manages'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Manages</Item>
                <Item Key="TargetName">Managed by</Item>
            </Hash>
        </Setting>
    </ConfigItem>   
    <ConfigItem Name="LinkObject::Type###Members" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'Members'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Members</Item>
                <Item Key="TargetName">Member of</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###Powers" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'Powers'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Powers</Item>
                <Item Key="TargetName">Powered by</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###ReceivesDataFrom" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'ReceivesDataFrom'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Receives data from</Item>
                <Item Key="TargetName">Send data to</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::Type###RegisteredOn" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'RegisteredOn'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Registered on</Item>
                <Item Key="TargetName">Has registered</Item>
            </Hash>
        </Setting>
    </ConfigItem>   
    <ConfigItem Name="LinkObject::Type###RunsOn" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'RunsOn'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Runs on</Item>
                <Item Key="TargetName">Runs</Item>
            </Hash>
        </Setting>
    </ConfigItem>   
    <ConfigItem Name="LinkObject::Type###Virtualizes" Required="1" Valid="1">
        <Description Translatable="1">This setting defines the link type 'Virtualizes'. If the source name and the target name contain the same value, the resulting link is a non-directional one. If the values are different, the resulting link is a directional link.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="SourceName">Virtualizes</Item>
                <Item Key="TargetName">Virtualized by</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3205" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'Contains' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">Contains</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3206" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'Cools' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">Cools</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3207" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'DefinesResourcesFor' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">DefinesResourcesFor</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3208" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'ExchangesDataWith' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">ExchangesDataWith</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3209" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'Feeds' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">Feeds</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3210" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'Hosts' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">Hosts</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3211" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'InRack' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">InRack</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3212" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'InRoom' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">InRoom</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3213" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'InZone' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">InZone</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3214" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'Manages' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">Manages</Item>
            </Hash>
        </Setting>
    </ConfigItem>   
    <ConfigItem Name="LinkObject::PossibleLink###3215" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'Members' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">Members</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3216" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'Powers' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">Powers</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3217" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'ReceivesDataFrom' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">ReceivesDataFrom</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3218" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'RegisteredOn ' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">RegisteredOn </Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="LinkObject::PossibleLink###3219" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'RunsOn' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">RunsOn</Item>
            </Hash>
        </Setting>
    </ConfigItem>   
    <ConfigItem Name="LinkObject::PossibleLink###3220" Required="0" Valid="1">
        <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with other 'ITSMConfigItem' objects using the 'Virtualizes' link type.</Description>
        <Group>Framework</Group>
        <SubGroup>Core::LinkObject</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Object1">ITSMConfigItem</Item>
                <Item Key="Object2">ITSMConfigItem</Item>
                <Item Key="Type">Virtualizes</Item>
            </Hash>
        </Setting>
    </ConfigItem>   
   <ConfigItem Name="LinkObject::PossibleLink###3421" Required="0" Valid="1">
      <Description Translatable="1">This setting defines that a 'ITSMConfigItem' object can be linked with 'ITSMChange' objects using the 'Normal' link type.</Description>
      <Group>Framework</Group>
      <SubGroup>Core::LinkObject</SubGroup>
      <Setting>
         <Hash>
            <Item Key="Object1">ITSMChange</Item>
            <Item Key="Object2">ITSMConfigItem</Item>
            <Item Key="Type">Normal</Item>
         </Hash>
      </Setting>
   </ConfigItem>
   <ConfigItem Name="LinkObject::PossibleLink###3422" Required="0" Valid="1">
      <Description Translatable="1">This setting defines that a 'ITSMChange' object can be linked with 'ITSMConfigItem' objects using the 'Normal' link type.</Description>
      <Group>Framework</Group>
      <SubGroup>Core::LinkObject</SubGroup>
      <Setting>
         <Hash>
            <Item Key="Object1">ITSMConfigItem</Item>
            <Item Key="Object2">ITSMChange</Item>
            <Item Key="Type">Normal</Item>
         </Hash>
      </Setting>
   </ConfigItem>
</otrs_config>

2. 执行下述命令,以便将这个文件中的配置导入至OTRS系统中
cd /opt/otrs/bin
./otrs.RebuildConfig.pl
./otrs.DeleteCache.pl
3. 当你建立配置项链接时,你就可以选择这些配置项关系了。
4. 修改中文翻译文件/opt/otrs/Kernel/Language/zh_CN_Custom.pm,将英文的配置项关系翻译成中文。


另外,在工单处理中,将某个配置项链接至工单,默认情况下你只能选择下面3种工单至配置项的关系。
Alternative to - Alternative to
Depends On - Requried for
Relevant to - Relevant to
同理,你也可能通过定制xml文件,添加工单与配置项之间的关系。

micshi
OTRS 3.2.2, ITSM 3.2.2, SystemMonitor
Ubuntu, Apache2, MySQL 5
My OTRS Blog
OTRS Basic Concept Training
OTRS Demo Instance

never
Moderator
Posts: 32
Joined: 20 Apr 2010, 11:25
OTRS Version?: 2.4.15
Location: HongKong
Contact:

Re: 如何添加CMDB配置项之间的关系?

Postby never » 09 Dec 2012, 17:12

好文!谢谢你的分享!
Debian 5, OTRS 2.4.15 / 3.2.x in testing
HP DL360G5: Intel Xeon 5110 1.6G *2, 2G DDR, 72G SAS RAID-0
中文 QQ 群号 157191248


Return to “安装和使用”

Who is online

Users browsing this forum: No registered users and 1 guest