Let TellStick tell you when you’re in trouble

Here follows a crash course how-to visualize the health of your CI server or live system.

  1. Buy a TellStick from Kjell & Company,  http://www.kjell.com/content/templates/shop_main_details.aspx?item=50200&path=&sms_ss=favorites&at_xt=4d336e97c742b49d,1.
  2. Buy a remote switch from Kjell & Company, http://www.kjell.com/content/templates/shop_main_details.aspx?item=50219&path=&sms_ss=favorites&at_xt=4d336ec00712cf8f,0.
  3. Buy your favorite lava lamp/warning light that will indicate the status of your project/live system.
  4. Install the TellStick software as described at http://www.telldus.se.
  5. Add the configuration for your remote switch to /etc/tellstick.conf (see example below). Remember to configure the remote switch in the same way.
  6. Write a program/script that turn on/turn off the remote switch depending on the status of your project (see example below)
  7. Optional, add the program to crontab in order to check the status at regular intervals (see example below).
  8. Done 🙂


tellstick.conf

deviceNode = "/dev/tellstick"
device {
  id = 1
  name = "enterprise"
  protocol = "risingsun"
  model = "codeswitch"
  parameters {
    house = "1"
    unit = "1"
  }
}



check_enterprise.sh

#!/bin/sh

success=`wget -qO – –http-user=<user> –http-password=<pwd> –auth-no-challenge https://<base>/hudson/job/enterprise/lastBuild/  | grep ‘Success’`
failed=`wget -qO – –http-user=<user> –http-password=<pwd> –auth-no-challenge https://<base>/hudson/job/enterprise/lastBuild/  | grep ‘Failed’`

if [ ! -z "${success}" ]; then
        tdtool –on ‘enterprise’
fi

if [ ! -z "${failed}" ]; then
        tdtool –off ‘enterprise’
fi



crontab entry:

* 8-16 * * 1-5 /home/magnus/bin/cron/check_enterprise.sh



A good day at work 🙂

3 responses on “Let TellStick tell you when you’re in trouble

  1. Du fĂ„r visa en lavalampa med bubblor pĂ„ ocksĂ„, annars vet vi ju inte att det fungerar! 😉

  2. Var detta nĂ„got du drömde ihop elller har du fĂ„tt det att lira? Jag har problem med just den setupen du beskriver nĂ€mligen. Vad jag kan hitta sĂ„ skall det vara “HQ” som protocol för de dĂ€r kjellmottagarna, inte risingsun. Har testat bĂ„deoch, och HQ funkar i windows och osx-klienten tellduscenter, men de funkar inte under linuxkliente dĂ€r HQ helt enkelt inte verkar finnas..

    1. .. Det Ă€r “fuhaote” man behöver anvĂ€nda för kjells 50219 med tellstick i linux/bsd. Se http://developer.telldus.com/wiki/TellStick_conf

      Man anvĂ€nder alltsĂ„ “code” istĂ€llet för “house” och “unit”, och det Ă€r 10 siffror, ettor eller nollor dĂ€r en etta representerar “uppe/on” för motsvarande dipswitch pĂ„ mottagaren, och nolla tvĂ€rtom.

Leave a Reply to taliz Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.