linux自动启动服务器_Linux服务器启动后如何自动向管理员发送电子邮件?

linux自动启动服务器

Managing a cluster of servers, I would like to notified when a server is started.

在管理服务器群集时,我想在服务器启动时得到通知。

How to make the Linux servers email me or other admins automatically after they are started?

Linux服务器启动后,如何使它们自动我或其他管理员发送电子邮件

I did this by adding a crontab entry on each servers like

我是通过在每个服务器上添加一个crontab条目来做到这一点的

@reboot date |mailx -S smtp=smtp://smtp.example.com -s "`hostname` started" -r zma@example.com zma@example.com

Here, @reboot makes the script invoked after reboot.

在此, @reboot使重新引导后调用脚本。

For the usage of mailx, please check:

有关mailx的用法,请检查:

Sending Email Using mailx in Linux Through Internal SMTP

在Linux中通过内部SMTP使用mailx发送电子邮件

Sending Email from mailx Command in Linux Using Gmail’s SMTP

在Linux中使用Gmail的SMTP从mailx命令发送电子邮件

mailx man page

mailx手册页

Also note that on Debian, Ubuntu, Linux Mint and others, you may need to install heirloom-mailx instead of the default mailutil.

另请注意,在Debian,Ubuntu,Linux Mint等上,您可能需要安装heirloom-mailx而不是默认的mailutil

Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/how-to-email-admins-automatically-after-a-linux-server-starts/

linux自动启动服务器

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值