How to get reboot messages

Kevin Scott Sumner ksumner at physics.unc.edu
Thu Nov 29 19:45:11 CET 2007


We have our site-specific init script do this on Linux and Solaris.  We 
also dump the users from last into the mail just in case a user rebooted a 
lab machine.

The general algorithm is:
-build the input to /usr/lib/sendmail in some file
-mail it with `cat $file | /usr/lib/sendmail -oi $emailAddress`
-if shutting down, wait 10 seconds (this was for older Solaris, may not be 
needed)

Make it run last on boots and first on shutdowns and you should be good.

Cheers,
Kevin
-----
Kevin Sumner
ksumner at physics.unc.edu
(919) 962-6494
Assistant Systems Administrator
Physics and Astronomy Networking Infrastructure and Computing
University of North Carolina at Chapel Hill


On Thu, 29 Nov 2007, Max Hetrick wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> chris serafin wrote:
>> I have a bunch of devices which alert me fine up/down, but I'm looking
>> to find how to get messages when they reboot. Solarwinds does this for
>> me now, but I'm trying to move off this solution, but my boss want
>> reboot messages as well as up/downs for the devices...
>>
>> Any ideas?
>
> Are you talking Linux? If not, ignore the rest of this message. :)
>
> If so, what about some type of script to write a flag file when the host
> reboots. Then a script which checks to see if that flag file exists. If
> it exists, exit with an OK status and delete the flag file.
>
> I set something similar to this up yesterday with an AS400 backup. My
> boss was tired of getting a page off of a completed backup. He set
> things up to write to an NFS share with a simple touch flag file.
>
> I then check to see if that files exists. If the backup completed
> successfully the night before it sees the file, says ok, deletes the
> file and exits normally. If the file isn't there, then it exits with an
> error to which we get notified.
>
> #!/bin/bash
>
> FILE=/var/flags/AS400_DAILY
>
> if [ -f $FILE ]; then
>        echo "OK: AS400 backup completed normally."
>        rm -f $FILE
>        exit 0
>        else
>        echo "CRIT: AS400 backup error."
>        exit 2
> fi
>
> A simple script of some sort linked to /etc/init.d could write the flag
> file after the system boots and disks are mounted. Once that's there,
> then you can check if the file exists.
>
> It's not elegant, but would work. If anyone has a better idea, please
> chime in.
>
> Regards,
> Max
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.6 (GNU/Linux)
>
> iD8DBQFHTwcKHoeeepPau2ERArpDAJ4lVqyC5z2nWt2uBwD+aFiTBGOYQgCgtZ+f
> rubEvG3ToHPGsm34ubat0UE=
> =GUQs
> -----END PGP SIGNATURE-----
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: The Future of Linux Business White Paper
> from Novell.  From the desktop to the data center, Linux is going
> mainstream.  Let it simplify your IT future.
> http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
>
> -- 
>
>

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list