Hexnut – Software

Hello World

This post discusses the software used in the Hexnut robot.

The primary computation is performed by a Raspberry Pi.

I started with a freshly installed Debian Wheezy release that had been updated and upgraded.

collectd

The first thing I wanted was a way to collect (and eventually monitor) statistics about the system. For this I decided to use collectd

$ sudo apt-get install collectd

The syslog starting showing many errors related to rrdtool that looked like this:

rrdtool plugin ... failed ... illegal attempt to update using time ... when last update time is ... (minimum one second step)

So I edited the collectd configuration to disable all plugins. I will enable the plugins as they are needed.

graphite and carbon

I want to use graphite to display the statistics. I installed graphite-carbon using:

$ sudo apt-get install graphite-carbon

I tried installing graphite-web in the same way, but the package wasn’t found:

$ sudo apt-get install graphite-web
E: Unable to locate package graphite-web

I looked at the graphite-web documentation and it suggested using virtualenv and pip to install graphite-web.

To do that I first needed to install the python-virtualenv package for python 2.7.3

$ sudo apt-get install python-virtualenv

I then created a virtualenv for graphite and activated it:

$ sudo virtualenv /opt/graphite
$ sudo source /opt/graphite/bin/activate

I then was able to install graphite-web using

(graphite)$ sudo pip install https://github.com/graphite-project/ceres/tarball/master
(graphite)$ sudo pip install whisper
(graphite)$ sudo pip install carbon
(graphite)$ sudo pip install graphite-web

Hexnut – Cheatsheet

This is a cheatsheet of information and commands used with the Hexnut project.

Debian and bash

Reboot

$ sudo reboot

Update and Upgrade Debian packages

$ sudo apt-get update
$ sudo apt-get upgrade

List all processes

$ ps aux

View the syslog

$ tail /var/log/syslog

Apache2

Restart the server

$ sudo service apache2 restart

View the error log

$ tail /var/log/apache2/error.log -n 10

collectd

Check process status

$ ps aux | grep collectd

Get help for collectd

$ collectd -h    

View and edit the collectd configuration

$ sudo nano /etc/collectd/collectd.conf

Restart the collectd daemon

$ sudo /etc/init.d/collectd restart

carbon

View the carbon configuration

$ sudo nano /etc/carbon/carbon.conf

Get the status of the carbon daemon

$ carbon-cache --config=/etc/carbon/carbon.conf status

Start the carbon daemon

$ sudo carbon-cache --config=/etc/carbon/carbon.conf start

Postgres

Use postgres

$ sudo -u postgres psql

List help

postgres-# \h

List databases

postgres-# \l

RabbitMQ

View RabbitMQ Management

http://<i>raspberrypi_ip_address</i>:55672
username: guest
password: guest

whisper

View whisper commands

$ ls /usr/bin | grep whisper