Introducing iptraq

My server has a way of going down every now and then due to my ISP being crap as hell.

The problem is that my server is at my home in Stockholm, together with the rest of my family. And I'm ~400 km away from Stockholm.

It then becomes a problem if my server changes IP address, like it always has to do when the Internet connection goes down for an extended period of time - I can't find my own darn server.

Coincidentally, I love Google App Engine for small projects, so I decided to jot down an application which tracks the latest "pings" from a machine, and more precisely its IP address.

Thus, I present to you: iptraq.appspot.com!

Being me, it doesn't really have a user interface at all. No really, it doesn't, at all.

You set it up by following this simple list of instructions:

  1. Send an HTTP POST to the root: curl -d '' iptraq.appspot.com
  2. Copy the character blurb after IPMark:
  3. Send an HTTP POST to /<your blurb>/, like: curl -d '' iptraq.appspot.com/agZpcHRyYXFyDgsSBklQTWFyaxi3mQIM/
  4. Send an HTTP GET to the same place to get a list of updates within the last 24 hours. I suggest you add a bookmark for it.

And that's it. All you need is for your server(s) to ping the URL every half hour or so. I do that using cron, like this:

0,30 * * * * /home/toxik/bin/update_iptraq

And the contents of ~/bin/update_iptraq:

#!/bin/bash
exec /usr/bin/curl -s -d '' 'http://iptraq.appspot.com/<my blurb>/' >/dev/null

I don't silence stderr using 2>&1 because I'd really rather want to know when it doesn't work (a well-setup system will mail you whenever cron scripts print anything to stderr.)

I also use the full path to curl because you can't rely on your environment in a cron script -- everything has to be set explicitly. (In theory.)

And that's it, now you too can track the IP address of your machines.

Update: Good news, everyone! iptraq is now on GitHub.


Comments

Comment the entry:

Name: (required, possibly pseudonym)
Remember me (cookie)

E-mail: (not required, never published, solely for me to reply to you in person)

URL:

Comment:

RSS 2.0