Pragmatic Automation http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi Pragmatic Automation. Hosted by Mike Clark. en-us Using the Firecracker with Macs http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/FirecrackerWithMacs.rdoc <a href="http://onestepback.org/">Jim Weirich</a> wrote in to say that he has it on good authority that the <a href="http://www.keyspan.com/products/usa19hs/homepage.spml">KeySpan USA-19HS</a> will properly drive a <a href="http://www.x10.com/products/firecracker.htm">Firecracker</a>. The Keyspan adapter comes with Mac OS X drivers that speak the handshake signals the Firecracker listens for. Huzzah! That means you can remotely control your <a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BubbleBubbleBuildsInTrouble.rdoc">lava lamps</a> from your Mac. <p> Enjoy! </p> Bubble, Bubble, Build's In Trouble http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BubbleBubbleBuildsInTrouble.rdoc Your software is being automatically built and tested on a schedule. It even sends you an email when the code doesn&#8217;t compile or pass its tests. You&#8217;re certainly ahead of most projects, but email is just so 90s. Even if you could manage to find those build failure emails amidst all that spam, you&#8217;re reading yesterday&#8217;s news. Indeed, you may already be ignoring the status of the scheduled build. <p> The Monitoring chapter of <a href="http://www.pragmaticprogrammer.com/sk/auto">the book</a> offers alternative, in-your-face, worth-getting-up-for-in-the-morning techniques for monitoring scheduled builds. The most popular technique came by way of a story contributed by <a href="http://www.developertesting.com/managed_developer_testing/000036.html">Alberto Savoia</a>. He describes how his project uses red and green lava lamps to radiate the status of their scheduled build. Better yet, those lamps are controlled using X10 devices such as those used to turn on your household lamps so that you don&#8217;t arrive home to a dark house. </p> <p> Well, as you might imagine, I could hardly wait to build my very own build-monitoring lava lamp kit. And as bonus material for readers of the book, I&#8217;ve crafted a bit o&#8217; software that integrates with <a href="http://cruisecontrol.sourceforge.net/">CruiseControl</a>. So now you too can enjoy red and green bubbles on your project! </p> <h3>Bill of Materials</h3> <p> To get started, you need some automation gear. Think of these gadgets as this year&#8217;s essential project accessories: </p> <ul> <li><a href="http://www.x10.com/products/firecracker.htm">4-Piece Firecracker Automation System</a> <p> This kit includes: </p> <ul> <li>1 Firecracker Computer Interface </li> <li>1 Transceiver Module </li> <li>1 Lamp Module </li> <li>1 Palm Pad Remote Control </li> </ul> <p> Cost: $39.99 </p> <p> (Props go to the folks at <a href="http://x10.com">x10.com</a> for supporting this project by supplying me with a complimentary kit. It all fits in a wee box, so I can carry it from project to project.) </p> <p> With that kit, you can control two lava lamps &#8212; one plugged into the transceiver module and the other plugged into the lamp module. You can optionally purchase another appliance module if you want to control two appliances. For example, you might want your build process to turn on a coffee pot when the build fails and then kick start your margarita machine when the build is fixed. </p> </li> <li>2 lamps, preferably the kind that boil red and green lava <p> I used the <a href="http://www.mmeworld.com/">Hot Rock Lite F/X</a> (yellow earth/blue liquid and red earth/purple liquid). Note for legal purposes that these lamps (shown in pictures below) are <em>not</em> <a href="http://lavaworld.com/">LAVA(R) brand motion lamps</a>, but those will work just as well. </p> <p> Cost: $9.99 each at Target or Walmart </p> </li> <li><a href="http://www.pragmaticautomation.com/code/pragautox10-1_0.zip">Pragmatic Automation X10 software</a> <p> It&#8217;s an open source Java library that includes the CruiseControl plug-in, an API to make your wildest X10 dreams come true, detailed instructions, and an ever-so-useful collection of tests. </p> <p> Way down deep, the library uses the <a href="http://java.sun.com/products/javacomm/">Java Communications API</a> to send bits out over the serial port and into the Firecracker Computer Interface. (Linux users will need the <a href="http://www.rxtx.org/">RXTX</a> implementation). Michel Dalal&#8217;s <a href="http://www.micheldalal.com/sw/java/x10/">Java X10 CM17A API library</a>, an implementation of the <a href="ftp://ftp.x10.com/pub/manuals/cm17a_protocol.txt">FireCracker (CM17A) Communications Specification</a>, is used to send out the correct 1s and 0s in response to human-friendly commands. Many thanks to him for doing all the low-level bit twiddling and sharing the goodies with us! </p> <p> Cost: Free to readers of <a href="http://www.pragmaticprogrammer.com/sk/auto">Pragmatic Project Automation</a> </p> </li> </ul> <h3>Assembling the Kit</h3> <p> With that hardware in hand, you&#8217;re ready to start the assembly process. The Firecracker Automation System includes instructions written for your average home electronics consumer, so your average computer/network geek should have no trouble. I&#8217;ll spare you all the gory details and instead run through a quick visual tutorial of my setup. </p> <p> Start by plugging the Firecracker Computer Interface into a serial port of your scheduled build machine: </p> <p> <img src="http://www.pragmaticautomation.com/images/firecracker.jpg"> </p> <p> This little gem sends a wireless signal from the computer to the transceiver module. Notice that you don&#8217;t lose the serial port. You can plug another serial device into the back of Firecracker Computer Interface. </p> <p> Next, plug the transceiver module into any wall outlet within your electrical wiring system. Then turn on the lamp you want the build process to light up when the build fails (the red lamp) and plug it into the transceiver module: </p> <p> <img src="http://www.pragmaticautomation.com/images/transceiver_module.jpg"> </p> <p> See that antennae on the transceiver? The transceiver picks up the RF signal sent by the Firecracker Computer Interface connected to the computer, converts it into an X10 signal, and broadcasts the X10 signal across the electrical wiring system. </p> <p> Every X10 module is uniquely identified by a house code (A-P) and a unit code (1-16). By default, the transceiver is configured to listen on &quot;A1&quot;. So when the Firecracker Computer Interface sends a signal that tells module &quot;A1&quot; to turn on, the device that&#8217;s connected to the transceiver&#8212;the red lamp&#8212;is turned on. </p> <p> Next, plug the lamp module into a wall outlet and set its house and unit code to &quot;A2&quot;. Then turn on the lamp you want the build process to light up when the build <em>passes</em> (the green lamp) and plug it into the lamp module, like so: </p> <p> <img src="http://www.pragmaticautomation.com/images/lamp_module.jpg"> </p> <p> When the Firecracker Computer Interface sends a signal instructing the &quot;A2&quot; module to turn on, the transceiver picks up the signal and broadcasts it out over the electrical wires. The lamp module hears the signal and turns on the green lamp. </p> <p> That&#8217;s it for assembly! </p> <p> At this point it&#8217;s a good idea to make sure you can turn these lamps on and off at will using the free software <a href="http://www.x10.com/products/firecracker.htm">(separate download</a>) that emulates the Palm Pad Remote Control. It sends signals through the Firecracker Computer Interface, so it&#8217;s a good sanity check that you have everything hooked up correctly. </p> <h3>Installing the Software</h3> <p> OK, now you want to hook the lava lamps up to your scheduled build process running in <a href="http://cruisecontrol.sourceforge.net/">CruiseControl</a>. That&#8217;s where the <a href="http://www.pragmaticautomation.com/code/pragautox10-1_0.zip">Pragmatic Automation X10 software</a> comes in. </p> <p> The README file describes how to install and test the software in detail. The final step is to register the CruiseControl plug-in that effectively wires up the lamps to indicate the status of each CruiseControl build cycle. Just to demonstrate how easy that is, here&#8217;s the XML you need to add to CruiseControl&#8217;s <tt>config.xml</tt> file: </p> <pre> &lt;plugin name=&quot;x10publisher&quot; classname=&quot;com.pragauto.X10Publisher&quot;/&gt; &lt;publishers&gt; &lt;x10publisher port=&quot;COM1&quot; passDeviceCode=&quot;A2&quot; failDeviceCode=&quot;A1&quot; /&gt; &lt;/publishers&gt; </pre> <p> Edit the attributes of the <tt>&lt;x10publisher&gt;</tt> element as necessary for your serial port and device codes. A complete <tt>config.xml</tt> file is included in the project as a reference. </p> <h3>Bubbles While You Work</h3> <p> Once you&#8217;ve fired up CruiseControl and a build succeeds, you&#8217;ll see something like this on the console: </p> <pre> BUILD SUCCESSFUL Total time: 10 seconds [cc]Jul-08 16:56:53 Project - Project dms: merging accumulated log files [cc]Jul-08 16:56:53 Project - Project dms: publishing build results [cc]Jul-08 16:56:53 X10Publisher - Turning pass device (A2) on; fail device (A1) off ... [cc]Jul-08 16:56:56 Project - Project dms: idle [cc]Jul-08 16:56:56 Project - Project dms: next build in 1 minutes </pre> <p> At that point, the green lava lamp should turn on. Bask in that pleasant glow for a moment. When the lamp gets warmed up, you&#8217;ll get entertained by happy, green bubbles: </p> <p> <img src="http://www.pragmaticautomation.com/images/green_bubbles.jpg"> </p> <p> And then at some point somebody might check in code that causes the build to fail. (Hey, it happens to even the best programmers once in a while.) Here&#8217;s the early warning sign that the scheduled build is in trouble: </p> <p> <img src="http://www.pragmaticautomation.com/images/trouble.jpg"> </p> <p> Eek! Notice that the ambient light in the red lamp goes on immediately. It will take a while for the red lava to heat up and start to boil. In the meantime, there&#8217;s work to be done. When you check the CruiseControl log, you&#8217;ll see something like this: </p> <pre> BUILD FAILED file:C:/work/dms/builds/checkout/dms/build.xml:77: Tests failed! Check test reports. Total time: 5 seconds [cc]Jul-08 16:58:20 Project - Project dms: merging accumulated log files [cc]Jul-08 16:58:20 Project - Project dms: publishing build results [cc]Jul-08 16:58:20 X10Publisher - Turning pass device (A2) off; fail device (A1) on... [cc]Jul-08 16:58:23 Project - Project dms: idle [cc]Jul-08 16:58:23 Project - Project dms: next build in 1 minutes </pre> <p> If it takes too long to fix the build, the red lamp will start to get angry: </p> <p> <img src="http://www.pragmaticautomation.com/images/red_bubbles.jpg"> </p> <p> The object of the game is to keep the green lamp glowing. :-) </p> <h3>Hearing the Build Break</h3> <p> You may have noticed that when the transceiver module turns on and off it makes a fairly loud snapping sound. That sound is caused by the mechanical relay inside. (The lamp module doesn&#8217;t make that sound, I suspect because it&#8217;s a low-current device that doesn&#8217;t use a mechanical relay.) </p> <p> This audible feedback turns out to be quite handy if your team is working in close quarters. The &quot;snap&quot; could be yet another sound in your <a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/ListeningToComplexSystems.rdoc">project soundscape</a>. By plugging the red lamp into the transceiver module (A1), you&#8217;ll hear that snapping sound just before the red lamp turns on. So if you&#8217;re heads down (without headphones), the sound will alert you to a build failure. Indeed, you&#8217;ll hear the build break! </p> <h3>Important Safety Notes</h3> <p> These lamps get insanely hot. If you don&#8217;t let them cool down for at least five minutes before touching the glass, you&#8217;ll find out just <em>how</em> hot. (Yes, even the green one is hot.) </p> <p> The instructions for my lamps note that they perform best if operated for less than ten hours at a time. Your local fire marshal would certainly agree. But who will remember to turn off the lamps at the end of every programming day? Well, that&#8217;s a job for the ol&#8217; computer. Just write a shutdown program that uses the <a href="http://www.pragmaticautomation.com/code/pragautox10-1_0.zip">Pragmatic Automation X10 software</a> to turn off the lamps. For example: </p> <pre> new X10Device(&quot;COM1&quot;, &quot;A1&quot;).off(); new X10Device(&quot;COM1&quot;, &quot;A2&quot;).off(); </pre> <p> Then schedule an <tt>at</tt> or <tt>cron</tt> job on the scheduled build machine that runs the shutdown program at some hour of every evening, and another program that turns the lamps on every morning. </p> <h3>What About My Macintosh?</h3> <p> The Firecracker Computer Interface plugs into a serial port. Modern day Macintosh computers don&#8217;t have a serial port. Sadly, none of the USB-to-serial converters I tried worked with the Firecracker Computer Interface. (I&#8217;d love to hear otherwise.) </p> <p> You can purchase X10 kits that plug into USB, but I chose to use the Firecracker kit because it&#8217;s relatively cheap and it&#8217;s what is described in the book. Thankfully, by writing and testing most of this software against a mock device, I was able to do the majority of the development on my PowerBook. :-) </p> <h3>Conclusion</h3> <p> It&#8217;s relatively easy and inexpensive to make build monitoring a spectator sport. Put the lava lamps in a highly-visible area of your project and use them as visual (and audible) feedback devices, and to show off your programming prowess, of course. And that&#8217;s just the beginning. You can use any appliance to monitor anything that&#8217;s valuable to your team. </p> <p> Are you using feedback devices to spice up your project? If so, <a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/SuggestContent.rdoc">please share your story</a>. </p> <p> Enjoy! </p> Screeching Animatronic Monkeys http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/WowweeMonkey.rdoc Suppose you&#8217;ve just launched a new web application. Being a savvy automator, you decide to set up monitors for significant system events like, say, new users signing up. Now it&#8217;s always good to pick a physical device that gives visual or audible feedback that in some way matches the logical event you&#8217;re monitoring. So what kind of feedback goes along with a new user signing up? <p> <a href="http://pixelcloud.com/blog">Ian Bishrey</a> couldn&#8217;t exactly wire up a human, so he went with the next best thing: a screeching <a href="http://www.wowweealiveonline.com/">Wowwee Alive! Monkey</a>. </p> <p> <img src="http://pixelcloud.com/blog/fp-content/images/zowwee.jpg"> </p> <p> You know you want one of these on your project, and Ian has <a href="http://pixelcloud.com/blog/index.php?entry=entry070622-155523">instructions and code</a> for how he hacked the remote controller and wrote a Java-based serial interface (with tests) to send commands to the animatronic monkeys. </p> <p> In the email he sent, Ian concluded by stating matter of factly &quot;Using the remote means we can control an army of chimps simultaneously.&quot; I had to read that sentence a couple times, and each time the mental images got progressively more frightening. Added to which, Ian mentioned in passing that they also use the monkeys to give feedback on &quot;low NLP linguistic classification confidence score events&quot;. So to summarize, we have a web 2.0 application that&#8217;s taking on new users and in some way processing natural languages, all being monitored by a potential army of monkeys. </p> <p> You know, when I challenged readers of the <a href="http://www.pragmaticprogrammer.com/sk/auto">automation book</a> to find creative ways to monitor their software projects, I never imagined it could come to this&#8230; </p> In the Lap of Monitoring Luxury http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/CCScrape.rdoc So you&#8217;re dying to hook up X10-enabled devices to monitor your build status, but the tireless build machine is under lock and key. Or maybe it&#8217;s not physically located in your building. Or maybe you want to use <a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BubbleBubbleBuildsInTrouble.rdoc">lava lamps</a> in your office, but when your manager is at home he wants a successful build to fire up the ol&#8217; massage chair. Ah&#8230; Yes, there are too many devices to choose from and not enough serial ports. <p> Ralph Jocham has come to the rescue by releasing <a href="http://jcsc.sourceforge.net/tools/webstart/ccscrape/documentation.html">CCScrape</a>: a Java Web Start application that scrapes the <a href="http://cruisecontrol.sourceforge.net/">CruiseControl</a> results web page and turns on/off X10 devices hooked up to your local machine. It currently only runs on Windows machines with an available COM port, but if you have one of those it&#8217;s as easy as plugging in your devices and clicking <a href="http://jcsc.sourceforge.net/tools/webstart/ccscrape/ccscrape.jnlp">here</a>. </p> <p> Get a load of that: screen scraping, build monitoring, <em>and</em> an auto-updated application! Ralph, you deserve a gold star for automation! :-) </p> Visualizing Your Network Status http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/VisualizingNetworkStatus.rdoc jgaynor <a href="http://www.rci.rutgers.edu/~jgaynor/lights/">writes</a>: <dl> <dt></dt><dd><em>Inspired by an <a href="http://developers.slashdot.org/article.pl?sid=04/08/26/1550255">old Slashdot article</a> and my obsessive need for shorter network outage response times, I decided this year to create a &#8216;Christmas lights&#8217; frontend to our Network Management System. The results have been very encouraging. &#8230; </em> <p> <em>I recently moved from NOC operator to engineer and can no longer spend all my time staring at and refreshing network status webpages :(. As such I wanted something that could alert me to outages with little or no effort on my part. &#8230; </em> </p> <p> <em>In a nutshell, the Thinkpad checks a remote cron-generated file every five minutes for the existence of any alarms. Not wanting to reinvent the wheel for this, I use data from our pre-existing and very capable network monitoring system to populate that file. The Thinkpad then turns on the corresponding circuit of Christmas lights based on what it found in that file - white for all clear and red for trouble.</em> </p> </dd> </dl> <p> Instructions, pictures, movies, and even a live web cam are <a href="http://www.rci.rutgers.edu/~jgaynor/lights/">here</a>. </p> <p> His <a href="http://www.rci.rutgers.edu/~jgaynor/lights/script.txt">Bash script</a> is another good ol&#8217; fashioned screen scraper, powered by <a href="http://www.gnu.org/software/wget/wget.html">wget</a>. To toggle two X10 devices, he uses <a href="http://mlug.missouri.edu/~tymm/">BottleRocket</a>. Simple, elegant, and well worth every hand-typed character: </p> <pre> #!/bin/sh /usr/bin/wget \ http://censored-because-I-like-not-being-fired.edu/remotefile \ -O /home/localfile CHECK=`grep 1 /home/localfile` if [ -n &quot;$CHECK&quot; ] then br A2 on br A1 off else br A1 on br A2 off fi </pre> <p> Put the script on a schedule, plug in monitoring devices of your choosing, and then consider what you&#8217;re going to do with all the time you&#8217;ll save. </p> Christmas Glow http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/ChristmasGlow.rdoc Have you put up your Christmas lights? With each red and green strand, you can radiate the build status another 50 feet or so across your project. <a href="http://bloglines.com/blog/jwhitlock">Jeremy Whitlock</a> sent in these festive pictures of his project&#8217;s Christmas lights, controlled by the same X10 devices that power the <a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BubbleBubbleBuildsInTrouble.rdoc">lava lamps</a>. <p> <img src="http://www.pragmaticprogrammer.com/images/xmas_red.jpg"> <img src="http://www.pragmaticprogrammer.com/images/xmas_green.jpg"> </p> Automation Gear On Display http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/GearOnDisplay.rdoc Stop by and visit the good folks at <a href="http://store.yahoo.com/softpro/">Softpro Books</a> in Denver and you&#8217;ll get a first-hand look (and feel) at some of my project automation gear. You know you&#8217;ve arrived when you see the red and green lava lamps blazing through the storefront window. <p> <img src="http://www.pragmaticprogrammer.com/images/SoftproLava.jpg"> </p> <p> The X10 devices that conveniently power the lamps are also there on the table, ready to be poked and prodded. And, because you know you want to hook up lava lamps to your scheduled build, take a free copy of the printed <a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BubbleBubbleBuildsInTrouble.rdoc">instruction booklet</a> back to your manager&#8217;s office. </p> <p> While you&#8217;re in there, please support Softpro and your dear author by purchasing a copy of the <a href="http://pragmaticprogrammer.com/starter_kit/au/index.html">book</a> that gives you soup-to-nuts recipes for automating your software project. When you pay, don&#8217;t forget to ask for a voucher to purchase the PDF version of the book for just 99 cents. (The PDF offer applies to any <a href="http://pragmaticprogrammer.com/bookshelf/index.html">Pragmatic Bookshelf</a> title you buy at a participating independent bookstore.) </p> <p> Thanks, and have fun! </p> Lights, Camera, Action! http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/LightsCameraAction.rdoc <a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BubbleBubbleBuildsInTrouble.rdoc">Lava lamps</a> are visual feedback devices. But what if you can&#8217;t see your project&#8217;s lamps because they&#8217;re connected to a build machine that&#8217;s halfway around the world? <a href="http://objectsharp.com/Blogs/bruce">Bruce Johnson</a> relayed how one of his company&#8217;s clients share the warm glow of their lava lamps across a dislocated team: <dl> <dt></dt><dd><em>Because the development team is located both in Canada and in Europe, they not only set up the lava lamps here. They also hooked up a web cam pointing at the lamps so that the European developers could be kept informed of the build status. (<a href="http://objectsharp.com/Blogs/bruce/archive/2004/10/14.aspx">Picture</a>)</em> <p> <em>The funny thing is, whether coincidentally or not, the state of the build seems to have improved since the lava lamps were added to the picture. The green lamp is boiling at the time the picture was taken. That&#8217;s not as obvious in the picture because the lights behind appear to be reflecting through the lamp.</em> </p> <p> <em>For some reason, I&#8217;m now picturing completely virtual teams of developers using centrally located lava lamps and web cams. ;)</em> </p> </dd> </dl> <p> This might seem like just more eye candy on a project, but it&#8217;s actually an effective way to synchronize work across dislocated teams. Imagine you&#8217;re on the team in Europe. You show up for work in the morning about the time the Canadian team is watching hockey after a long day at the office. Before you start crafting more code, you want to see a green lamp bubbling in Canada. That means all the code in version control is compiling and passing its tests. It gives you confidence that you&#8217;re working on solid ground. </p> <p> And, of course, at the end of the day you want to leave the lamps just as they were at the beginning of the day&#8230; green. </p> Boiling .NET Code http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BoilingDotNetCode.rdoc <em>Curtis Olson particularly enjoyed the Monitoring chapter of the <a href="http://www.pragmaticprogrammer.com/sk/auto">book</a> and now has lava lamps glowing on his government agency project. He contributed this story:</em> <p> I simply had to implement the <a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BubbleBubbleBuildsInTrouble.rdoc">lava lamp monitors</a>. However, we write code in C# rather than Java, so I was left without a pre-written publisher for CruiseControl.NET that would control X10 devices. Dogged determination led me to develop my own publisher. It was surprisingly simple. </p> <p> First, <a href="http://www.15seconds.com/files/040414.zip">download</a> Robert Chartier&#8217;s <a href="http://www.15seconds.com/issue/040413.htm">X10 library for .NET</a> and use the pre-built <tt>Communications.dll</tt> and <tt>X10Unified.dll</tt> files. Then add my <a href="http://www.pragmaticprogrammer.com/starter_kit/au/lava/LavaLampPublisher.html">LavaLampPublisher.cs</a> file to the <tt>Thoughtworks.CruiseControl.Core</tt> assembly. Finally, add the following line to the <tt>&lt;publishers&gt;</tt> section of your <tt>ccnet.config</tt> file: </p> <pre> &lt;lavalamp passdevice=&quot;1&quot; faildevice=&quot;2&quot; housecode=&quot;A&quot; /&gt; </pre> <p> I even have the build machine running as a virtual machine under VMWare with the virtual COM port mapped to the physical COM port on the host server. </p> Your Router Is On Fire http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/YourRouterIsOnFire.rdoc The <a href="http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/BubbleBubbleBuildsInTrouble.rdoc">lava lamps article</a> struck a cord with a lot of people interested in monitoring builds, but visual monitoring goes way beyond software development. Indeed, visualization is one way to cast the abstract into concrete terms. James Turner sent in this story: <dl> <dt></dt><dd><em>Nigh on 10 years ago, I had built an SNMP-based monitoring system in Perl that graphically displayed the status of all the routers and end-point devices in the network. I already had it sending me pages, but I felt something more forceful was needed for in-building notification. One trip to You-Do-It electronics later, I had a massive red rotating beacon light and associated X10 controller equipment. No one ever ignored a dead router again&#8230;</em> </dd> </dl> Light Up Your System Tray http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/LightUpYourSystemTray.rdoc If you just can&#8217;t convince the boss to buy those lava lamps, or your team is dislocated and can&#8217;t share a visual monitoring device, then you need another inexpensive way to visually monitor your build. Paul Julius sent in these two screenshots of his system tray and a note about how it works: <dl> <dt></dt><dd><img src="http://www.pragmaticprogrammer.com/starter_kit/auto/linked_images/broken-build.jpg"> <img src="http://www.pragmaticprogrammer.com/starter_kit/auto/linked_images/good-build.jpg"> <p> <em>The tray icon is red when broken and green when successful. When the build breaks, a small popup dialog appears to let you know, followed by a similar popup when the build is &quot;fixed&quot;. A normal successful build doesn&#8217;t trigger any popups.</em> </p> <p> <em>As an aside, the systray icon works great as &quot;instant notification&quot; for teams that are not co-located. However, for co-located teams, they may find the x10 publisher to be a better route. It&#8217;s &quot;shared instant notification&quot;.</em> </p> </dd> </dl> <p> Those red and green icons in Paul&#8217;s tray are toggled by a nifty Python script donated to the <a href="http://cruisecontrol.sourceforge.net/">CruiseControl</a> project by Ivan Moore. Ivan had found the optional <a href="http://confluence.public.thoughtworks.org/display/CCNET/CCTray">CCTray</a> utility in CruiseControl.NET to be very handy, so he wrote a similar utility for CruiseControl. The script monitors your build by gently scraping your project&#8217;s CruiseControl web page on a configurable interval looking for the signs of a broken build. </p> <p> To light up your system tray, run: </p> <pre> python cruiseTrayIcon.py -u http://yourCruiseBuildPage.html </pre> <p> You can also mix in these command-line options: </p> <pre> -q (quiet = no dialog box on status change) -d pollingDelayInSeconds (how long it waits between polling cruise) -b buildFailedString (existence on cruise page means build broken) </pre> <p> The <tt>cruiseTrayIcon.py</tt> script is currently only available in the CruiseControl <a href="http://cruisecontrol.sourceforge.net/cvs.html">CVS repository</a>. The upcoming 2.2 release of CruiseControl will include Ivan&#8217;s script, along with the other significant enhancements. Until then, to check out the script and its supporting files, use: </p> <pre> $ set CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/cruisecontrol $ cvs login (Logging in to anonymous@cvs.sourceforge.net) CVS password: (Press Enter) $ cvs -z3 co cruisecontrol/contrib/cruiseTray </pre> <p> Make sure to read the short README file. It tells you which versions of Python and wxPython you need to install. It also tells you how to build a self-contained <tt>.exe</tt> file that you can share with team members who don&#8217;t want to install Python and wxPython. </p> <p> I like that this script uses good ol&#8217; fashioned screen scraping. It&#8217;s simple, but very effective. To build one of these monitors, all you need to know about CruiseControl is the URL of the build status page and what text to look for on that page. So if you can&#8217;t or just don&#8217;t want to use Python, you could whip one of these up in your language of choice lickety-split. If you do, please take a moment to let us know about your creation, then kindly donate it to the CruiseControl project. And unless somebody beats me to it, I might just have to write something that lights up the status bar or the dock for us Mac users. Virtual lava lamps, anyone? </p> <p> Now that you can monitor the status of your build just by glancing at your system tray, what other things might you be able to monitor on the cheap using a simple screen-scraper? </p> Oozing Confidence http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/Devices/OozingConfidence.rdoc Alberto Savoia <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=67492">writes</a>: <p> <em>A few months ago, on April 1(!) 2004 to be precise, I posted an article on <a href="http://www.developertesting.com/managed_developer_testing/000036.html">eXtreme Feedback</a>. The article was on a relatively serious subject: &quot;How do you get your team to pay attention to the software/project status and metrics that you care about?&quot;, but one of my solutions for getting the team to pay attention was to &quot;invent&quot; and implement eXtreme Feedback Devices (XFDs) that would be very visible, fun, and hard to ignore.</em> </p> <p> <em>One of these XFDs consists of a pair of lava lamps (one green and one red) remotely connected to our build and test system in such a way that a successful build (all tests pass) turns on the green lava lamp, and a failed build (or failed tests) turns on the red one.</em> </p> <p> <em>The original Java lava lamps have been glowing red and green for the past several months in our offices, and have achieved something of a cult status (e.g. they are included in Mike Clark&#8217;s excellent book <a href="http://www.pragmaticprogrammer.com/sk/auto">Pragmatic Project Automation</a>, and have recently received a fair amount of buzz on <a href="http://developers.slashdot.org/developers/04/08/26/1550255.shtml">Slashdot</a>).</em> </p> <p> <em>The interesting thing, for me, is that something that I started as something of a joke (it was April 1st after all) actually turned out to be a very useful tool in more ways than one. Sure, I could go to our CruiseControl page to see if they build is broken, or set-up email alerts, but keeping track of the lamps (which are centrally located in our development area) is easier, faster, and gives me an ongoing view into the current status and ebb-and-flow of our build and test cycles.</em> </p> <p> I got an opportunity to visit Alberto&#8217;s project a few weeks back and witness first-hand those infamous lava lamps. You really can&#8217;t miss them. When I walked in, the red lamp was bubbling. And yet the managers weren&#8217;t beating the programmers about the head and shoulders, as some might fear. Indeed, I didn&#8217;t sense any sort of panic or condescension. What I did sense was confidence. </p> <p> See, the team had learned to take the red lamp as feedback. They run an extensive battery of tests on every build and the red lamp was telling them that their tests were actually <em>testing</em> something. An assertion somewhere had failed the last time somebody checked in code. This is a good thing. Indeed, this is what continuous integration is all about. It becomes a bad thing when the green lamp never turns on. So they were diligently (and confidently) working to repair the build as a priority over other tasks for the day because they didn&#8217;t want to work on unstable ground. </p> <p> It&#8217;s important to note that Alberto&#8217;s team is a bright group of folks building impressive <a href="http://www.agitar.com/products/">products</a>. Feedback is serious business, but they&#8217;ve found a way to make it fun. They use the lava lamps to their advantage, not as gimmicks or another way for the pointy-haired manager to keep tabs on their work. And when the lamp does go red, they&#8217;re confident that it won&#8217;t stay that way for long. </p>