Mail Notification of remote server reboot.
Hi, I saw this tip today from UGU, and thought some of you might find it useful for security of remote servers. It was a ksh script, I converted to bash. Put it in /etc/rc.d/notify , and make a symlink to it in /etc/rc2.d ln -s /etc/rc.d/notify /etc/rc.d/rc2.d/S99notify ############################################# #!/bin/sh # Boot Notification Script # /etc/rc2.d/S99notify - Sends e-mail notification to the #administrators when the system is booted. DATE=`date` SRVNM=`uname -n` # The next variable can be set for multiple addresses # (i.e. jsmith@yahoo.com,jsmith@hotmail.com) MAILADD=root@you.net mail $MAILADD <<EOF From: $0 To: $MAILADD Subject: Boot of $SRVNM $DATE $SRVNM has booted up. If this is news to you, please investigate. EOF exit 0 ############################################## -- use Perl; #powerful programmable prestidigitation
participants (1)
-
zentara