In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Zabbix email alarm configuration
First, install sendmail or postfix (just install one)
Yum install sendmail # install service sendmail start # Boot chkconfig sendmail on # set Boot Boot or yum install postfix service postfix start chkconfig postfix on
Second, install the mail sending tool mailx
Yum install mailx # installation
Set the email for sending mail, which is used to send mail.
Cat / etc/mail.rc
/ / the content is as follows set from=xxx@sina.cn set smtp=smtp.sina.com set smtp-auth-user=xxx@sina.cn set smtp-auth-password=xxxxxxx set smtp-auth=login
Send a test email
Echo "zabbix test..." | mail-s "zabbix" xxx@qq.com
4. Zabbix server-side to write a script to send mail.
Mkdir / etc/zabbix/alertscripts vim / etc/zabbix/zabbix_server.conf / / modify alertscripts to the following path
AlertScriptsPath=/etc/zabbix/alertscripts / etc/init.d/zabbix_server restart / / restart the zabbix server
# vim / etc/zabbix/alertscripts/sendmail.sh / / write a script for sending mail
Messages= `echo $3 | tr'\ r\ n''\ n' `subject= `echo $2 | tr'\ r\ n''\ n' `echo "${messages}" | mail-s "${subject}" $1 > > / tmp/sendmail.log 2 > & 1
Increase executable permissions
Chown zabbix.zabbix / etc/zabbix/alertscripts/sendmail.sh chmod + x / etc/zabbix/alertscripts/sendmail.sh
Chown zabbix.zabbix / tmp/sendmail.log
Test:
Su-zabbix
/ etc/zabbix/alertscripts/sendmail.sh xxxx@juzifenqi.com "Test message title"Test message content"
See if the call can be performed by the zabbix user.
Test send script
/ etc/zabbix/alertscripts/sendmail.sh xxx@qq.com "Test message title"Test message content"
All the above operations are operated on the zabbix service side.
5. Zabbix background configuration, log in to the zabbix console http://IP address / zabbix.
1. > Administration | Media types | Create media type, enter the alarm mode configuration page, and create a sendmail.sh alarm method.
Name can be defined by yourself here. If Type selects scripts;Script name, enter the name of the script written under linux, that is, sendmail.sh, and click Add at Script parameters to add it.
{ALERT.SENDTO}
{ALERT.SUBJECT}
{ALERT.MESSAGE} 3 parameters, corresponding to the 3 parameters needed by the sendEmail.sh script: recipient address, topic, details, and then click Add to finish.
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.