Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use JavaScript to issue nail alarm in zabbix 6. 0

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to use JavaScript to issue nail alarm" in zabbix 6.0. in the operation of practical cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Apply for nailing robot

Skip

Note that the keywords should match the alarm template

Zabbix 6.0installation

Skip

Configure nail alarm

The access_token of the nailing robot is:

Https://oapi.dingtalk.com/robot/send?access_token=123456

Type of alarm medium

Manage-- > alarm media type-- > create media type

Type selection Webhook

Parameters:

Name value comment

The string message {ALERT.MESSAGE} subject {ALERT.SUBJECT} after the access_token123456 nailing robot access_token=

Script:

Try {Zabbix.Log (4, 'params=' + value); params= JSON.parse (value); req = new CurlHttpRequest (); timest = Date.now () data = {}; result = {}; req.AddHeader ('Content-Type: application/json'); data.msgtype = "markdown" / / corresponding message parameter data.markdown = {"title": params.subject, "text": params.message.replace (/\\ nzag, "\ n"). Replace (/ awesometimestamp/g, timest)}; Zabbix.Log (4, 'markdown=' + JSON.stringify (data.markdown)); / / corresponding user parameter data.at = {"atMobiles": [], "isAtAll": "false"} / / nailing robot resp = req.Post ('https://oapi.dingtalk.com/robot/send?access_token=' + params.access_token, JSON.stringify (data));} catch (error) {} return JSON.stringify (result)

Then go to the message template

Alarm template

# xx fault alarm\ n

> alarm time: {EVENT.DATE} {EVENT.TIME}\ n

> alarm name: {EVENT.NAME}\ n

> alarm host: {HOST.NAME}\ n

> alarm level: {EVENT.SEVERITY}\ n

Restore templat

# xx alarm recovery\ n

> alarm recovery time: {EVENT.RECOVERY.DATE} {EVENT.RECOVERY.TIME}\ n

> alarm information: {EVENT.NAME}\ n

> alarm duration: {EVENT.DURATION}\ n

> alarm host: {HOST.NAME}\ n

> alarm level: {EVENT.SEVERITY}\ n

User

Manage-- > users

action

Configure-- > Action-- > Trigger actions

Create an action

Alarm display

The fault is red and the recovery is green.

This is the end of the introduction to "how to use JavaScript to issue nail alarms in zabbix 6.0. thank you for reading." If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report