我有多个(读取 10 秒)MySQL 从服务器在 LAN 中运行。显然,我无法从外部系统自动监控它们。
因此,我想到设置本地 BASH 脚本,在复制失败时发送邮件警报。我得到了用于复制的 BASH 脚本,但现在我陷入了邮件发送部分。
我在 Ubuntu 中安装了 mailutils 并尝试发送邮件。但是,我收到以下错误
“由于发送 MTA 的 IP xx.xx.xx.xxx 信誉不佳,您对该邮件系统的访问已被拒绝”
我发现可以通过将其从列表中删除来克服此问题。但是,我有 10 个这样的 IP,并且可能会随着时间的推移而改变。那么,有没有其他方法可以使用某些服务器发送邮件,而不必担心从 SPAMHaus 列表中删除 IP?
I have multiple (read 10s) MySQL slaves running in a LAN. Obviously, I cannot monitor them automatically from an external systems.
So, I thought of setting up local BASH scripts that will send a mail alert when the replication fails. I got the BASH script for replication but now I am stuck at mailing part..
I installed mailutils in Ubuntu and tried to send a mail. But, I get the following error
"Your access to this mail system has been rejected due to the sending MTA's IP xx.xx.xx.xxx poor reputation"
I found out that I can overcome this by getting it out of the list. But, I have 10s of those IPs and may change over time. So, is there any other method to use some server to send mails without the worry of removing IPs from SPAMHaus list?
发布评论
评论(1)
我建议使用智能主机,例如您提供商的电子邮件服务器,并通过它转发。也就是说,配置您的本地邮件服务器(在 Debian exim 中是默认设置,我猜 Ubuntu 也是如此)以使用智能主机进行邮件传送,并将其配置为重写,以便将来自您系统的所有邮件本地转发到帐户处理你的 MySQL 从站的人,这些人是外部地址的别名。
如果我没记错的话,这可以通过
/etc/aliases
文件来完成。I'd recommend using a smarthost, e.g. your provider's email server, and forward over it. That is, configure your local mail server (in Debian exim is the default, and I guess it's the same for Ubuntu) to use a smarthost for mail delivery and configure it for rewriting such that all mail from your system is locally forwarded to the accounts of the people dealing with your MySQL slaves and these people are aliased to external addresses.
This can be done via the
/etc/aliases
file, if I remember correctly.