Send email notification on system restart
Hi, I wonder what is easiest way to notify system restart over email... Thanks in advance, regards, Rob.
On Wednesday 06 April 2005 14:46, Robert Rozman wrote:
Hi,
I wonder what is easiest way to notify system restart over email...
Thanks in advance,
regards,
Rob.
nice and easy is to put it in your crontab: myhost> crontab -e (this opens up vi as your crontab editor, on a new line put: @reboot mail -s restarted me@myemail.com < /dev/null ) thats it, every time you reboot it will mail you
Hi,
thanks for info. I wonder how to email when system is going to shutdown ?
Thanks in advance,
regards,
Rob.
----- Original Message -----
From: "Hamish"
On Wed, 2005-04-06 at 18:15 +0200, Robert Rozman wrote:
Hi,
thanks for info. I wonder how to email when system is going to shutdown ?
Thanks in advance,
regards,
Rob.
Create your own script and add it to /etc/init.d and link where appropriate. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 * Only reply to the list please* "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
Hi, For reboot, I have in my /etc/init.d/boot.local something like: echo "xxx server has rebooted" | mail -s "xxx server has rebooted" -r root@server.domain hansdp@mydomain.com Something similar in /etc/init.d/halt.local would work for shutdown, but only if the machine is shut down properly. If it's on a UPS with USP monitoring sofware running, I'm sure you can add something somewhere to warn you a couple of minutes before it goes down. -- Kind regards Hans du Plooy SagacIT (Pty) Ltd hansdp at sagacit dot com
Robert Rozman wrote:
Hi,
thanks for info. I wonder how to email when system is going to shutdown ?
You'll have to learn how to use the run levels for this sort of thing. You'll want to configure levels 0 & 6 to run a mail script.
On Wed, 6 Apr 2005 15:22:33 +0100, you wrote:
On Wednesday 06 April 2005 14:46, Robert Rozman wrote:
Hi,
I wonder what is easiest way to notify system restart over email...
Thanks in advance,
regards,
Rob.
nice and easy is to put it in your crontab:
myhost> crontab -e (this opens up vi as your crontab editor, on a new line put: @reboot mail -s restarted me@myemail.com < /dev/null ) thats it, every time you reboot it will mail you
Hey Hamish, thanks! I never knew the @reboot capability in cron - useful trick! Mike- -- Mornings: Evolution in action. Only the grumpy will survive. -- Please note - Due to the intense volume of spam, we have installed site-wide spam filters at catherders.com. If email from you bounces, try non-HTML, non-encoded, non-attachments.
The Wednesday 2005-04-06 at 15:46 +0200, Robert Rozman wrote:
I wonder what is easiest way to notify system restart over email...
Create an init script your self, insert service (chkconfig mynotificationscript on). See "man init.d" for details, use "/etc/init.d/skeleton" for a starting point. You can email yourself the boot log as an attach. Probably you can use "SuSEfirewall2_final" in the Required-Start section. I don't think $ALL works. -- Cheers, Carlos Robinson
participants (7)
-
Carlos E. R.
-
Hamish
-
Hans du Plooy
-
James Knott
-
Ken Schneider
-
Michael W Cocke
-
Robert Rozman