Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I relatively recently signed up with a new ISP and I have about 2 weeks to determine if their uptime is sufficient for running a server. My initial plan was to install Nagios on an old laptop and store it at a friend's house, but - long story short - a server at a friend's house is not feasible.

I have a two-fold goal:

  1. In the short term, I need something to determine if the new Internet connection is stable enough to run a server on. It doesn't need to alert me every time the Internet goes down, but it does need to have some kind of log I can look at to see if there was any downtime.
  2. In the longer term, I would like something that would alert me as soon as it has a problem reaching the server.

Ideally, I could accomplish both goals with the same piece of software.

I have an irrational aversion to SaaS, so I was thinking since I have an always-on, always-connected Linux box in my pocket (in the form of an Android phone), surely there's some existing tool for it to monitor the server's uptime.

When I scoured the Internet for such an app, it was a descent into madness. Many "monitoring" apps only check the server when you open up the app and tell it to ping. I want to set it up once, and then have the phone run checks every 1-5 minutes without any further action on my part. I don't mind it saturating my phone's data connection since I'm only really going to be wailing on it for the next 2 weeks. After that I can reduce the polling frequency.

Because I haven't found any such app, I'm thinking I can accomplish the first goal with a cron job on the server that would ping Google or something and write a log. This seems like the simplest option for right now, but it doesn't address the longer-term goal for monitoring.

Potentially relevant information: My budget is $0. All my devices are Linux or Android.

I'm hoping the brilliant people of Server Fault will have some insight/recommendation on how to best accomplish this goal. Thanks.

share|improve this question
1  
Reading between the lines it appears you're planning to run a production server on DSL or cable? is this the case? if so then you should expect significant outages, even for the most professional of service packages as these connection types aren't designed for 100% duty cycle operations but are value-driven. –  Chopper3 Apr 8 '13 at 20:35
    
As Fiisch has already shown, you can easily script a simple solution to run from the server. You can also use Nagios from another machine or Cacti. You could also install Cacti on the server it's self and graph pings out to the internet extra. Nagio will alert of you failures, I'm not going to delve into detail as these are easy to find on the Internet. I just wanted to comment and say, don't monitor this from your phone. The connection will be no were near as good as the server connection, even if it's ADSL. You will have invalid test results. –  jwbensley Apr 8 '13 at 20:38
    
Thanks for your help, everybody. The hope is to run a production server on business fiber optic - the sales folks swear it's suitable for running a server. I share Chopper3's suspicion, which is why I'm looking to verify the quality of the connection during the probationary period. javano - thanks for pointing that out. I don't know why that didn't occur to me. –  kjc26ster Apr 8 '13 at 23:09
    
The sales folk will say anything to get your money. I suspect they're full of shit. –  Tom O'Connor Apr 9 '13 at 0:41

4 Answers 4

up vote 2 down vote accepted

Its a bit of a shopping question, but I'll answer anyway since its a useful sysadmin tool: Decaf Monitor does exactly what you are asking. There are plenty of hosted services which do this, and if monitoring a single server its often free. I've found Montastic good enough for casual monitoring. For one server where you aren't willing to invest much money, you are right about the irrationality of being averse to this kind of solution.

Really though, if you are doing this in any sort of professional way (to be on topic on this site) then why would you host a single server yourself when you can rent rackspace or a VPS for around USD300 a year with massive redundancy and gigabit connection speeds?

If you really want to host, and again assuming that this is a professional question, then any ISP you should consider will offer an enforceable service level agreement. If they offer this you can bet they are very unlikely to fail to meet it.

share|improve this answer
    
Decaf Monitor looks to be exactly what I'd hoped for, thank you! It's quasi-pro right now. A colo is definitely the long-term plan, but last I checked, the best price I found was about USD750/year. I'd like to have a stable enough connection at home to have a couple paying clients before I spring for rackspace. I was really badly burned by my last ISP and the worthless "enforceable service level agreement", which is why I'm looking to verify that the product is as good as the sales people promise. –  kjc26ster Apr 8 '13 at 23:03

If you have a known good remote point you can test, then you can implement your own ping/netcat/curl/wget tests to validate the network connection's availability as well as the latency.

If you have no need of being notified immediately, you can just log locally. This can be done on your hosting server... or on another, perhaps dedicated, monitoring box. A monitoring box would be ideal, especially if you will be hosting other peoples' hardware and/or VPS(s) in the future.

If you need to be notified, then you will need a celphone. Preferably one that you have a means of linking up to the net with(An Android phone, for instance), but an old school GSM 3g "modem" phone is fine as well. You can then use that out of band link to send you a notification email or email-to-sms to page you of the outage or any variance with your connectivity.

I've been giving some thought to old smart phones as self contained battery backed up monitoring and notification nodes. Given that most Android phones can be coaxed to run Java or get a shell(same story with iPhones, Kindles, etc.), there are many options along this line.

Though, if you are thinking of a commercial venture, a Mifi for the home "data center" as the out of band link would be better.

share|improve this answer

Simple shell-script watchdog could be useful... something like: Sorry for me being too lazy to write it in bash but I'm just giving the idea.

VAR=0
while(true){
 ping -c 1 yourserver
 if failed then increment VAR
 else VAR=0
 if VAR=10 then notify me
 sleep 1000
}
share|improve this answer
    
Thanks for the idea. I considered writing one such script, but it doesn't address my secondary goal of alerting me when downtime occurs. Thank you for providing a starting point if I do decide to go that route. –  kjc26ster Apr 8 '13 at 23:14

My evaluation period is now over, so I thought I'd post a follow-up: I went with Decaf Monitor and I'd recommend it for short-term monitoring.

The default config options took a while to detect an outage, so I ratcheted the sensitivity way up. It caught downtime almost immediately. Unfortunately, when there is an outage, Decaf Monitor vibrates the phone until you turn the screen on and acknowledge it, and it does so after every check (which I had set to once a minute), so it's really annoying if you're in the middle of something you can drop (stuck in traffic, at the dentist). I didn't see any settings to alter that, but it's possible there is one and I just missed it.

There were surprisingly few false alerts. When my phone lost its connection, Decaf Monitor would put an icon in the status bar indicating it couldn't connect, but wouldn't vibrate, and the icon would disappear on its own when connection was restored.

Because it's so persistent about its alerts, I don't think it's well-suited to long-term monitoring, but it was perfect for keeping a sharp eye on the server for a short period.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.