Email on reboot

Adam Funk a24061 at ducksburg.com
Tue Aug 14 18:38:49 UTC 2007


On 2007-08-14, Brian Fahrlander wrote:

> Charles philip Chan wrote:
>> Bart Silverstrim <bsilver at chrononomicon.com> writes:
>> 
>>> Is there a best-practices recommended way to have a 7.04 ubuntu server 
>>> email a specific address if it reboots or is restarted?  Emailing output 
>>> from dmesg or a system log at boot time would be nice, but as long as 
>>> there was some notification of the restart with a timestamp it would be 
>>> useful.
>> 
>> I would put something like this:
>> 
>> 
>> ,----
>> | dmesg | mailx -s "System Rebooted" <email_address>
>> `----
>> 
>> in /etc/rc.local.

(Sorry to repeat myself but) I use crontab's @reboot extension --- is
there any disadvantage to this?


>     Yeah, but that won't fit in a pager display.  :>

How about
   dmesg | tail -20 | mailx -s "System Rebooted" <email_address>
?

;-)





More information about the ubuntu-users mailing list