In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
This paper mainly uses the external mailbox account to send the alarm email.
1 if Sendmail or postfix is installed, the service needs to be stopped:
[root@www alertscripts] # uname-a
Linux www 3.10.0-514.el7.x86_64 # 1 SMP Tue Nov 22 16:42:41 UTC 2016 x86'64 GNU/Linux
[root@www ~] # systemctl stop sendmail.service
[root@www ~] # systemctl disable sendmail.service
2 install the mail sending tool mailx:
[root@www ~] # yum install mailx
3 configure Zabbix server external mailbox:
The following statement can be appended to the end of the configuration file:
[root@www ~] # vim / etc/mail.rc
Set from=ze9@sina.com smtp=smtp.sina.com
Set smtp-auth-user=ze9@sina.com smtp-auth-password=19sssss
Set smtp-auth=login
From: the address from which the mail was sent
Smtp: external smtp server address
Smtp-auth-user: user name authenticated by the external smtp server
Smtp-auth-password: user password authenticated by external smtp server
Smtp-auth: the way of email authentication
4 Test:
[root@www ~] # echo "a" | mail-s "b" 3333333@qq.com
Where an is the content and b is the title.
5 configure Zabbix server mail alarm:
5.1 configure alarm media:
Open the management-processing method of zabbix-create media type:
I use a script to send an email to the police. The name of the script is mail.sh. The location of the script, which is set in the zabbix_server.conf configuration file: AlertScriptsPath=/usr/lib/zabbix/alertscripts
[root@www alertscripts] # vim mail.sh
#! / bin/bash
/ usr/bin/echo "$3" | / usr/bin/mail-s "$2" $1
5.2 set alarm users:
I directly used the existing administrator group and added users to it.
5.3 set alarm action:
Open the system configuration of zabbix-Action-Select event source as trigger-create action:
Trigger condition settings:
Detailed operation settings, that is, the actions to be performed after the trigger conditions are met. Here, it is generally set to send e-mail and set the users to receive mail (it is recommended that each group correspond to one user, so that it is easy to set the sending object when sending mail):
At this point, the mail alarm has been set up.
General configuration steps for 1:Zabbix monitoring server are attached:
1) Custom monitoring template
2) add monitoring devices by means of automatic discovery (or automatic registration)
3) customize monitoring items and triggers according to requirements
4) set the alarm method (such as email or SMS)
5) Optimization of Zabbix server
Attachment 2: ways to solve the problem of sending attachments to email alarms:
The alarm script is as follows:
#! / bin/bash
# export.UTF-8
FILE=/tmp/mailtmp.txt
Echo "$3" > $FILE
Dos2unix-k $FILE
/ bin/mail-s "$2" $1 < $FILE
[root@localhost alertscripts] # touch / tmp/mailtmp.txt
[root@localhost alertscripts] # chown zabbix.zabbix / tmp/mailtmp.txt
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.