ServiceNow ITSM 应用程序警报渠道
ServiceNow ITSM(IT 服务管理)应用程序的警报通道可在 Instana 和 ServiceNow 之间传递警报通知。 application.To 会实时将警报通知从 Instana 发送至 ServiceNow ,并创建一个 ServiceNow ITSM 应用程序警报通道。
该 InstanaIBM 应用程序 该程序运行于 ServiceNow 并提供以下功能:
- 将 Instana 事件转发至 ServiceNow 事件表或 IBM Instana 中间表
- 将 Instana 事件的备注和AI事件摘要结果同步到由 IBM Instana 应用程序创建的相应 ServiceNow 事件中
- 将 Instana 事件的关闭状态同步到 ServiceNow 事件表或 IBM、 Instana 中间表
- 将工作笔记、附加评论和字段更改从 ServiceNow 事件表同步到 Instana
- 当事件状态更改为
Resolved或Closed时,传播事件关闭信息
安装先决条件
Instana 目前仅支持 SaaS 部署。
ServiceNow 应用程序访问以下 ServiceNow 表:
- 事件 (incident) 读/写
- 优先级数据查询 (dl_u_priority) 只读
- 用户 (sys_user) 只读
- 组 (sys_user_group) 只读
- 组成员 (sys_user_grmember) 只读
- 表 (sys_db_object) 只读
- 词典条目 (sys_dictionary) 只读
由 Instana 传播的事件将根据事件类型存储在以下 IBM Instana 中间表之一中:
- IBM Instana 用于事件 (x_ibm_instana_ibm_instana_for_incidents)
- IBM Instana 用于问题 (x_ibm_instana_ibm_instana_for_issues)
- IBM Instana 为变革 (x_ibm_instana_ibm_instana_for_change)
- IBM Instana 用于监控问题 (x_ibm_instana_ibm_instana_for_monitoring_issues)
若要从 Instana 向 ServiceNow 实时发送警报通知,请创建一个 ServiceNow ITSM 应用程序警报通道。
创建 ServiceNow ITSM 应用程序警报通道
在 ServiceNow 上配置 ServiceNow 应用程序
ServiceNow 应用程序现已在 ServiceNow 商店上线。 您可以从 ServiceNow 应用商店下载并安装 IBM Instana 应用程序。 有关安装说明的更多信息,请参阅《 安装指南》。
在 ServiceNow 上配置用户
您必须创建一个用户,以便“ Instana ”实例中的 ServiceNow ITSM应用程序警报通道能够通过该用户访问 ServiceNow 中的 IBM Instana 应用程序。
- 单击 All 并搜索 User Administration。 单击 User Administration > Users 。
- 单击新建以创建新用户。
- 输入 用户 ID。 这是用户登录此 ServiceNow 实例时的用户名。
- 根据用户信息填写其他字段,然后单击 Submit 创建用户。
- Go 转到新创建的用户页面,然后点击 “设置密码 ”。 在弹出窗口中,单击 Generate 为用户创建密码。 复制并保存密码,因为用户首次登录时需要使用该密码。
- 默认情况下,在密码创建并成功保存后 ,“需要重置密码 ”复选框会被勾选。 取消选中该复选框。
- 在 “身份类型 ”字段中选择 “机器 ”。 如果 “标识类型 ”字段不可用,请参阅 ServiceNow、 KB2420837 和 KB2567879 以获取更多信息。
图 1. ServiceNow 创建用户 
- 单击 Role 选项卡,授权用户访问应用程序。
- 单击编辑。 在“搜索”选项卡中,搜索并选择
x_ibm_instana.user和sn_incident_write角色。 然后,将它们添加到角色列表中。图 2. ServiceNow 添加访问权限 
- 单击保存以保存更改。
- 单击 Update 保存更新。 在用户页面,角色会被添加到角色列表中。 列表中显示的角色超过3个,因为 和
sn_incident_write中包含了多个data_lookup_admin子角色。
在 Instana 中配置警报通道
要创建一个 ServiceNow 警报通道,请在 Instana 用户界面的左侧导航栏中,依次单击 “设置” > “全局设置” > “事件与警报” > “警报通道”。
点击 “添加警报通道 ”,然后选择 ServiceNow ITSM应用。
输入新频道的名称。
该集成采用基本授权方式与 ServiceNow 应用程序(脚本地址为 REST API )进行交互。
URL 字段必须指向 Instana 与其通信的 ServiceNow 实例的端点。 例如,
https://example.service-now.com。Username 字段必须是现有 ServiceNow 用户的名称,该用户具有访问 ServiceNow 应用程序的角色,上一节提到并设置了该角色。 使用在 ServiceNow 中创建的用户的用户 ID 作为用户名。
Password 字段必须包含 ServiceNow 用户的密码,其用户 ID 已在 Username 字段中输入。
单击高级。 请使用以下两个单选按钮选项,以启用 Instana 与 ServiceNow 之间的双向通信功能。
允许 Instana 将事件发送至 ServiceNow 事件表 (默认):如果在将事件传播至 IBM Instana 中间表后选中此单选按钮, IBM Instana 应用程序将更新 ServiceNow 中的事件表。 该功能会根据 Instana 中的事件自动创建和关闭 ServiceNow 中的事件,并在 Instana 与 ServiceNow 之间同步笔记和活动记录。 ServiceNow 中用于修改事件表的任何现有业务规则均可正常运行。 所有能够访问 ServiceNow 事件表的 ServiceNow 用户必须具备以下 5 个角色:
- x_ibm_instana.ibm_instana_for_tenants_user
- x_ibm_instana.ibm_instana_for_incidents_user
- x_ibm_instana.ibm_instana_for_change_user
- x_ibm_instana.ibm_instana_for_issue_user
- x_ibm_instana.ibm_instana_for_monitoring_issue_user
将 Instana 限制为仅向中间表传播 :如果选中此单选按钮, Instana 将仅将事件数据传播至 IBM 和 Instana 中间表,而不会对 ServiceNow 事件表进行任何进一步的更新。 您的 ServiceNow 业务规则可以访问这些 IBM 和 Instana 中间表。
点击 “创建 ”以创建 ServiceNow 警报频道。

