-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbootmonitor.ksh
51 lines (39 loc) · 1.22 KB
/
bootmonitor.ksh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/ksh
###
## bootmonitor
## System Boot Notification Script
##
## Notifies administrators when a server reboots.
## /etc/rc2.d/S99notify
## Sends e-mail notification to the administrators
## when the system is booted.
##
## Submitter: Gideon Rasmussen
## Submitter Email: [email protected]
## *****************************************************************
PATH=/usr/sbin:/usr/bin
DATE="`date`"
SRVNM=`uname -n`
# The next variable can be set for multiple addresses
# (i.e. [email protected],[email protected])
MAILADD=monitor
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
##############################################################################
### This script is submitted to BigAdmin by a user of the BigAdmin community.
### Sun Microsystems, Inc. is not responsible for the
### contents or the code enclosed.
###
###
### Copyright 2007 Sun Microsystems, Inc. ALL RIGHTS RESERVED
### Use of this software is authorized pursuant to the
### terms of the license found at
### http://www.sun.com/bigadmin/common/berkeley_license.html
##############################################################################