How to configure the zabbix alarm function of Linux system?

  

Linux system If the system is at risk, you can use the zabbix telegram alarm mechanism to automatically send emails to users. This article will introduce how the Linux system configures the zabbix telegram alarm.

1, the client installed telegram:

yum install telegram -y

2, the activation api:

https: //my. Telegram.org/apps

Then rename the public keys to tg-server.pub

3. Start the local listening port:

/usr/bin/telegram- Cli -U root -vvvvRC -k /home/tg-server.pub -W -dL /home/tg.log -P 9999 &

4, Test Send:

echo &ldquo ;msg sa tesddddd ” |  Nc 127.0.0.1 9999 ###说明sa can be a group, can also say personal, then content msg send a message command for telegram

5, zabbix send script

vi telegram.sh< Br>

#! /bin/sh

to=$1

subject=$2

body=$3

echo “msg sa $subject $body” |  Nc 127.0.0.1 9999

Description: msg is to send a message, sa is a group or a user, I am a group here.

The above is the introduction of the zabbix telegram alarm in the Linux system. With this alarm mechanism, the Linux system can be monitored in real time. If the fault is sent, it can be processed in the first time.

Copyright © Windows knowledge All Rights Reserved