Friday, February 01, 2013

Know when your server reboots

If you don't have a fancy monitoring tool in place on your servers, here's a cool little cron job you can add to be notified when your server reboots.

@reboot /bin/echo "$HOSTNAME has rebooted on $(date)" | /bin/mail -s "$HOSTNAME - rebooted" me@somewhere.com

If anyone has suggestions for improvement, I'd love to hear them.

11 comments:

Marc Deop said...

You do not need the pipe:

@reboot /bin/mail -s "$HOSTNAME - rebooted" me@somewhere.com <<< "$HOSTNAME has rebooted on $(date)"

modir said...

Would you put this in crontab as root or into one of the files in /etc/cron.d/?

Chang bui thi said...

great article, I was very impressed about it, wish you would have stayed next share
Signature:
i like play games friv4 online and play games 2 girls Download baixar facebook movel

Frozen Juegos said...

This is a great article. It gave me a lot of useful information. thank you very much.
Signature:
Jugar juegos de frozen en línea gratis, los nuevos de princesa de Disney juegos frozen - la princesa encantadora y linda. Divertirse frozen!

Facebook Descargar said...

Thank you for sharing valuable information. Nice post. I enjoyed reading this post.
Signature:
download descargar facebook gratis para Android celular and download free descargar facebook apk en español, descargar facebook plus , descarga facebook

Whatsapp Descargar said...

This article is really fantastic and thanks for sharing the valuable post.
Signature:
download free descargar whatsapp gratis and download baixar whatsapp gratis online and descargar whatsapp , baixar whatsapp

games unblocked said...

The article you have shared here very awesome. I really like and appreciated your work. I read deeply your article, the points you have mentioned in this article are useful
kids games
friv
unblocked games
juegos de un show mas

Standard Solutions said...

Sharing learning is an extraordinary demonstration and you did that. Much obliged to you for sharing this data.
SEO Services Lahore

Mahjong Free Games said...

run 3 game Nicely written information in this post, the quality of content is fine and picture very nice. Things are very open and intensely clear explanation of issues. football heads juegos de terror online mahjong games Cool math 4 kids

Armando Iswahyudi said...

Hi there,I enjoy reading through your article post, I wanted to write a little comment to support you and wish you a good continuationAll the best for all your blogging efforts.

Katalog Gambar Mebel Set Meja Makan Model Minimalis
Lemari Pakaian
Kursi Makan
Kursi Tamu
Kursi Tamu Jati Murah
Tempat Tidur minimalis
Mebel Murah
Sofa Minimalis
Kursi Tamu Minimalis Modern Murah
Kursi Teras Minimalis
katalog gambar mebel buffet rak tv jati model minimalis
katalog gambar mebel set meja makan model minimalis
mebel jepara
kursi tamu jati

Giải Trí Tổng Hợp said...

The blog or and best that is extremely useful to keep I can share the ideas. Age Of War 2
Big Farm | Slitherio | Tank Trouble
Of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.
Happy Wheels | Goodgeme Empire | Slither.io