Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Send message after server reboot

by maverick (Curate)
on Mar 07, 2002 at 19:20 UTC ( #150093=note: print w/replies, xml ) Need Help??


in reply to Send message after server reboot

The best way would be to add it to the system start up script. /etc/rc.d/rc.local or something of that sort. If you can't do that, then you can go the cron route.

Linux (don't know about Solaris) has a command called 'last' that will have a line that shows when the system was rebooted. You can narrow the last output by the user which under Linux is 'reboot'. So 'last -1 reboot' would give you the last time the system was rebooted.

The other thing you need to do is keep track of the last reboot time that a notification was sent for, so that you don't double send.

HTH

/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://150093]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-05-26 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?