Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Jun 23, 2004 8:59 am 
Offline
Senior Newbie

Joined: Thu Feb 19, 2004 10:06 am
Posts: 14
Website: http://www.doc2pdf.net
Location: Iceland
Hi. I just wanted to know if it is possible to get an email notification if hostXX has to be restarted or networks get disconnected (because of host problems)?

I'd like that very much.

BTW, I think linode.com is a great service worthy of my $$
:)

_________________
Visit http://www.doc2pdf.net for a free, no-need-to-register .doc to .pdf converter.


Top
   
 Post subject:
PostPosted: Wed Jun 23, 2004 9:21 am 
Offline
Junior Member
User avatar

Joined: Sat Jun 05, 2004 1:22 pm
Posts: 40
AOL: fester516
Location: Brooklyn, NY
You could always sign up for a free account at:

http://www.siteuptime.com or http://www.easymonitor.com

Both are free and can send you an SMS message..

Ron


Top
   
 Post subject:
PostPosted: Wed Jun 23, 2004 10:27 am 
Offline
Senior Member
User avatar

Joined: Wed Mar 17, 2004 12:35 am
Posts: 118
Website: http://www.necrobones.com/
Location: Sterling, VA
A simple solution, at least for the restart part (not bandwidth disconnects) is to have a script that gets run from your rc.local startup script that will e-mail you. Here's an example:

Code:
#!/bin/sh
#
# This file, placed in /etc/rc.d/rc.local, will send an e-mail
# alert when the system boots up.
SYSADMIN=whatever@yourdomain.tld
MAIL="/bin/mail"
HOSTNAME=`hostname`
MSG="$HOSTNAME System restart!"
(
   echo "$MSG"
   echo " "
   /usr/bin/uname -a
   echo " "
   /usr/bin/uptime
   echo " "
   /usr/bin/last -10
   echo " "
   /bin/df -m
   echo " "
) | $MAIL -s "$MSG" $SYSADMIN
exit 0


In this example I also have it showing a few system statistics too. You'd of course have to edit paths if they're different on your system, and put your own e-mail address in. (the paths may not even be necessary, it depends on where/how you call the script from your startup scripts).

_________________
----
Ed/Bones.


Top
   
 Post subject:
PostPosted: Wed Jun 23, 2004 10:36 am 
Offline
Senior Newbie

Joined: Thu Feb 19, 2004 10:06 am
Posts: 14
Website: http://www.doc2pdf.net
Location: Iceland
NecroBones wrote:
A simple solution, at least for the restart part (not bandwidth disconnects) is to have a script that gets run from your rc.local startup script that will e-mail you. Here's an example:

Code:
#!/bin/sh
#
# This file, placed in /etc/rc.d/rc.local, will send an e-mail
# alert when the system boots up.
SYSADMIN=whatever@yourdomain.tld
MAIL="/bin/mail"
HOSTNAME=`hostname`
MSG="$HOSTNAME System restart!"
(
   echo "$MSG"
   echo " "
   /usr/bin/uname -a
   echo " "
   /usr/bin/uptime
   echo " "
   /usr/bin/last -10
   echo " "
   /bin/df -m
   echo " "
) | $MAIL -s "$MSG" $SYSADMIN
exit 0


In this example I also have it showing a few system statistics too. You'd of course have to edit paths if they're different on your system, and put your own e-mail address in. (the paths may not even be necessary, it depends on where/how you call the script from your startup scripts).



Don't I have to have postfix or something like that installed and configured then?

_________________
Visit http://www.doc2pdf.net for a free, no-need-to-register .doc to .pdf converter.


Top
   
 Post subject:
PostPosted: Thu Jun 24, 2004 10:14 am 
Offline
Senior Member
User avatar

Joined: Wed Mar 17, 2004 12:35 am
Posts: 118
Website: http://www.necrobones.com/
Location: Sterling, VA
'mail' is a mail client program that's fairly common in several distros, I think... most of my experience is with slackware however. I guess if you don't have any MTA installed at all, it might be a tad more difficult. I think you can use a .mailrc file to change it's behaviour, possibly specify another mail relay other than the localhost, but I haven't looked that deeply into it.

_________________
----

Ed/Bones.


Top
   
 Post subject:
PostPosted: Thu Jun 24, 2004 7:53 pm 
Offline
Senior Member

Joined: Sun Nov 30, 2003 2:28 pm
Posts: 245
/bin/mail is strictly local, it calls /usr/sbin/sendmail to send mail. Now, /usr/sbin/sendmail may be provided by any number of MTAs, such as Sendmail, Postfix, or Exim. If you don't have any of those set up, and have another server you can relay through, you can use 'ssmtp', whichcan do that (and *only* that: no local spool, no reception, no nothing).

OTOH, it's fairly difficult to setup an Linux machine w/o *any* MTA installed, even if it's configured only for local delivery. Check if you already have a /usr/sbin/sendmail (or possibly /usr/lib/sendmail), and use the appropriate distro specific tool to find out what package put it there (e.g. 'dpkg -S /usr/sbin/sendmail)

_________________
The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world.
-- seen on the net


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: mwchase and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group