Feishu official|Zabbix alarm information is synchronized to multi-dimensional tables

one.

Overview


In daily work, IT operation and maintenance personnel need to receive and process alarm information from various IT systems in a timely manner to ensure stable operation of the system. In the Zabbix monitoring system, users can configure the method of sending alarm information to send alarm information to specific media for processing, recording, analysis, etc. In this article, we will introduce how to synchronize Zabbix alarm information into a multi-dimensional table.


Workflow preview



This process has the following steps


1. Zabbix trigger: Receive Zabbix callback information and trigger the workflow to run.


2. Convert to multi-dimensional table request: Parse the Zabbix callback information and convert it into the parameter format of the multi-dimensional table request.


3. Query records: Query the event records of the ID of the current event through the multidimensional table connector.


4. Branch: Determine whether the record of the current event ID is queried.


5. Create a new record: Create a new event record through the multidimensional table connector.


6. Update records: Update existing event records through the multidimensional table connector.



two.

Steps


Preparation


1. Configure Feishu media type in Zabbix system and associate users and actions


1. Download Feishu’s Zabbix media type


Download address: zbx_export_mediatype_feishu.xml


2. Import the media type in Zabbix


In the Zabbix console, select Administration > Alarm Media and import the media type. Select "Update existing" and "Create new" for the import rules.



3. Configure users who support Feishu media types


In the Zabbix system, the media types supported by each user need to be configured separately, so users who support Feishu media types must be configured.

On the Management > User page, select the existing user to edit or create a new user page, select the alarm media page, select "Feishu" as the type, and fill in Feishu's callback address as the recipient.


Note: The selected user must have the permission of the alarm host, otherwise the alarm information cannot be sent to the user. Permissions can be managed in user groups.



The callback address can be clicked on the Zabbix node in the workflow , and the callback address can be seen on the settings page on the right .


4. Modify Action configuration


In Configuration > Action, select the action that needs to be sent to the target group for modification, select the action, and add the sending object on the operation page (operations, recovery operations, and update operations can all be configured, and can be configured according to the actual situation and needs). To send the user, select the user created in the previous step, and select Feishu for "Only send to".


Note: The action needs to be enabled and the condition cannot be empty.



Note: Zabbix version needs to be 5.0 and above to support importing media types.


2. Prepare a multidimensional table


Use the template Zabbix alarm event information template to create a multidimensional table document as shown in the figure below.



Gradually subdivide


1. Configure Zabbix application credentials


Click the Zabbix node in the workflow , and configure the new/select the existing "Zabbix Application Authorization" credential on the right credential page . The following uses "New" as an example:



When creating a new application credential, fill in the required fields and click Create and Connect .



Note: If you only use this template, the ApiToken and Zabbix domain names can be set to any value and the connection will take effect when creating a connection.


The ApiToken is created in Zabbix Console>User Settings>API Token, as shown below:



The Zabbix domain name is filled in with a URL address that does not need to carry page path parameters and can be accessed from the public network . For example, the dashboard address is https://example.com/zabbix/zabbix.php?action=dashboard.view , then the filled-in address is: https://example.com/zabbix/


2. Configure credentials for Feishu applications


Click   the certificate on the right side of the query record node to create/select an existing "Feishu Application Authorization" certificate. The following uses "New" as an example:


a. Click New Application Credential , and click New Feishu Application on the credential creation page .


Note : Feishu applications created through the integrated platform will automatically submit a publishing application. If the application fails to pass the publishing review, an error will be reported when running the workflow.



b. Batch update the created "Feishu Application Authorization" credentials to the remaining "Feishu Series" connector nodes.



c. After selecting the certificate, if the certificate requires additional application permissions, you can click Configure Application Credentials in the prompt message below and submit the configuration application with one click.



3. Select multidimensional tables


Select the pre-prepared multidimensional tables and data tables on the input parameter pages of the Query Record, New Record, and Update Record nodes respectively .



If the current application is not added to the multidimensional table, a collaborative application will be added. Click to add it, and then select Confirm.



4. Release integration flow


After finishing editing the workflow, click Publish , and the workflow will become effective.


common problem


1. How to synchronize other information to the multidimensional table?


If you need to synchronize the results of the current callback, you first need to add the required fields to the multidimensional table and set the field type.



Secondly, you need to parse out the required parameters in the Convert to Multidimensional Table Request node, and convert them into multidimensional table supported format request parameters. You can refer to: New Record - Server API - Development Document - Feishu Open Platform ; marked by the arrow in the figure below Positional insertion of conversion logic.



If the field that needs to be synchronized is not in the result of the current callback, you need to adjust the input parameters of the Feishu media type in the Zabbix system.


2. Why is the alarm information not synchronized to the multidimensional table?


First, you can check whether there are relevant logs sent to Feishu in the Reports > Action Logs of the Zabbix console (as shown below).


If there are no relevant logs, the most likely cause is incorrect configuration. First, check whether the person or group that alerted has the permissions of the corresponding host and host group, and then check again according to the above steps.



If there is a log and an error is displayed, you can troubleshoot according to the cause of the error prompt. Common problems include: the Zabbix host cannot access the public network, etc.


If the log exists and the log is delivered, you can troubleshoot in Anycross's running log. Common problems include: application credential configuration errors, group ID configuration errors, etc. How to deal with it can be checked by referring to the previous steps.


Further reading:

Feishu official | Zabbix alarm message sends Feishu card message and lets the message come to you

Dry information | Webhook configuration DingTalk/Feishu robot alarm


This article is shared from the WeChat public account - Zabbix open source community (china_zabbix).
If there is any infringement, please contact [email protected] for deletion.
This article participates in the " OSC Source Creation Plan ". You who are reading are welcome to join and share together.

雷军:小米全新操作系统澎湃 OS 正式版已完成封包 国美 App 抽奖页面弹窗辱骂其创始人 美国政府限制向中国出口 NVIDIA H800 GPU 小米澎湃OS界面曝光 大神用 Scratch 手搓 RISC-V 模拟器,成功运行 Linux 内核 RustDesk 远程桌面 1.2.3 发布,增强 Wayland 支持 拔出罗技 USB 接收器后,Linux 内核竟然崩溃了 DHH 锐评“打包工具”:前端根本不需要构建 (No Build) JetBrains 推出 Writerside,创建技术文档的工具 Node.js 21 正式发布
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/3900302/blog/10116884