プライマリ・コンテンツに移動
Oracle® Enterprise Manager CA Service Desk Ticketing Connector構成ガイド
for Enterprise Manager 13c リリース2
E94910-02
目次へ移動
目次

前
次

5.2 チケット・テンプレートの読取りおよびマッピング

表5-1は、デフォルト・テンプレートを使用したチケットの作成を示しています。この表は、チケット・テンプレートの内容の解釈に役立ちます。表内の*はリテラル文字列を示し、**は属性が適用されるかどうかを示します。

CASD_Default_Incident_AutoClose.xslCASD_Default_Incident.xslでは、チケット作成マッピングは同じです。

表5-1は、チケット作成に対するService Deskチケット属性と、対応するEnterprise Managerインシデント値のマッピングを示しています。

表5-1 チケット作成マッピング(すべてのテンプレート)

Service Deskチケットの属性 Enterprise Managerインシデントの属性

Summary

Message

該当なし

Description

インシデントの場合:

EMUser - チケットの自動発行によってチケットが作成された場合の通知ルール所有者、およびチケットの手動発行によってチケットが作成された場合のEnterprise Managerログイン・ユーザー。

その他のインシデント情報には次のものがあります。

Source Name

Source Owner - 例: Sysman

Source Type

Source SubType

Target Name

Target Type

Target URL

TargetProperties** - 定義されたターゲット・プロパティの名前と値のペア。次に例を示します。

Line of business:

Finance

Owner:

Finance-DB Team

Severity

Priority

Creation Date - インシデント作成日

Last Updated Date

Owner - インシデント所有者

Notification Rule Name

URL - インシデント・コンテキストのメトリック詳細ページへのURL。

Incident Status

Incident Acknowledge Flag

Incident Auto Close

Incident Escalation Level

インシデント・コンテキストからの値

Priority

重大度コードに基づく

メトリック・インシデントの場合:

  • 重大度がFatalの場合、PriorityはMedium-High (2)に設定されます。

  • 重大度がCriticalの場合、PriorityはMedium (3)に設定されます。

  • 重大度がWarningの場合、PriorityはMedium-Low (4)に設定されます。

  • それ以外の場合、PriorityはLow (5)に設定されます。

Reported By

該当なし

Administrator

Activity Log

Description属性と同じ内容です。

前述のDescription属性を参照してください。

z_em_connector_id (カスタム・フィールド)

Connector GUID

CASDコネクタにのみ設定されます。このフィールドは、CASD未公開コネクタには設定されません。

表5-2は、チケット更新に対するService Deskチケット属性と、対応するEnterprise Managerインシデント属性のマッピングを示しています。CASD_Default_Incident.xslとCASD_Default_Incident_AutoClose.xslのマッピング・テンプレートはほぼ同じです。唯一の違いはステータス・フィールドです。AutoCloseテンプレートではステータスがCLに設定され、もう1つのテンプレートではフィールドが設定されません。この違いは表に記載されています。

表5-2 チケット更新(すべてのテンプレート)

Service Deskチケットの属性 Enterprise Managerインシデントの属性

Identifier

TicketID - チケットIDから内部識別子のみを抽出します。

該当なし

Summary

Message

該当なし

Description

作成トランザクションのDescription属性と同じ内容です。

表5-1を参照してください。

Priority

重大度コードに基づきます。

JobStatus - ジョブ・ステータス・イベントに適用されます。

メトリック・インシデントの場合:

  • 重大度がFatalの場合、PriorityはMedium-High (2)に設定されます。

  • 重大度がCriticalの場合、PriorityはMedium (3)に設定されます。

  • 重大度がWarningの場合、PriorityはMedium-Low (4)に設定されます。

  • それ以外の場合、ImpactはLow (5)に設定されます。

Status

メトリック・インシデントの場合:

Grace Period

Severity

メトリック・インシデントの場合:

Grace PeriodがYesに設定されている場合、StatusはOpen (OP)に設定されます。

AutocloseテンプレートでSeverityがClearに設定されている場合、StatusはClose (CL)に設定されます。