警报示例
当选中 “允许 Instana 将事件发送至 ServiceNow 事件表 ”选项时,以下信息将被添加到 ServiceNow 事件工单的相应字段中:
事件的 “简要描述 ”字段已设置为该事件在 Instana 用户界面中显示的标题。
如果 Assigned to 字段为空,则事件的 State 字段将设置为
New。 如果此 ServiceNow 事件票据分配给 ServiceNow, State 将变为In Progress。在 Instana 中 ,“影响 ”字段是根据事件的严重程度设置的。 以
online、offline和change类型检测到的事件具有3 - Low影响。 对于类型为、incident和issuemonitoring issue的事件 ,Impact 字段的值取决于它们在 Instana 中的严重程度。 在 Instana 中,严重Warning级别为 的事件具有 的2 - Medium影响,而严重级别为Critical的事件具有 的1 - High影响。Description 字段的设置取决于事件类型。 总体而言,它包含了通过其他 Instana 警报渠道发送的大部分信息。 信息以
Key: Value格式表示,--表示键值对的嵌套。 以下信息已添加到 ServiceNow 事件工单的 “描述 ”字段中:“类型 ”字段根据 Instana 中的值进行
event type设置,包括incident、issue、monitoring_issuechange、、。每种类型的事件都会保存在相应的中间表中。“建议 ”字段是根据 Instana 中的
fixed suggestion值设置的。“严重性 ”字段的设置基于定义的映射 Instana :值
-1代表Change,5代表Warning,10代表Critical,其他值则代表Info。 ServiceNow 支持严重性升级。 当 Instana 事件的严重级别从 Instana 升级时, ServiceNow 事件中的相应字段(例如Urgency和Priority)也会随之变化。 此外,该项Short Description已更新,并添加了Severity Upgraded -前缀。
由于该字段 Description可编辑,因此在严重性升级后, Instana 不会更新该字Severity段的值。 该字段Severity保留其原始值。“链接 ”字段包含一个网站链接,点击该链接可跳转至 Instana 中当前事件的页面。
您在 “设置” > “全局设置 ”> “事件与警报 ” >“警报”中定义的自定义负载,将用于为 ServiceNow 的事件字段填充值。
snow.close.要启用此功能, 键名必须以snow.open.或 开头。snow.close.snow.open.在事件开始时使用 前缀来填充值,在事件结束时使用 前缀。 前缀后的文本标识了目标字段,该字段与 ServiceNow 事件表中的相应字段进行了映射。 例如,snow.open.category当事件开始时,会在 “类别 ”字段中填入一个值。 如果不存在匹配的字段,该值将被添加到 “描述 ”字段中。 您可以在 ServiceNow 的事件信息页面上查看其中一些自定义有效载荷字段。 字段映射不支持 “简要描述 ”、 “描述 ”或 “优先级 ”字段。 此功能不支持“监控问题”事件。对于 ServiceNow,
assignment_group,请使用“组名称”或“组名称”来设置该值sys_id。对于
assigned_toServiceNow, ,请使用用户的用户名、用户 ID 或 来设置sys_id该值。 如果在 “自定义有效载荷 ”中同时添加了assignment_group和assigned_to字段,请确保该assigned_to用户是 ServiceNow 中 组的assignment_group成员。 否则,只有assigned_to字段被设置,而assignment_group为空。 如果设置了有效的assigned_to值,则 Instana 事件的State值将设置为In Progress,而不是New。对于其余字段:
- key : ServiceName 事件表中以 snow.open 为前缀的列名 或 snow.close。
- value :字段的值。 指定的值将转换为该字段的类型。 若要指定除用户或组类型以外的引用类型值,请使用
sys_id.
例如,要将“ IBM ”DLA设置为“Configuration Item ”字段,请使用
snow.open.cmdb_ci作为键(即字段名),并使用46a0583aa9fe1981002a20ec72ca72f3作为值(即“ IBM ”sys_idDLA的 )。

