26.29. ShellLogger

26.29.1. Overview

The ShellLogger Sensor is a command line tool that parses ShellLogger output and sends unix/linux shell command invocation information to the Hackystat server. The ShellLogger sensor represents the metric data using the CLI and DevEvent sensor data types, documented in Section 25.5, “CLI” and Section 25.10, “DevEvent”.

ShellLogger is a tool that captures all user interactions with a shell. It is intended to be used for software engineering researchers who are interested in inferring programmer behavior from data that can be captured automatically during a programming session. Currently, it only works with bash and tcsh according to its documentation.

26.29.2. Installation

26.29.2.1. Prerequisites

The ShellLogger sensor requires Java 1.5.0 or later and is tested with ShellLogger 0.1.7.

26.29.2.2. Download HackyInstaller and set your Hackystat Host and User Key

Follow the instructions in Chapter 2, Client-side configuration: Tool sensor installation to set your Hackystat host and user key.

26.29.2.3. Configure and install the ShellLogger sensor

In the HackyInstaller main window, select the ShellLogger sensor and press "Configure Selected Sensor". Figure 26.55, “ ShellLogger sensor installer configuration window ” shows what the configuration window should look like. The only thing that can be configured is to enable or disable the sensor.

Figure 26.55.  ShellLogger sensor installer configuration window


ShellLogger sensor installer configuration window

This sensor supports the following properties and paths:

  • Enable ShellLogger Sensor: This property controls whether the sensor is active or not. If not checked, the sensor will not collect or send data even if it is installed.

26.29.2.4. Configure ShellLogger to log shell commands

Please refer to ShellLogger documentation for its configuration. Once ShellLogger is properly configured and started, it begins logging until you exit the shell. Upon exit, the command line invocation information is recorded in an xml file at either your specified or default location.

26.29.2.5. Create a command to send CLI data to Hackystat

The ShellLogger sensor parses the xml file written by ShellLogger and sends CLI and DevEvent data to Hackystat. The simplest way to perform this task is by running the sensor directly from the command line. Assuming that the sensorshell.jar, and sensor.shelllogger.jar files are all in the current directory, you can invoke the ShellLogger sensor as follows.

Under Unix/Linux environments, use the following command:

java -cp sensorshell.jar:sensor.shelllogger.jar org.hackystat.sensor.shelllogger.ShellLoggerSensor [ShellLogger xml file path]

26.29.3. Installation verification

26.29.3.1. Verify sensor output

To verify your ShellLogger sensor installation, invoke the sensor as illustrated above and check the output. Example 26.69, “Example ShellLogger output” shows output from a successful invocation of the sensor.

Example 26.69. Example ShellLogger output

ShellLogger data on 1 file sent to Hackystat successfully.

26.29.3.2. List Sensor Data

After verifying that ShellLogger data is being sent from the client, login to your account on your Hackystat server, and use the "List Sensor Data" command on the Extras page to verify that CLI and DevEvent data for today's date was received by the server for the "ShellLogger" tool.

26.29.4. Installation troubleshooting

26.29.4.1. Troubleshooting general client-server problems

The first step in troubleshooting your sensor installation is to verify that your Hackystat host and key settings are valid and that you can contact the Hackystat server, as described in Section 2.4, “HackyInstaller GUI: Setting and verifying the Hackystat host and user key”

26.29.4.2. Checking client-side logging

The ShellLogger sensor writes out files called ShellLogger.x.log to the .hackystat/logs directory that can be useful in debugging your installation.

26.29.4.3. Submit a trouble report

If none of the above troubleshooting activities solves your problem, then you should send an email to your Hackystat Administrator to request help. Please include in your email the following information:

  • The output from 'java -version'.

  • The output from 'java -jar sensorshell.jar -verify'.

  • The contents of your sensor.properties file.

  • The contents of the ShellLogger.x.log files.

  • A description of the problem you are having.

26.29.5. Usage tips

26.29.5.1. Automated sensor data collection using

Although manual invocation of the ShellLogger sensor is appropriate for initial installation and testing, it is time-consuming on a daily basis. A better approach is to automate the sensor invocation at shell exit time. One possible solution is to invoke the sensor in .bash_logout if you are using bash.