HardwareSometimes when you have stuff lying around you just have to come up with some way to use it. Sometimes it works out fine and some times not so much. I have a 700MHz 512GB Raspberry Pi computer sitting on the shelf with nothing to do. Its that nifty Linux ARM based computer: with built in Ethernet, USB, video and an hardware extension bus. That hosts our monitoring scripts.
Raspberry Pi setupRaspberry Pi setup i pretty straightforward. Follow the instructions in the quick start guide http://www.raspberrypi.org/quick-start-guide to install and boot the operating system. I had some additional config to do:
- Use raspi-config to set the timezone
- Use raspi-config to set the locale and keyboard type
- Install the chromium browser so that we don't have to download Azure publishing configuration onto a different machine. The default browser can't download the settings.
- sudo apt-get install chromium-browser
Azure Command Line Interface (CLI) setup
The library is written on Node.js
- Install Node JS. I found this article useful. Later pre-compiled ARM versions of Node.js are available on the nodejs.or web site. I used v0.10.13. Install it into /usr/local
- Install the Azure Node.js based command line tools using the npm command as documented on windowsazure web site.
- Download the Azure publishing settings per the windowsazure.com instructions. I found I had to use a browser for this because of the way credentials are handled. The default Raspberry Pi browser is not powerful enough. Use something like chromium or use a different machine and transfer over the network or via thumb drive.
- Load those Azure publishing settings into the Azure Node.js configuration so that it can use those credentials to talk with the Azure cloud.
- At this point you can run Azure commandline commands from a terminal windows. Every command starts with Azure. Run something like Azure VM list to get a list of all virtual machines under that Azure subscription.
Performance Problems with Azure CLI on Raspberry Pi
The main problem is that it takes about 9.5 seconds to run even the Azure Help command. This is a pretty simple command with no obvious network or Azure dependencies. Here are some more timing numbers.
azure help 9.7 secondsazure vm list 21 secondsazure vm show <machineName> 21 seconds.
Azure CLI Limitations
The Node.js based tools can control and check status VM status. They cannot retrieve any metrics or watch the load or behavior in the Azure network. This is a showstopper four our monitoring project.
Adding an LCD panel to the Raspberry Pi
The Adafruit folks have a great tutorial on how to buy, build and write software for their 2x20 LCD display. It describes all of the things you have to do to enable and configure the I2C based shield on a stock Raspberry Pi.
This project failed for two reasons:
- The CLI API does not provide the information needed for monitoring.
- The Azure Node.js library has too much overhead to perform on a Raspberry Pi.