それ以外の場合、Statusは設定されません。

Activity Log

Description属性と同じ内容です。

表5-1を参照してください。

z_em_connector_id (カスタム・フィールド)

Connector GUID

CASDコネクタにのみ設定されます。このフィールドは、CASD未公開コネクタには設定されません。

例5-1のXSLTファイルを解読する際の参照として、マッピング表(表5-1および表5-2)を使用してください。

例5-1 CASD_Default_Incident_AutoClose.xslの注釈付きソース・コード

<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version="1.0" 
              xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
              xmlns:ns0="http://xmlns.oracle.com/sysman/connector">
 
  <!--
This template creates an incident type ticket within CA Service Desk with default settings. On update, the ticket summary is updated with the latest event message and priority information as an activity log entry. 
  
  -->
  
  <xsl:template match="ns0:EMIncident">
    <xsl:choose>
      <xsl:when test="normalize-space(ns0:TicketID) = ''">
        <!-- EDIT THE TAG VALUES BELOW TO CHANGE HOW A CASD INCIDENT IS FILLED
              DURING INCIDENT CREATION -->    
        <iwaveaf:create xmlns:iwaveaf=
         "http://iwavesoftware.com/services/adapter-framework">
          <incident>
 
            <!-- Set the CASD Incident Priority-->
            <!--     Possible values for priority: -->
            <!--       1 = High                    -->
            <!--       2 = Medium-High             -->
            <!--       3 = Medium                  -->
            <!--       4 = Medium-Low              -->
            <!--       5 = Low                     -->
            <!--       None                        -->
            <xsl:choose>
              <xsl:when test="ns0:SystemAttributes/ns0:SeverityCode = 'FATAL'">  
                <priority>2</priority> <!-- CASD Medium-High -->
              </xsl:when>
              <xsl:when test="ns0:SystemAttributes/ns0:SeverityCode = 'CRITICAL'">  
                <priority>3</priority> <!-- CASD Medium -->
              </xsl:when>
              <xsl:when test="ns0:SystemAttributes/ns0:SeverityCode = 'WARNING'">  
                <priority>4</priority>  <!-- CASD Medium-Low -->
              </xsl:when>
              <xsl:otherwise>
                <priority>5</priority> <!-- CASD Low -->
              </xsl:otherwise>
            </xsl:choose>
 
            <!-- Set the CASD Incident Description -->
            <description>
              <xsl:call-template name="getDescription">
	              <xsl:with-param name="message">Incident created by Oracle Enterprise
                Manager CA Service Desk Connector</xsl:with-param>    
                <xsl:with-param name="addHref">true</xsl:with-param>    
              </xsl:call-template>
            </description>
 
            <!-- Set the CASD Incident Reported By -->
            <!-- This field is defaulted to Administrator but can be changed to
              any to any valid -->
            <!-- CASD account. A lookup will be performed based on the first, 
              middle and last names. -->
            <customer>
              <firstName></firstName>
              <middleName></middleName>
              <lastName>Administrator</lastName>
            </customer>

            <!-- Set the CASD Incident Priority-->
            <!--     Possible values for priority: -->
            <!--       1 = High                    -->
            <!--       2 = Medium-High             -->
            <!--       3 = Medium                  -->
            <!--       4 = Medium-Low              -->
            <!--       5 = Low                     -->
            <!--       None                        -->
            <xsl:choose>
              <xsl:when test="ns0:SystemAttributes/ns0:SeverityCode = 'FATAL'">  
                <priority>2</priority> <!-- CASD Medium-High -->
              </xsl:when>
              <xsl:when test="ns0:SystemAttributes/ns0:SeverityCode = 'CRITICAL'">  
                <priority>3</priority> <!-- CASD Medium -->
              </xsl:when>
              <xsl:when test="ns0:SystemAttributes/ns0:SeverityCode = 'WARNING'">  
                <priority>4</priority>  <!-- CASD Medium-Low -->
              </xsl:when>
              <xsl:otherwise>
                <priority>5</priority> <!-- CASD Low -->
              </xsl:otherwise>
            </xsl:choose>
 
            <!-- Set the CASD Incident Description -->
            <description>
              <xsl:call-template name="getDescription">
	              <xsl:with-param name="message">Incident created by Oracle Enterprise
                 Manager CA Service Desk Connector</xsl:with-param>    
                <xsl:with-param name="addHref">true</xsl:with-param>    
              </xsl:call-template>
            </description>
 
            <!-- Set the CASD Incident Reported By -->
            <!-- This field is defaulted to Administrator but can be changed to
              any to any valid -->
            <!-- CASD account. A lookup will be performed based on the first,
              middle and last names. -->
            <customer>
              <firstName></firstName>
              <middleName></middleName>
              <lastName>Administrator</lastName>
            </customer>
 
            <!-- Set the CASD Incident Summary -->
            <summary><xsl:value-of
              select="ns0:SystemAttributes/ns0:Summary"/></summary>
 
            <!-- Add a CASD Activity log entry -->
            <logs>
              <log>
                <description>
                  <xsl:call-template name="getDescription">
                    <xsl:with-param name="message">Incident created by Oracle
                     Enterprise Manager CA Service Desk Connector</xsl:with-param>
                    <xsl:with-param name="addHref">false</xsl:with-param>    
                  </xsl:call-template>
                </description>
              </log>
            </logs>
 