ServiceNow 用户界面页面
ServiceNow 应用中的几个界面页面显示了关于 Instana 事件的信息。
ServiceNow 事件表界面
请参阅以下 Instana 事件示例,该事件对应于 ServiceNow 事件表界面中类型 incident 为 的事件:

IBM Instana 标签页界面
在 ServiceNow 事件表界面中,点击标有“ IBM ”的选项卡 Instana ,您即可在 IBM Instana 选项卡界面中查看相关信息:

IBM Instana 中间表用户界面
在导航栏中,点击 “全部 ”,然后搜索 IBM Instana。 根据事件类型选择选项。 如需查看事件,请点击 IBM Instana。 您可以看到中间表格。

点击 “ Instana 事件ID ”列中的超链接,即可跳转至 IBM Instana 的中间表界面:

同样地,您可以通过 IBM Instana 查看租户表的中间表界面:在导航栏中,点击 “全部 ”,然后搜索 IBM Instana。 点击 IBM Instana 查看租户信息。 您可以看到中间表格。

点击 “ Instana ID ”列中的超链接,即可跳转至 IBM Instana 的中间表界面:

关于未解决的问题或事件
请参阅以下示例,事件的 Description 字段与 incident 类型的事件相对应:

同步笔记和活动
如果您在 ITSM 应用的 InstanaServiceNow 警报通道中选中了该 允许向事件 ServiceNowInstana 表发送事件 单选按钮,则在已开启 Instana 的事件中添加的备注会发布并同步到事件 ServiceNow 表中的对应事件。 此外,您在 ServiceNow 事件表中添加或操作的工作笔记、附加评论和活动,会与 Instana 中的相应事件进行同步。
以下场景描述了笔记和活动同步功能:
在 Instana 事件中添加的注释会发送并同步到 ServiceNow
- 在 Instana 创建了一条工单,用户“Kevin Wu”在 “备注和活动 ”窗口中
Note Test (NB Event #3)添加了一条备注。
- 您可以在相应的 ServiceNow 事件表界面的“注释”选项卡中查看此注释,其中包括注释内容、 IBM Instana 实例信息、 IBM Instana 用户名以及时间戳。

在 ServiceNow 上添加或生成的作业笔记和活动会发布并同步至 Instana
- 这是由 Instana 生成的 ServiceNow 事件。

- 将 Impact 字段从
1 - High更改为2 - Medium并将此事件从Antony Alldis更改为Tash Dubrovska。 “优先级 ”字段也会根据 “影响 ”字段的变化,从3 - Moderate变为2 - High。
- 添加一条工作备注
Work Notes Test by System admin (From ServiceNow),并为用户在第 2 步所做的更新System Administrator再添加一条工作备注。 然后,点击 “更新 ”按钮。
- 更新完成后,您将看到以下提示。

- Go 跳转至 Instana 上的相应事件页面。 在 “笔记和活动 ”窗口中,您可以查看已同步的工作笔记和活动。

关于已解决的问题或事件
如果您在 Instana ServiceNow 的 ITSM 应用警报通道中选中 “允许 Instana 将事件发送至 ServiceNow 事件表”单选按钮,则当 Instana 中对应的事件关闭时, ServiceNow 中的事件将自动关闭。 此外,当在 ServiceNow 事件表中手动解决或关闭相应事件时, Instana 中的事件或问题也将被关闭。
以下场景描述了事件关闭功能:
在 Instana 中已关闭的事件会在 ServiceNow 中显示
在 Instana 中创建了一个工单,且该工单的状态为“活跃”。

您可以在 ServiceNow 事件表中找到新状态的事件。

当在 Instana 中关闭该事件时,事件状态会在 ServiceNow 的事件表中进行同步。

同一份 Instana 事件在 ServiceNow 上已关闭,且其解决信息已填写完毕。

当 Instana 中的相应事件被关闭时,您可以为 ServiceNow 中的事件选择要设置的关闭状态。 目前支持以下闭包状态: 6 - Resolved, 7 - Closed, 和 8 - Canceled。 您可以在表中 IBM Instana for Tenants 配置映射闭包的状态。
Go 要 IBM Instana for Tenants通过 Instana ID 列查找表中的对应记录,该列采用 {tenant unit}-{tenant} 格式(例如,如果 Instana 租户为 instana 且租户单位为 test,则 Instana ID 应为 test-instana)。 有一个名为 Map Instana Closure Event.的栏目。 您可以通过状态编号设置 ServiceNow 事件的关闭状态: 6 表示 Resolved, 7 表示 Closed, 8 表示 Canceled。 默认值为 7 - Closed.
例如,如果您将 Map Instana Closure Event 值从默认值 7 - Closed 更改为 6 - Resolved ,并且当该事件在 Instana 中关闭时, ServiceNow 中的事件状态将从更新 New 为 Resolved。

您可以在该 Notes 部分查看有关状态更新的详细信息。

当“ Instana ”事件关闭时,您可以禁用 ServiceNow 事件状态的更新。 您还可以禁用在 Instana 创建事件后, ServiceNow 用户修改事件时更新 ServiceNow 事件状态的功能。 此功能可防止在 ServiceNow 用户正在积极处理该事件时, ServiceNow 自动将事件状态更改为“已关闭”。
Go 在 IBM Instana 的“租户”页面中,使用 Instana ID 列(该列采用 {tenant unit}-{tenant} 格式)在表格中查找相应的记录。 例如,如果 Instana 租户为 , instana 且租户单元为 test,则 Instana ID 显示为 test-instana。 选中 “更新时保留状态 ”复选框,可防止在 Instana 关闭事件时, ServiceNow 更新事件状态字段。
在 ServiceNow 中已关闭的事件会在 Instana 中显示
在 Instana 上创建了一个工单,该工单的状态为
Active。
您可以在 ServiceNow 事件表中找到该事件的
New状态。
ServiceNow 中的用户使用解决信息将事件状态更改为
Closed或Resolved并更新事件。
该事件已在 ServiceNow 实例中关闭,且 Instana 实例已收到此事件关闭的通知,如下所示:

事件状态更改为关闭。

用户在 ServiceNow 事件表中输入的已关闭事件的解决信息将发回至 Instana。

在线、离线或变更事件
请参阅以下示例,事件的 Description 字段与 change 类型的事件相对应:

卸载
从 ServiceNow 实例中卸载 Instana ServiceNow 应用程序后,请访问 Instana ,并手动删除相应的 ServiceNow ITSM 警报通道。
要删除该提醒频道:
- 转到“设置” > “全局设置” > “事件与警报 ” > “警报渠道”。
- 搜索“ ServiceNow ”ITSM警报频道。
- 点击右侧的垃圾桶图标以删除该提醒频道。
如果您重新安装了 Instana ServiceNow 应用程序,请按照之前的配置步骤重新配置新安装的应用程序。
ServiceNow 与ITSM集成错误的故障排除
错误 1:503 服务不可用
消息:
Failed to save: failed to send message to ServiceNow ITSM Application Integration {{ServiceNow instance URL}} with status code: 503. Reason: Service Unavailable
原因: 当 Instana 向已配置的 ServiceNow 实例发送的 HTTP 请求失败时,会发生此错误。 这通常是因为更新了 ServiceNow 实例 URL ,而原始实例已被删除或停用。
解决方法:
- 如果 ServiceNow 实例 URL 近期已更新,您可以忽略此错误。
- 请尝试再次保存更新后的配置。
错误 2:不允许跨作用域访问
消息:
Error: /api/x_ibm_instana/instana_manager, Unable to create incident JavaException: com.glide.script.fencing.CrossScopeAccessNotAllowedException: Access to ScopedGlideRecordSecure from scope x_ibm_instana not allowed
解决步骤:
- 在 ServiceNow 控制台中,将范围从 “全局” 切换为“ IBM Instana ”。
- 打开 “应用程序跨范围访问 ”表(
sys_scope_privilege.list)。 - 添加一条新条目,内容如下:
Source Scope: IBM Instana (不可编辑)Target Scope: 全球Target Name: ScopedGlideRecordSecureTarget Type: 可编程Application: IBM Instana (不可编辑)Operation: 执行 APIStatus: 允许
