Doing More With Less (Part 1 of N)

In recent weeks I have been massively overhauling the monitoring and alerting infrastructure. Most of the low-level box checks are easily handled by CloudWatch, and some of the more sophisticated trip-wires can be handled by looking for patterns in our logs, collated by LogStash and exported to Loggly. In either case, I have trip wires handing off to PagerDuty to do the actual alerting. This appeals to my preference for strong separation of concerns – LogStash/Loggly are good at collating logs, CloudWatch is good at triggering events off metrics, and PagerDuty knows how to navigate escalation paths and how to send outgoing messages to which poor benighted bastard – generally and almost always me – has to be woken at 1:00 AM.

One hole in the new scheme was a simple reachability test for some of our web end points. These are mostly simple enough that a positive response is a reliable indicator that the service is working, so sophisticated monitoring is not needed (yet). I looked around at the various offerings akin to Pingdom, and wondered if there was a cheaper way of doing it. Half an hour with the (excellent) API documentation from PagerDuty, and I’ve got a series of tiny shell scripts being executed via RunDeck.

#!/bin/bash
if [ $(curl -sL -w "%{http_code}\\n" "http://some.host.com/api/status" -o /dev/null) -ne 200 ]
then
  echo "Service not responding, raising PagerDuty alert"

  curl -H "Content-type: application/json" -X POST \
    -d '{
    "service_key": "66c69479d8b4a00c609245f656d443f1",
    "event_type": "trigger",
    "description": "Service on http://some.host.com/api/status is not responding with HTTP 200",
    "client": "Infra RunDeck",
    "client_url": "http://our.rundeck.com"
    }' https://events.pagerduty.com/generic/2010-04-15/create_event.json
fi

This weekend I hope to replace the remaining staff with a series of cunning shell scripts. Meanwhile the above script saves us potentially hundreds of pounds a year in monitoring costs.

The Perfect Shoe

I’ve been thinking about shoes lately, specifically shoes for HEMA. Now, for any chance of deciphering this rambling rant, the reader needs the context. When I was young and more foolish than I am now, I buggered up my right knee. This was not a world changing, oh my god there is blood everywhere kind of injury, it was just the sort of strain that causes you to limp for a month and curse stairs. Except I’ve been limping and cursing ever since. Stairs make it hurt. Sitting at a desk for hours makes it hurt. Standing makes it hurt. Running makes it hurt. Fencing makes it hurt. Most of the time it’s a dull annoying ache, like that work colleague who just won’t shut up, but after exercise it tends to become genuinely sore, and occasionally feels like evil dwarves are hammering 4″ roofing nails into the joint to make it stronger.

Continue reading “The Perfect Shoe”

Making sawdust

Finally got to spend some time in the shed – interspersed with dealing with the dog , and a bunch of running around. We got the roof rack on the Panda early Saturday morning, went Wickes (which is the English equivalent of the Australian Bunnings) and loaded up the roof rack with ½” ply and a dozen 2″x4″x8′. The timber calculations were… rough… so I was not sure that I would get two benches out of what I had or not. So I spent about 10 hours over two days turning the pile of bits into the first of two putting-stuff-on-top-of benches. At the end, I found I had estimated correctly, and I have exactly enough timber left to make a second one, which I will begin next week. This week has to be about preparations for the Towton walk.

Continue reading “Making sawdust”

Cheaper Than Therapy

I’ve finally – thanks to Delia seeing something on Facebook – gotten a lease on a space that I can use as a workshop. It’s a few minutes bike ride up the Thames, in a converted shipping container (or rather two, joined together). The rent is reasonable, and the space is probably more than I really need. It’s pretty rudimentary and will probably be freezing in winter, but it’s definitely A Shed. I’ve moved all my tools in, and started settling.

Continue reading “Cheaper Than Therapy”