by R.I. Pienaar | Jul 19, 2006 | Code
My previous homebrew backup system had a number of drawbacks, one of the biggest was that its daily emails were massive, listing all the files that was backed up.
With a lot of machines being backed up these mails can come to several MB per day but also general Human Nature means I just didn’t pay them enough attention. For instance, I would need to somehow notice if on a given day the tar died half way through by manual inspection, this was pretty useless.
Bacula provides good one-page job status emails on a daily basis but still I tend to not look at them as I will get about 20 of them a day, the ideal situation is to have it only mail you on errors and it does support this. There is one problem with this though, if anything prevents the mail from getting to you, or in-fact if the whole Director process dies and no backups get run at all you just wont know about it.
I’ve written a per-job monitoring solution that uses Bacula’s ability to run a script on the client after a successful backup has been run, it writes a small status file with a timestamp, this I pull into Net-SNMP and query over the network using Nagios.
Now if any of my jobs fail or if the whole backup system collapses Nagios will notify me via my already existing notification systems, email and SMS in my case. I will still get the Error mails from Bacula but I totally do not rely on them, they are merely there for information purposes so I can use them to quickly investigate a error once Nagios has alerted me.
I’ve documented this and put up the short scripts I use to achieve this, you can see this document in my wiki
by R.I. Pienaar | Jul 19, 2006 | Code
I’ve been using the Bacula client/server backup system for my backups. Bacula is on par with commercial client/server backup systems, central control, supports auto changers etc. It is a opensource system and available for Linux, FreeBSD, OS X, Windows etc.
The configuration is pretty complex though and while right now I have mine working I do not have guides written up about it really. I wanted to SSL enable my installation though to give me secure transfer between the various clients and the storage server but found the Bacula documentation on the subject woefully lacking.
I’ve written up a bit of info on my Wiki about getting SSL going on a Bacula installation, you need to first have a fully working Bacula setup before attempting this, as starting from a known working system and then systematically SSL enabling it will ease in debugging and possibly increase your understanding of what is going on.
The full Wiki document can be found here.
by R.I. Pienaar | Jul 12, 2006 | Photography Equipment
I came across a article at Strobist detailing a very cheap light box setup and decided to build one.
It is basically a cardboard box, some tracing paper and a sheet of paper like you’d use to make a school poster on. I didn’t have anything, not even the tape to stick the bits together or something to cut with, I also had to buy 30 sheets of tracing paper since that was the smallest they sold and it all came to about 14 pounds. I had a box here from when I moved to the UK almost 5 years ago so figured its about time I do something with it.
It took about 10 minutes to slap everything together, Pixel found it all very amusing so all round a lot of fun.
Using it is a snap, I’ve not tried it using a desk lamp or something but really cannot imagine why it won’t work, with my SB-800 fully wireless remote flash I works a charm as you can see from the first shot above. The final results can be seen on flickr here with one of the shots below.
by R.I. Pienaar | Jul 11, 2006 | Code
I have a client who needs to host graphic content closer to their audience, partly to speed things up for their audience but also to allow them to save some money on bandwidth bills by spreading it out to cheaper hosts.
The obvious answer is to just use Akamai, but unless you have a huge amount of bandwidth it does not really make financial sense. So I proposed we get a few UML / Virtual Machines at ISPs and host the images there. Typically we’d just round-robin the A record but this doesn’t give us any geo-awareness.
I googled a bit and came across a guy who made a patch to bind 9.2.4. He bascially hooks the Maxmind GeoIP C Library into ISC Bind. As it turns out thats exactly the version RedHat uses in their Enterprise distribution so it seemed like a winner.
The basic idea is to setup a view that matches countries rather than just IP Blocks as is the default supported scenario. A sample view:
view "us" {
match-clients { country_US; };
zone "geotest.devco.net" {
type master;
file "data/us-geotest.devco.net";
};
};
view "other" {
match-clients { any; };
zone "geotest.devco.net" {
type master;
file "data/other-geotest.devco.net";
};
};
The above will serve us-geotest.devco.net to visitors from the United States and everyone else will get other-geotest.devco.net. These 2 zone files are stock standard bind zone files, my sample just set a different A record in each.
To see this in action, first a query from my UK hosted machine:
% host geotest.devco.net
geotest.devco.net has address 193.201.200.135
and now a query from the states:
% host geotest.devco.net
geotest.devco.net has address 72.21.58.28
So to make a long story short, I’ve patched the stock RedHat Enterprise 4 bind RPM with the GeoDNS patch and am making the files available here, first I have the source files up if you want to look through them to ensure I didn’t put any funny stuff in them:
The actual patch from GeoDNS – I had to modify the file names in the patch since the one from the source site is made to patch from outside the bind source dir while RPM will change directory into the source directory before running the patch.
Changes made to the RPM Spec file
Sample config – this gets placed in the standard documentation directory
I’ve build a full RPMs of this on a CentOS 4.3 machine, the files are:
bind-9.2.4-2geodns.i386.rpm
bind-libs-9.2.4-2geodns.i386.rpm
bind-utils-9.2.4-2geodns.i386.rpm
bind-devel-9.2.4-2geodns.i386.rpm
bind-chroot-9.2.4-2geodns.i386.rpm
and finally a Source RPM that you can use to build this all on your own machine:
bind-9.2.4-2geodns.src.rpm
Before you can install these you’ll need to get GeoIP on your machine, CentOS has an extras Yum repository that you can enable in /etc/yum.repos.d/CentOS-Base.repo. Once enabled you can install it with yum:
# yum install GeoIP GeoIP-data
<snip>
Running Transaction
Installing: GeoIP ######################### [1/2]
Installing: GeoIP-data ######################### [2/2]
Installed: GeoIP.i386 0:1.3.14-2.c4 GeoIP-data.i386 0:20060501-2.c4
RedHat Enterprise has an extras CD, you can find GeoIP on there and install it using RPM.
The bind RPMs above should simply install on your standard CentOS/RedHat Enterprise box, be sure to remove all the old bind stuff especially bind-libs before installing these.
by R.I. Pienaar | Jul 7, 2006 | Usefull Things
A year or so ago I had an account with Basecamp, the very successful project management system that spawned Ruby on Rails. I really liked it but the project manager at work didn’t so it kind of fizzled out and eventually I cancelled the $99/month account that we had.
You can try Basecamp for free on a single project and I’ve used it on and off since then, but it’s not been ideal for me to use a hosted service. I tried a number of other products like dotproject. Yesterday I came across a Digg article about activeCollab, it is a GPL licensed Basecamp like project management tool currently in Alpha release.
It requires PHP 5 which I didn’t have on any machine as it seems each of my machines has some code on that only works on PHP 4 but I did a quick install of it on a VMware machine and fell in love with it then put in the effort to fix up a PHP 5 on one of my servers. It is great, even in its Alpha state it is usable and reasonably bug free. I came across one error in tasks which I sent a patch about back to the authors other than that it works a charm.
Click the screenshot below for a view of it, or grab it from http://www.activecollab.com/