Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 13th December 2009, 04:05 AM
Vector's Avatar
Vector Offline
Banned
 
Join Date: Jul 2006
Location: Transgression
Age: 32
Posts: 1,183
linuxfedorafirefox
Thumbs up Your website is DOWN!

If any of you pay for your dedicated servers, you probably have an issue with running out of memory once in a while (especially if your server also runs your telephone system and edits images, etc); and if you run out of memory, then you're probably in the same boat that i'm in: services start failing, starting with NAMED!!!! As a result, no one can get to your websites, which sucks. What's worse, there's no way to know, until the next time you try to get to it (/them).

I have a solution for this . I'm not a shell scripting kinda guy (I've got a few good ones for video transcoding, but that's it), so i'm sure that most of you can enhance this by far. It's so retardedly simple, that i'm not even attaching it. All it does, is check to see if your site resolved, and if not, it sends you an email, and it also can play a sound file to wake you up, in case you're sleeping. You run this as a CRON job, every so often, from your LOCAL machine, and it SHOULD even work from your servers, even if their DNS is down, because it does not mean their NETWORK is down. I haven't tested it on my live servers though, because it works fine from here:

Code:
#!/bin/bash

if /usr/bin/dig ionisis.com | /bin/grep -q "ANSWER: 0"
then
echo "To:vector.thorn@gmail.com
From:system-1@ionisis.com
Cc:jamesnjewell@gmail.com,geercr@gmail.com
Subject:The Ionisis System is Down!!!

The Ionisis System is Down!!!
Trying to bring it back up now...
If i can't bring it up myself, then you must ssh into it, su - in as root, and type: service named start" | /usr/sbin/sendmail -t
/sbin/service turbopanel stop
/sbin/service named start
fi
I would LOVE to have been able to indent my code here, but i don't know how to, without screwing the headers up! Hope it helps someone else.

PS: For those of you who ARE shell scripting Gurus, i'm sure that someone could edit it so that it could optionally also ping the ip address of your server(s) to make sure the network is not also down. I, myself, am not worried about it, but i thought i'd mention the idea in case someone else could use something like that.

Also, if you have many domains, but they are on the same server, then you do not need to duplicate this for each domain, as they all use the same dns server. However, if your domains are on different servers, then you'll want to put an entry for each separate server in the shell script. Remember to chmod +x for this.

Last edited by Vector; 20th February 2010 at 12:47 AM.
Reply With Quote
  #2  
Old 13th December 2009, 04:52 AM
Dan's Avatar
Dan Offline
Administrator
 
Join Date: Jun 2006
Location: Paris, TX
Posts: 22,309
linuxfedorafirefox
Hmmm.


Lose the excess exclamation points!!!!!!!!!!!!!!!!!!!!!!!!!!!

You're starting to look like bee. <....>
__________________
Signature Links | New Posts | Who's on the forums (right now) |

© ® ™ № ¿
Reply With Quote
  #3  
Old 13th December 2009, 04:54 AM
Vector's Avatar
Vector Offline
Banned
 
Join Date: Jul 2006
Location: Transgression
Age: 32
Posts: 1,183
linuxfedorafirefox
Who's "bee"? I actually just copied that from the text file and used it as the subject without even thinking about it. I purposely have it like that in the text file so that when the message arrives in my email box, it catches my eye first (which it should because it is a critical issue). But yeah, my bad
Reply With Quote
  #4  
Old 13th December 2009, 11:04 AM
pete_1967 Online
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,922
linuxfedorafirefox
Why don't you use something like Cacti, Nagios, Munin or Moomps to monitor them?
__________________
A Drink is Not Just For Christmas - SaskyCom :thumb:


“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime” so now go and...
RTFM FIRST: http://docs.fedoraproject.org/ & http://rute.2038bug.com/index.html.gz
Reply With Quote
  #5  
Old 13th December 2009, 04:16 PM
Vector's Avatar
Vector Offline
Banned
 
Join Date: Jul 2006
Location: Transgression
Age: 32
Posts: 1,183
linuxfedorafirefox
Because i've never heard of them, and this is free. I didn't know that this has been done before, but then again, i don't get out much either...
Reply With Quote
  #6  
Old 13th December 2009, 04:35 PM
pete_1967 Online
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,922
linuxfedorafirefox
Quote:
Originally Posted by Vector View Post
Because i've never heard of them, and this is free.
Each and everyone I mentioned above are free, all GPL.

Quote:
Originally Posted by Vector View Post
I didn't know that this has been done before, but then again, i don't get out much either...
You're saying you have never heard of server monitoring software? That's bit worrying you being developer and service provider...
__________________
A Drink is Not Just For Christmas - SaskyCom :thumb:


“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime” so now go and...
RTFM FIRST: http://docs.fedoraproject.org/ & http://rute.2038bug.com/index.html.gz
Reply With Quote
  #7  
Old 13th December 2009, 04:39 PM
Vector's Avatar
Vector Offline
Banned
 
Join Date: Jul 2006
Location: Transgression
Age: 32
Posts: 1,183
linuxfedorafirefox
Eh, never heard of them; never needed anything like this until now; and this is probably over 100x less code to do almost the same thing.

Last edited by Vector; 14th December 2009 at 12:33 PM.
Reply With Quote
Reply

Tags
website

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
website arifdayfolks Servers & Networking 5 10th September 2007 05:49 AM
How can I set DNS for my website sip Servers & Networking 1 31st August 2007 06:46 PM
Can any website Mr A.Countseuss Using Fedora 1 14th June 2005 11:32 PM
website up...now what derek_lee_alby Servers & Networking 9 6th May 2005 07:20 PM
Looking for website help... HolyLiaison Wibble 6 24th May 2004 09:41 PM


Current GMT-time: 16:44 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat