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?
I did this by adding a crontab entry on each servers like
@reboot date | mailx -S smtp=smtp://smtp.example.com -s "`hostname` started" -r email@example.com firstname.lastname@example.org
@reboot makes the script invoked after reboot.
For the usage of mailx, please check:
Also note that on Debian, Ubuntu, Linux Mint and others, you may need to install
heirloom-mailx instead of the default