<!-- Set the z_em_connector_id custom field in CASD to the EM event identifier. The custom field is required for the publishTicket operation and must be added by an CASD administrator -->
<!-- If the publishTicket operation is not going to be used, this code can be commented out. -->
            <extended-fields>
              <string-field name="z_em_connector_id"><xsl:value-of
                select="ns0:ConnectorGUID"/></string-field>
            </extended-fields>
 
        <!--  UNCOMMENT THE TAGS YOU WISH TO HAVE MODIFIED WHENEVER   -->
        <!--  THE INCIDENT IS CREATED, AND GIVE THEM DESIRED VALUES   --> 
 
            <!-- <status></status> -->
            <!--     Possible values for status: -->
            <!--         ACK (Acknowledged) -->
            <!--         CL (Closed) -->
            <!--         OP (Open) -->
            <!--         WIP (Work In Progress) -->
            <!--         AVOID (Avoided) -->
            <!--         FIP (Fix in Progress) -->
            <!--         CLREQ (Close Requested) -->
            <!--         KE (Known Error) -->
            <!--         CNCL (Cancelled) -->
            <!--         HOLD (Hold) -->
            <!--         CLUNRSLV (Closed-Unresolved) -->
            <!--         PRBAPP (Problem-Approved) -->
            <!--         PC (Problem-Closed) -->
            <!--         PF (Problem-Fixed) -->
            <!--         PRBANCOMP (Problem-Analysis Complete) -->
            <!--         PO (Problem-Open) -->
            <!--         RSCH (Researching) -->
            <!--         RE (Resolved) -->
            <!--         PRBREJ (Problem-Rejected) -->
 
            <!-- <impact></impact> -->
            <!--     Possible values for impact: -->
            <!--         1-Entire Organization -->
            <!--         2-Multiple Groups -->
            <!--         3-Single Group -->
            <!--         4-Small Group -->
            <!--         5-One person -->
            <!--         None -->
 
            <!-- <urgency></urgency> -->
            <!--     Possible values for urgency: -->
            <!--         1-As Possible -->
            <!--         2-Soon -->
            <!--         3-Quickly -->
            <!--         4-Very Quickly -->
            <!--         5-Immediate -->
 
            <!-- <severity></severity> -->
            <!--     Possible values for severity: -->
            <!--         1-Escalated -->
            <!--         2-Superviser Escal. -->
            <!--         3-Mgr Escal. -->
            <!--         4-HD Mgr Escalation -->
            <!--         5-All Hands Escalation -->
 
          </incident>
        </iwaveaf:create>
      </xsl:when>
      <xsl:otherwise>
        <iwaveaf:update xmlns:
          iwaveaf="http://iwavesoftware.com/services/adapter-framework">
          <incident>
            <identifier><xsl:value-of select=
              "normalize-space(substring-before(substring-after(ns0:TicketID,
                '('), ')'))"/></identifier>

            <!-- Set the CASD Incident Summary -->
            <summary><xsl:value-of select=
              "ns0:SystemAttributes/ns0:Summary"/></summary>
 
            <!-- Set the CASD Incident Description -->
            <description>
              <xsl:call-template name="getDescription">
                <xsl:with-param name="message">Incident updated by Oracle
                 Enterprise Manager CA Service Desk Connector</xsl:with-param>
                <xsl:with-param name="addHref">true</xsl:with-param>    
              </xsl:call-template>
            </description>
 
            <!-- Set the CASD Incident Priority-->
            <!--     Possible values for priority: -->
            <!--       1 = High                    -->
            <!--       2 = Medium-High             -->
            <!--       3 = Medium                  -->
            <!--       4 = Medium-Low              -->
            <!--       5 = Low                     -->
            <!--       None                        -->
            <xsl:choose>
              <xsl:when test="ns0:SystemAttributes/ns0:SeverityCode = 'FATAL'">  
                <priority>2</priority> <!-- CASD Medium-High -->
              </xsl:when>
              <xsl:when test="ns0:SystemAttributes/ns0:SeverityCode = 'CRITICAL'">  
                <priority>3</priority> <!-- CASD Medium -->
              </xsl:when>
              <xsl:when test="ns0:SystemAttributes/ns0:SeverityCode = 'WARNING'">  
                <priority>4</priority>  <!-- CASD Medium-Low -->
              </xsl:when>
              <xsl:otherwise>
                <priority>5</priority>  <!-- CASD Low -->
              </xsl:otherwise>
            </xsl:choose>
 
 
        <!--  UNCOMMENT THE TAGS YOU WISH TO HAVE MODIFIED WHENEVER   -->
        <!--  THE INCIDENT IS UPDATED, AND GIVE THEM DESIRED VALUES   --> 
 
            <!-- <status></status> -->
            <!--     Possible values for status: -->
            <!--         ACK (Acknowledged) -->
            <!--         CL (Closed) -->
            <!--         OP (Open) -->
            <!--         WIP (Work In Progress) -->
            <!--         AVOID (Avoided) -->
            <!--         FIP (Fix in Progress) -->
            <!--         CLREQ (Close Requested) -->
            <!--         KE (Known Error) -->
            <!--         CNCL (Cancelled) -->
            <!--         HOLD (Hold) -->
            <!--         CLUNRSLV (Closed-Unresolved) -->
            <!--         PRBAPP (Problem-Approved) -->
            <!--         PC (Problem-Closed) -->
            <!--         PF (Problem-Fixed) -->
            <!--         PRBANCOMP (Problem-Analysis Complete) -->
            <!--         PO (Problem-Open) -->
            <!--         RSCH (Researching) -->
            <!--         RE (Resolved) -->
            <!--         PRBREJ (Problem-Rejected) -->
 
            <!-- <impact></impact> -->
            <!--     Possible values for impact: -->
            <!--         1-Entire Organization -->
            <!--         2-Multiple Groups -->
            <!--         3-Single Group -->
            <!--         4-Small Group -->
            <!--         5-One person -->
            <!--         None -->
 
            <!-- <urgency></urgency> -->
            <!--     Possible values for urgency: -->
            <!--         1-As Possible -->
            <!--         2-Soon -->
            <!--         3-Quickly -->
            <!--         4-Very Quickly -->
            <!--         5-Immediate -->
 
            <!-- <severity></severity> -->
            <!--     Possible values for severity: -->
            <!--         1-Escalated -->
            <!--         2-Superviser Escal. -->
            <!--         3-Mgr Escal. -->
            <!--         4-HD Mgr Escalation -->
            <!--         5-All Hands Escalation -->
 
            <!-- <resolution>
                   <resolutionDate></resolutionDate>
                 </resolution> -->
            <!-- Resolution date must be formatted using the ISO 8601 format code.
                   -->
            <!--     Sample format: 2009-11-24T09:57:01Z -->
            <!--     Sample format: 2009-11-24T03:57:01-06:00 -->
 
            <xsl:choose>
              <xsl:when test="ns0:ReopenTicket = 'Yes'">
                <!-- Set the CASD Incident Status back to Open -->
                <status>OP</status>
 
                <!-- Add a CASD Activity log entry -->
                <logs>
                  <log>
                    <description>
                      <xsl:call-template name="getDescription">
                        <xsl:with-param name="message">Incident reopened by Oracle
                    Enterprise Manager CA Service Desk Connector</xsl:with-param>
                        <xsl:with-param name="addHref">false</xsl:with-param>    
                      </xsl:call-template>
                    </description>
                  </log>
                </logs>
              </xsl:when>
 
              <!-- Close the incident if the EM Severity is set to Clear. -->
              <xsl:when test="ns0:SystemAttributes/ns0:SeverityCode = 'CLEAR'">
                <!-- Set the CASD Incident Status to Closed -->
                <status>CL</status>
 
                <!-- Add a CASD Activity log entry -->
                <logs>
                  <log>
                    <description>
                      <xsl:call-template name="getDescription">
                        <xsl:with-param name="message">Incident closed by Oracle
                  Enterprise Manager CA Service Desk Connector</xsl:with-param>
                        <xsl:with-param name="addHref">false</xsl:with-param>    
                      </xsl:call-template>
                    </description>
                  </log>
                </logs>
              </xsl:when>
              
              <xsl:otherwise>
                <!-- Add activity log entry with a standard update message since
                   this is not a reopen.-->
                <logs>
                  <log>
                    <description>
                      <xsl:call-template name="getDescription">
                        <xsl:with-param name="message">Incident updated by Oracle
                   Enterprise Manager CA Service Desk Connector</xsl:with-param>
                        <xsl:with-param name="addHref">false</xsl:with-param>    
                      </xsl:call-template>
                    </description>
                  </log>
                </logs>
              </xsl:otherwise>
            </xsl:choose>
          </incident>
        </iwaveaf:update>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
 
  <xsl:template name="getDescription">
    <xsl:param name="message"/>
    <xsl:param name="addHref"/>
    
    <xsl:variable name="msg">
      <xsl:choose>
        <xsl:when test="normalize-space(ns0:SystemAttributes/ns0:UpdatedAttributes) != ''">
<xsl:value-of select="$message"/> for change in attributes : <xsl:value-of select="ns0:SystemAttributes/ns0:UpdatedAttributes"/>
        </xsl:when>
        <xsl:otherwise>
<xsl:value-of select="$message"/>
        </xsl:otherwise>
      </xsl:choose> 
    </xsl:variable>
    
<xsl:value-of select="$msg"/>.
-----------------------------------------------------------------------------------------
EM User: <xsl:value-of select="ns0:NotificationRuleOwner"/>
    
Incident Information:
<xsl:for-each select="ns0:SystemAttributes/ns0:SourceInfo"><xsl:text>&#xa;</xsl:text>    Source Name: <xsl:value-of select="./ns0:SourceObjInfo/ns0:ObjName" />
      <xsl:choose>
        <xsl:when test="normalize-space(./ns0:SourceObjInfo/ns0:ObjOwner) != ''">
    Source Owner: <xsl:value-of select="./ns0:SourceObjInfo/ns0:ObjOwner" />
        </xsl:when>
      </xsl:choose>
    Source Type: <xsl:value-of select="./ns0:SourceObjInfo/ns0:SourceObjType"/>
    Source SubType: <xsl:value-of select="./ns0:SourceObjInfo/ns0:SourceObjSubType"/>
    Target Name: <xsl:value-of select="./ns0:TargetInfo/ns0:TargetName"/>
    Target Type: <xsl:value-of select="./ns0:TargetInfo/ns0:TargetType"/>
    Target Type Label: <xsl:value-of select="./ns0:TargetInfo/ns0:TargetTypeLabel"/>
  <xsl:choose>
    <xsl:when test="$addHref = 'true' and ./ns0:TargetInfo/ns0:TargetURL != ''">
    Target URL: &lt;a href="<xsl:value-of select="./ns0:TargetInfo/ns0:TargetURL"/>" target="_blank"&gt;<xsl:value-of select="./ns0:TargetInfo/ns0:TargetURL"/>&lt;/a&gt;<xsl:text/>
    </xsl:when>
    <xsl:otherwise>
    Target URL: <xsl:value-of select="./ns0:TargetInfo/ns0:TargetURL"/>
    </xsl:otherwise>
  </xsl:choose> 
  <xsl:if test="position() &lt; last()">
    <xsl:text>&#xa;</xsl:text>
  </xsl:if>
</xsl:for-each>
<xsl:for-each select="ns0:SystemAttributes/ns0:SourceInfo/ns0:TargetInfo/ns0:TargetProperty">
  <xsl:if test="position() = 1">
    <xsl:text>&#xa;&#xa;    Target Properties:&#xa;</xsl:text>
  </xsl:if>
  <xsl:text>        </xsl:text><xsl:value-of select="./ns0:Name"/>: <xsl:value-of select="./ns0:Value"/>
      <xsl:if test="position() &lt; last()">
        <xsl:text>&#xa;</xsl:text>
      </xsl:if>
    </xsl:for-each>
<!-- EDIT THE FOLLOWING CODE TO LIST A SPECIFIC TARGET PROPERTY, SUCH AS "Line of Business"
        <xsl:choose>
          <xsl:when test="ns0:SystemAttributes/ns0:SourceInfo/ns0:TargetInfo/ns0:TargetProperty/ns0:Name='Line of Business'">
            Line of Business: <xsl:value-of select="ns0:ns0:SystemAttributes/ns0:SourceInfo/ns0:TargetInfo/ns0:TargetProperty/ns0:value"/>
          </xsl:when>
        </xsl:choose>
-->
    Severity: <xsl:value-of select="ns0:SystemAttributes/ns0:Severity"/>
    Priority: <xsl:value-of select="ns0:SystemAttributes/ns0:Priority" />
    CreationDate: <xsl:value-of select="ns0:SystemAttributes/ns0:CreationDate"/>
    LastUpdatedDate: <xsl:value-of select="ns0:SystemAttributes/ns0:LastUpdatedDate"/>
    Owner: <xsl:value-of select="ns0:SystemAttributes/ns0:Owner" />
    <xsl:choose>
      <xsl:when test="normalize-space(ns0:NotificationRuleName) != ''">
    Notification Rule: <xsl:value-of select="ns0:NotificationRuleName"/>
      </xsl:when>
    </xsl:choose>  
    <xsl:choose>
      <xsl:when test="$addHref = 'true' and ns0:SystemAttributes/ns0:IncidentURL != ''">
    URL: &lt;a href="<xsl:value-of select="ns0:SystemAttributes/ns0:IncidentURL"/>" target="_blank"&gt;<xsl:value-of select="ns0:SystemAttributes/ns0:IncidentURL"/>&lt;/a&gt;<xsl:text/>
      </xsl:when>
      <xsl:otherwise>
    URL: <xsl:value-of select="ns0:SystemAttributes/ns0:IncidentURL"/>
      </xsl:otherwise>
    </xsl:choose> 
    
    EM Incident Status: <xsl:value-of select="ns0:SystemAttributes/ns0:ResolutionState"/>
    EM Acknowledge: <xsl:value-of select="ns0:SystemAttributes/ns0:Acknowledge"/>
    EM Auto Close: <xsl:value-of select="ns0:SystemAttributes/ns0:AutoClose"/>
    EM Escalation Level: <xsl:value-of select="ns0:SystemAttributes/ns0:EscalationLevel"/>
 
    <xsl:for-each select="ns0:SystemAttributes/ns0:AdditionalDetails">
      <xsl:text>&#xa;    </xsl:text><xsl:value-of select="./ns0:VariableName"/>: <xsl:value-of select="./ns0:VariableValue"/>
    </xsl:for-each>
  </xsl:template>
 
</xsl:stylesheet>