A few weeks ago, I listened to the Changelog Podcast episode featuring Chris Forsythe, lead of the Growl project. I actually don’tWdidn’t use Growl for a long time, because I really disliked notifications of any kind, as they are distracting. However, I do appreciate the project, and supporting them by purchasing Growl on the App Store seemed totally reasonable.
Of course, buying the app means it was installed on the spot. I always resisted it in the past because it was bundled with so many apps, but I don’t want unsolicited software to show up on my computer. Now, it seemed a bit more natural, and I made a few configuration tweaks (I should put those into Chef…). I’m actually happy to use it now, especially since it has a nice network accessible API.
Shortly after I started using Growl on my work system, I looked into
ways I could get notifications fired off from the command-line after
long running processes finished. In particular, I wanted to get a
knife ec2 server create was done. I found the
growlnotify program, which is available via
homebrew. This is quite a nifty
tool, and I set it to use immediately, doing things like this:
1 2 3 4 5
I could kick off the server creation, switch focus to another workspace, and then know via growl if the instance was created.
As many know, I manage my workstations with Chef. Chef has a pretty cool exception and report handler API that has a lot of flexibility. I thought it would be fun to throw together a simple report handler that would send a growl notification after a Chef run. In this case, it will report the elapsed time of the run if it was successful, or report an exception if it failed.
Using the handler is pretty straightforward. Install the
chef-handler-growl Gem, then configure chef-client (or solo).
1 2 3
Then run Chef, and see something like this: