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

Zabbix distributed Monitoring Wechat alarm practice

2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

As an operation and maintenance engineer, the most important thing is to ensure the normal and stable operation of the website, need to monitor the running status of the website and server in real time, and deal with any failure in time.

The monitoring website does not need to visit the WEB website or log in to the server to check, it can realize the 7x24 hour monitoring of the website with the help of open source monitoring software such as Zabbix, Cacti, Nagios, Ganglia and so on, and can inform SA to solve the problem if there is a fault.

In addition to using email to give an alarm, Zabbix can also send alarm information to the designated person in a variety of ways, such as SMS alarm. More and more enterprises are using Zabbix combined with Wechat as the main alarm method, because everyone uses Wechat every day, which can timely and effectively push the alarm information to the recipient and facilitate the timely processing of the alarm.

This article takes the latest version 3.2.6 of Zabbix as the model, and drills through Zabbix monitoring to achieve Wechat alarm. What are the steps to set up? the specific steps are as follows:

(1) Wechat Enterprise account registration

Enterprise ID registration address: https://qy.weixin.qq.com/ fill in the enterprise registration information, wait for the examination and approval, and Wechat scan and log in to the enterprise official account, as shown in figures 6-91 (a) and 6-91 (b):

Figure 6-91 (a) Wechat Enterprise official account Registration

Figure 6-91 (b) Wechat Enterprise official account login

(2) add operation and maintenance departments and personnel to the address book

Log in to the newly created enterprise account and add the information of enterprise members to the organization or department in advance. You need to fill in the mobile phone number, WeChat account or mailbox, so that others can scan the code to follow the official account of the enterprise, and push messages to the enterprise members in order to follow the enterprise account, as shown in figures 6-92 (a) and 6-92 (b):

Figure 6-92 (a) Wechat official account address book

Figure 6-92 (b) Wechat official account address book

(3) Enterprise applications-create applications

In addition to adding Wechat alarms to individuals, you can also add different management groups to accept messages pushed by the same application, member account, organization department ID, application Agent ID,CorpID and Secret, which are needed to call the API API, as shown in figures 6-93 (a), 6-93 (b) and 6-94 (c):

Figure 6-93 (a) Wechat Enterprise official account creation application

Figure 6-93 (b) Wechat Enterprise official account creation application

Figure 6-93 (c) Wechat Enterprise official account creation application

(4) obtain enterprise CorpID

Click "my Enterprise" on the home page of the official account, as shown in figure 6-94:

Figure 6-94 Wechat Enterprise official account CorpID

(5) Wechat interface debugging

To call Wechat API, you need a credential to call the API: Access_token can obtain Access_token through CorpID and Secret. Wechat Enterprise ID API debugging address: http://qydev.weixin.qq.com/debug, as shown in figures 6-95 (a) and 6-95 (b):

Figure 6-95 (a) Wechat Enterprise official account debugging

Figure 6-95 (b) Wechat Enterprise official account debugging

(6) obtain Wechat alarm tool

Mkdir-p / usr/local/zabbix/alertscripts

Cd / usr/local/zabbix/alertscripts

Wget http://dl.cactifans.org/tools/zabbix_weixin.x86_64.tar.gz

Tar zxvf zabbix_weixin.x86_64.tar.gz

Mv zabbix_weixin/weixin.

Chmod otakx weixin

Mv zabbix_weixin/weixincfg.json / etc/

Rm-rf zxvf zabbix_weixin.x86_64.tar.gz

Rm-rf zabbix_weixin/

Modify corpid, secret, agentid in the / etc/ weixincfg.json configuration file, and test the script to send messages, as shown in figures 6-96 (a) and 6-96 (b):

Cd / usr/local/zabbix/alertscripts

. / weixin wuguangke Jingfeng education alarm test Zabbix fault alarm

. / weixin contact subject body

Standard information format:

Contact, for your Wechat account, note that it is not WeChat account, not Wechat nickname, you can set user account to WeChat account or Wechat nickname, Subject alarm subject, Body alarm details.

Figure 6-96 (a) Wechat configuration file on Zabbix Server

Figure 6-96 (b) Wechat configuration file on Zabbix Server

(7) script call settings

Set the script execution path on the Zabbix_Server side, edit the zabbix_server.conf file, and add the following:

AlertScriptsPath=/usr/local/zabbix/alertscripts

(8) Zabbix Server alarm configuration

Set the Actions action and trigger the Wechat alarm, as shown in figure 6-97 (a), 6-97 (b), and 7-97 (c):

Figure 6-97 (a) Zabbix Server Action Action configuration

Figure 6-97 (b) Zabbix Server Action Action configuration

Figure 6-97 (c) Zabbix Server Action Action configuration

(9) configure Media Type Wechat script

Administration à Media Types à Create Media Type is shown in figures 6-98 (a) and 6-98 (b):

Figure 6-98 (a) Zabbix Server Media Types configuration

(10) configure users to receive Wechat information

The administrators user adminstration medium is shown in figure 6-99:

Figure 6-99 Zabbix Server Users Media

(11) Wechat alarm message test

If the disk capacity is less than 20%, the Wechat alarm will be triggered, as shown in figure 6-100 (a), 6-100 (b) and 6-100 (c):

Figure 6-100 (a) Zabbix Wechat alarm message

Figure 6-100 (b) Zabbix Wechat alarm failure message

Figure 6-100 (c) Zabbix Wechat alarm recovery message

If you think the author's article is good, please reward the author with a few pieces of silver, so that the author will feel full of encouragement and motivation to continue to create! We support originality! Encourage originality!

After the reward, the record of the participants is displayed at the bottom of the article. You can directly scan the Wechat to reward you, and press the reward directly according to the tips.

Custom reward amount, friendly reminder that the reward amount should not exceed 50 yuan, Tuhao can do as much as you like, 51CTO thank you for your support to the author! Thank you for your generosity.

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: 294

*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

Servers

Wechat

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

12
Report