Solution MailX and Zabbix optimization zabbix3.x email blast "Support for SMTP authentication was not compiled in" solution once zabbix server keeps restarting

Today to introduce two more difficult problem I encountered in the use Zabbix process.

  1. mail delivery service to fail.

  2. due to the slow query results in no alarm.

The following is a brief description of these two issues and processes, reference documentation.

1. Linux MailX

  Description of the problem:

    Use zabbix mail crash the service, the queries are too low lead to libcurl version, install the new version after deleting the old version, Zabbix restart failed to locate because libcurl failed to start, re-install libcurl, service starts normally.

 

  There are "Z" Friends and their solutions to similar problems:

  1.  Solution zabbix3.x mail blast "Support for SMTP authentication was not compiled in" the

  2. "Support for SMTP authentication was not compiled in","Failed Initialization",zabbix邮件告警libcurl问题

  3.  Error [0007]: zabbix in because curl version is too low to send a message

 

  The following detailed description, first of all, look at the mailx installation, use and Zabbix-mail alert settings.

  1.  Basic usage mailx and sendEmail comparison  compared using two e-mail software.

  2.  Basic Usage mailx and sendEmail comparison  is still relatively Both mail software, but focuses on the ways to obtain the certificate.

  3.  Zabbix Mail alarm settings   more comprehensive description of the installation using internal and external mailbox of the mailbox in two different ways, and Zabbix configuration settings.

  4.  Under linux configure the third-party mailbox to send mail and mailx  a more detailed description of how to use QQ mailbox to send mail.

 

  I believe you read other "Z" Friends of the above solutions, has been thinking of how to deal with this problem.

  Supplement, when problems arise Zabbix (start), is a good habit to query log, path - / var / log / zabbix / zabbix_server.log. Of course, journalctl -ne can help us quickly locate the problem.

  1.  resolve once zabbix server keeps restarting

  2.  Linux libcurl installation and precautions

  3.  curl download path

 

  In solving the problem of abnormal Zabbix letter, we ran into a new problem, use the company's outlook mail, letter Times are wrong.

mail.******.com 不支持smtp
smtp-server: 504 5.7.4 Unrecognized authentication type
"/root/dead.letter" 11/293
. . . message not sent

  This is what causes it? Exchange2012 no longer open AuthLogin default authentication protocol . But we are not IT Yeah, you can not modify the mailbox policy, how to do it? This article gave me an idea, and sure enough, use ntml certification, you can delete the account password and login letter. mail.rc set as follows.

set [email protected] // sender 
set smtp = 10.9.9.9 // smtp server IP 
#set the SMTP-auth-ADMIN = // following the User login commented out 
#set smtp-auth-password password =   
#set the auth = SMTP-Login  

 

  I ended up using an external mail + write a script to send mail, here I attach a letter of Zabbix settings and scripts.

 

 

# mail.sh
#!/usr/bin/sh 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

2. Zabbix优化

  问题描述:

    Zabbix在使用了一段时间后突然出现大量(误)报警,初步怀疑是网络故障,但是查询Log后发现在那个时间段出现了慢查询。再次强调查询log的重要性!!

  那么什么是慢查询,又该如何优化呢?请参考以下博文。

  1. zabbix优化指南

  2. zabbix性能优化

  3. 由浅入深学习Zabbix,第五期:性能调优总结 

综合上述博客,Zabbix常用的优化策略有使用硬件性能足够好的服务器,分布式部署,调整MySQL性能,调整Zabbix自身配置,分库分表等。
结合实际情况,我选择的临时应对方案是:
增加报警间隔时长,之前设置的触发器是10s接收不到agent ping信号就报警,改成30s,cover掉慢查询的时间。
长久解决方案:
1. 调整MySQL性能,比如增加buffer_size等;
2. 调整Zabbix配置,比如调整zabbix工作进程数量等。

  除了上述我们使用的方案外,您还可以选择高阶的优化方案,对数据库进行优化如读写分离,分表等。因为Zabbix的瓶颈主要还是在DB上。

  以上是一些参考博客:

  1. zabbix 的一次优化尝试

  2. zabbix3.2对某几个大表进行分区操作

Guess you like

Origin www.cnblogs.com/lq67/p/11360353.html