boot up notification

Walter Hop freebsd at
Fri Jan 14 13:57:26 PST 2005

[in reply to fquest at, 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/  It  sends  out an email to
        root  with  the dmesg output, and also sends an email when the
        system is being shut down.



case "$1" in
                (echo $HOSTNAME was booted at `/bin/date` ; echo ''; echo '--'; echo ''; echo 'dmesg output:' ; /sbin/dmesg) | mail -s "$HOSTNAME boot" root
                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

 Walter Hop <freebsd at> | TransIP |

More information about the freebsd-questions mailing list