boot up notification

2005-01-14 Thread Jim Pazarena
I would like one of my servers to send me an email when
it boots. I envision a script in rc.conf to do this.
Is there an easier way, or an automatic system which can do this?
Jim
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: boot up notification

2005-01-14 Thread Tabor Kelly
Jim Pazarena wrote:
snip
In rc.local:
mail -s 'subject' [EMAIL PROTECTED]  message_to_send.txt
--
Tabor Kelly
[EMAIL PROTECTED]
http://tabor.taborandtashell.net
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: boot up notification

2005-01-14 Thread Valentin Nechayev
 Fri, Jan 14, 2005 at 13:04:59, fquest wrote about boot up notification: 

 I would like one of my servers to send me an email when
 it boots. I envision a script in rc.conf to do this.
This is too bad, as rc.conf is called tens times during boot.

 Is there an easier way, or an automatic system which can do this?

Add to /etc/rc.local, /usr/local/etc/rc.d or '@reboot' crontab line.


-netch-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: boot up notification

2005-01-14 Thread Gustavo De Nardin
Jim Pazarena wrote:
 I would like one of my servers to send me an email when
 it boots. I envision a script in rc.conf to do this.
 
 Is there an easier way, or an automatic system which can do this?

  You could set up a cronjob to run at '@reboot':
$ crontab -l
@reboot echo | mail -s The eagle has landed root

  See crontab(5).
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: boot up notification

2005-01-14 Thread Walter Hop
[in reply to [EMAIL PROTECTED], 14-1-2005]

 I would like one of my servers to send me an email when
 it boots. I envision a script in rc.conf to do this.

 Is there an easier way, or an automatic system which can do this?


We  are  using  a  simple  shell  script that can be placed in
/usr/local/etc/rc.d/bootreport.sh.  It  sends  out an email to
root  with  the dmesg output, and also sends an email when the
system is being shut down.


#!/bin/sh

HOSTNAME=`/bin/hostname`;

case $1 in
start)
(echo $HOSTNAME was booted at `/bin/date` ; echo ''; echo '--'; 
echo ''; echo 'dmesg output:' ; /sbin/dmesg) | mail -s $HOSTNAME boot root
;;
stop)
echo $HOSTNAME was shut down on user request at `/bin/date` | 
mail -s $HOSTNAME shutdown root
;;
*)
echo 
echo Usage: `basename $0` { start | stop }
echo 
exit 64
;;
esac



-- 
 Walter Hop [EMAIL PROTECTED] | TransIP | http://www.transip.nl/

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: boot up notification

2005-01-14 Thread Jerry McAllister
 
 I would like one of my servers to send me an email when
 it boots. I envision a script in rc.conf to do this.
 
 Is there an easier way, or an automatic system which can do this?

Put a little script in /usr/local/etc/rc.d

name it something like /usr/local/etc/rc.d/bootmail.sh
In it, put something like:

#!/bin/sh
 echo Coming Up at: `date` | /usr/bin/mail -s 'Boot Notice' [EMAIL PROTECTED]
exit 0

Make sure it has execute permission and it will run at boot time.

It will send you an Email message complete with the date
when it boots.   Note the _back_ single quotes around date.

jerry

 
 Jim
 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]