Slack集成

名称:Slack集成

版本:17.4.0

发布:2017-12-20

描述:发送通知到Slack

itop-version-min:2.0.0

关键词:slack, notification, action, trigger

依赖项:itop-config-mgmt

作者:ITOMIG GmbH

买它

此扩展添加了能力以基于操作活动发送通知并触发协作工具松弛。本页介绍如何配置和使用扩展,以便向Slack发送通知。

特征

默认情况下,唯一可用的功能类型是发送发送邮件。此扩展定义了一种新的功能类型:Slack通知。你能:

  • 发送通知给Slack
  • 配置通知的目标(松弛的工作空间,通道,人员)
  • 在Slack中配置传入通知的显示机器人名称
  • 通过添加标题,链接,编辑颜色等来格式化消息。
  • 注意并快速响应iTop中的更改

修订记录

版本发布日期注释
17.4.02017-12-20初始发布。

局限性

  • 虽然iTop与HTML一起使用来格式化消息,但是Slack使用自己的降价语言(例如语言)。此扩展将HTML转换为markdown。但是由于松弛标记的限制,当前图像不会发送到松弛,并且标题只会显示为粗体。
  • 到目前为止,不可能以异步方式发送松弛通知。因此,请注意配置参数“超时”。

要求

  • 现有松弛的工作空间 
  • 已配置网络挂钩 
  • Webhook的URL(看起来像:https ::: hooks.slack.commservicessT000000000B000000000XXXXXXXXXXXXXXXXXXXXXXXXXXX)

安装

  • 使用标准安装流程 对于此扩展。
  • 在交互式向导的末尾,检查扩展列表中的Slack集成。

配置

以下设置可用于配置模块:

参数类型描述默认价值
certificate_check布尔值是否检查服务器的ssl证书。真正
certificate_file自定义证书文件的路径。 
timeout整数确定iTop等待回复松弛的秒数5

用法

松弛通知是功能的特殊类型。它基于动作触发。用法与发送邮件通知非常相似。

要查看您的Slack通知,请使用“管理工具”菜单中的“通知”链接,然后单击选项卡“操作活动”。

https://www.itophub.io/wiki/media?w=400&tok=f26bfa&media=extensions%3Aslack_integration.png

请参见示例Slack通知“将工单信息发送到Slack”
此扩展的安装提供了一个示例Slack通知“将工单信息发送到Slack”。看看这个,以了解如何构建您自己的通知。

创建一个松弛通知功能

要创建新的功能,请转到“操作活动”选项卡,然后单击“新建…”。出现以下向导:

https://www.itophub.io/wiki/media?w=600&tok=23ff1e&media=extensions%3Aslack_create.png

松弛通知的必填字段为:

没有任何其他信息,iTop将向Slack发送一个空的通知。

编辑松弛连接信息

在Slack URL旁边,您可以指定以下属性:

  • 频道或个人:如果您输入频道名称(i.e. #general)或个人名称(i.e. @personname),则消息将发送给该​​频道或个人。如果留为空白,则消息将发送到Slack Webhook中配置的默认通道。
  • 应用名称:输入一个机器人名称,该名称将以通知的发送者名称显示为松弛形式。如果保留为空,则将显示在松弛Webhook中配置的默认名称。

消息文本和占位符

您可以通过编辑属性“简单文本”将内容添加到通知中。可以通过HTML格式化消息并添加占位符。占位符的工作方式与发送邮件通知中的工作方式相同。有关更多信息,请参见这个网站.

添加松弛附件

为了改善格式,您可以使用松弛邮件附件。附件将显示在简单文本下方,并在左侧缩进并用颜色标记。

https://www.itophub.io/wiki/media?w=300&tok=d5ba9d&media=extensions%3Aslack_attachment.png

要启用附件,请设置属性“使用附件?”。为“是”并编辑以下属性:

  • 附件标题:附件文本上方的标题。
  • 附件链接:将OQL查询输入到对象。 Slack通知将向指向OQL中定义的对象的附件标题添加链接。如果OQL与多个对象匹配,那么当前只有第一个对象将被链接。允许您在OQL中使用占位符。例如:
SELECT Ticket WHERE id= :this->id
  • 附件颜色:使用十六进制颜色价值指定附件消息的颜色。
  • 附件文本:附件的文本。您可以使用HTML和占位符。
  • 附件回退:如果Slack无法显示附件(即在通知预览中),则可以回退。您可以使用HTML和占位符。

将触发器添加到Slack通知

要定义何时必须发送通知,必须定义触发器并将通知链接到触发器。切换到“相关触发器”选项卡,然后单击“添加触发器…”,以将现有触发器添加到通知。

窗体底端

iTop Hub是一个信息聚合器和市场。作为iTop编辑器,我们为社区创建了一个独特的地方。它的内容将定期得到充实,因此请随时关注我们,不要错过任何更新!

https://www.itophub.io/wiki/media?w=600&tok=3d1910&media=extensions%3Aadd_trigger_slack.png

原文:https://www.itophub.io/wiki/page?id=extensions%3Aitomig-slack-integration


Slack Integration

name:
Slack Integration
version:
17.4.0
release:
2017-12-20
description:
Send notification to Slack
itop-version-min:
2.0.0
keyword:
slacknotificationactiontrigger
dependencies:
itop-config-mgmt
author:
ITOMIG GmbH
Buy it

This extension adds the capability to send notifications based on actions and triggers to collaboration tool Slack. This page describes how to configure and work with the extension in order to send notifications to Slack.

Features

By default the only available kind of action consists in sending email. This extension defines a new type of Action: Slack Notification. You are able to:

  • Send notifications to Slack

  • Configure the target of the notification (slack workspace, channel, person)

  • Configure display bot name of the incoming notification in Slack

  • Format the messages by adding Headlines, links, edit the color etc.

  • notice and react faster to changes in your iTop

Revision History

VersionRelease DateComments
17.4.02017-12-20Initial release.

Limitations

  • While iTop works with HTML to format messages, Slack uses an own markdown like language. This extensions transform HTML to markdown. But due to the limitations of the slack markdown currently images will not send to Slack and headings will only be displayed as bold.

  • Until now it is not possible to send slack notifications asynchronous. So keep an eye on the config parameter “timeout”.

Requirements

  • Existing Slack workspace

  • Configured webhook

  • URL of the webhook (it looks like: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX)

Installation

  • Use the Standard installation process for this extension.

  • Check Slack Integration in the list of extensions at the end of the interactive wizard.

Configuration

The following settings are available to configure the module:

ParameterTypeDescriptionDefault Value
certificate_checkbooleanWhether to check the ssl certificate of slack server.true
certificate_filestringPath to an custom certificate file. 
timeoutIntegerDetermine how many seconds iTop shall wait for a response of Slack5

Usage

Slack Notification is a special type of Action. It is based on Action/Triggers. The usage is quite similar to an email notification.

To view your Slack notifications use the link “Notifications” in the “Admin tools” menu and click on the tab “Actions”.

https://www.itophub.io/wiki/media?w=400&tok=f26bfa&media=extensions%3Aslack_integration.png

See the example Slack Notification “Send ticket information to Slack”
The installation of this extension provides a sample Slack notification “Send ticket information to Slack”. Have a look at this to learn how to build your own notifications.

Creating a Slack notification action

To create a new action, go to the “Actions” tab and click on “New…”. The following wizard appears: https://www.itophub.io/wiki/media?w=600&tok=23ff1e&media=extensions%3Aslack_create.png

The mandatory fields for a slack notification are:

Without any other Information iTop will send an empty notification to Slack.

Edit Slack connection information

Beside the Slack URL you are able to specify the following attributes:

  • Channel or Person: If you enter a channel name (i.e. #general) or a person name (i.e. @personname) the message will to this channel or person. If left blank the message will send to the default channel configured in the Slack webhook.

  • App name: Enter a bot name which will displayed as the sender name of the notification in slack. If left empty the default name configured in the slack webhook will be displayed.

Message Text and placeholders

You can add content to your notification by editing the attribute “simple text”. It is possible to format your message via HTML and add placeholders. Placeholders works in the same way like they do in the email notification. Fore more information please see this site.

Add Slack attachment

For an improved formatting you can use a slack message attachment. An attachment will be shown below the simple text, indented and marked with a color at the left side.

https://www.itophub.io/wiki/media?w=300&tok=d5ba9d&media=extensions%3Aslack_attachment.png

To enable the attachment set the attribute “Use an attachment?” to “yes” and edit the following attributes:

  • Attachment title: Title above the attachment text.

  • Attachment link: Enter an OQL query to an Object. The Slack notification will add a link to the attachment title pointing to the Object defined in the OQL. If the OQL matches more than one object currently just the first object will be linked. You are allowed to use placeholders in the OQL. For instance:

SELECT Ticket WHERE id= :this->id
  • Attachment Color: Specify the color of the attachment message by using hexadecimal color value

  • Attachment Text: Text of the attachment. You are able to using HTML and placeholders.

  • Attachment Fallback: Fallback in case of Slack is not able to display the the Attachment (i.e. in a notification preview) You are able to using HTML and placeholders.

Add Trigger to a Slack notification

To define when an notification have to be sent, you have to define a Trigger and link the notification to the trigger. Switch to the tab “Related Triggers” an click “Add Triggers…” to add an existing Trigger to your Notification. https://www.itophub.io/wiki/media?w=600&tok=3d1910&media=extensions%3Aadd_trigger_slack.png

标签:
由 superadmin 在 2020/08/27, 16:13 创建
    

需要帮助?

如果您需要有关XWiki的帮助,可以联系:

深圳市艾拓先锋企业管理咨询有限公司