November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Email Linux

@reboot /bin/mail -s “$HOSTNAME – rebooted”  msn@rmoahn.com <<< “$HOSTNAME has rebooted on $(date)” 

 

The ability to know when a system reboot. The tips below will send out an email when a Linux system is reboot. This should indicate to the Administrator that something went wrong with the shutdown. The tips below are for a Linux based system. There are two method as following :-

Method-1

# crontab -e

@reboot        echo “ALERT – Server `hostname` has Restarted on `date`” | mutt -s “ALERT ::: System Rebooted `hostname`” info@msn.com

Method-2

# vim /etc/rc.local

echo “ALERT – Server `hostname` has Restarted on `date`” | mutt -s “ALERT ::: System Rebooted `hostname`” info@msn.com

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>