1. Command line
  2. Global configuration file
    1. Root level
    2. Flags
    3. Session
    4. Plot
  3. Meter configuration
  4. Node configuration file
  5. Examples

Currently, no user-friendly graphical user interface is provided for configuration. The application can be configured in two ways: 1) command line parameters, and 2) global configuration file. There is an additional configuration file for caching the state of the nodes.

Command line

By default, the application starts in interactive mode and with the HTTP server enabled. To close the application, simply press Enter or ctrl-c. The command line parameters are documented in the following table:

Option Description
--info Enable info mode. No measurements will be performed. Information about the current configuration and detected meters will be listed and a configuration file will be generated.
--save After toggling all the command line options, update the configuration file. Enables storing a persistent configuration defined in the command line.
--debug / --nodebug Toggle debug mode, see configuration.
--verbose / --noverbose Toggle verbose mode, see configuration.
--mqtt / --nomqtt Toggle the MQTT client, see configuration.
--telnet / --notelnet Toggle the TCP telnet server, see configuration.
--http / --nohttp Toggle the HTTP server, see configuration.
--drivers / --nodriers Toggle the native drivers, see configuration.
--simu / --nosime Toggle the simulated meters, see configuration.
--cors / --nocors Toggle the 'Access-Control-Allow-Origin' header, see configuration.
--hotplug / --nohotplug Toggle the periodic scan for new devices, see configuration.
--lowmemory / --nolowmemory Toggle the low-memory mode, see configuration.
--headless Enable the headless mode (modeInteractive=false), no keyboard input will be monitored.
port=N Redefine the httpPort, see configuration.
simu=N Redefine the simulatedCount, see configuration.
logs=N Redefine the logPath, see configuration.
content=N Redefine the httpContentPath, see configuration.
period=N Redefine the statusPeriod, see configuration.

Global configuration file

On Linux, the global configuration has a well-defined XDG location, namely ~/.config/powergoblin/default.json. This file is basically a serialized version of the GlobalConfiguration structure defined in the source code file. The options are documented in the following tables:

Root level

Option Default Description
flags Nested flags configuration, see flags
session Nested session configuration, see session
plot Nested plot configuration, see plot
name "PowerGoblin instance" Name of the PowerGoblin instance
statusPeriod 1000 (ms) Timer period for status messages & device scan
logPath "logs/" Path to log files (relative to the application root)
httpContentPath "web/" Path to HTTP content (relative to the application root)
httpPort 8080 Port for HTTP access
telnetPort 9000 Port for telnet access
mqttHost "localhost" MQTT server host name
mqttPort 1883 Port for MQTT access
mqttTopicPrefix auto-generated Prefix for MQTT topics
simulatedCount 3 How many simulated meters to generate (with --simu). Simulated meters are only useful for demonstration purposes. The data is completely random. Note that simulated meters can also be added via the UI or API.

Flags

Option Default Description
modeDebug False Enable debug mode. By default only the most critical problems are displayed in the console. The debug mode produces more detailed output. It's still readable at real-time.
modeVerbose False Enable verbose debug mode. In this mode excessive amounts of debug data is generated to the console. It's a good idea to store this to a log file and analyse later.
modeInfo False Show only information about the meters, then quit. This is useful for quickly checking the state of the meters.
modeLowMemory False Enable the low-memory mode. Some memory intensive operations are disabled. The idea is that enough session data is collected so that the rest of the derived data can be built on a "larger" machine. If your sessions are not super long, this should not be needed.
modeInteractive Auto Interactive mode (exit with 'Enter'). Auto detected by default depending on the start up context. This option will not be read from the configuration file. In the headless mode (=false), no keyboard input will be monitored, and a kill signal needs to be sent to close the application.
allowOriginHeader False Configures 'Access-Control-Allow-Origin: *' header in web API requests, which makes it possible to submit resource data from Selenium JS sessions.
mqttClient False Enable MQTT client. MQTT is only used for broadcasting some high level events. Assumes that a MQTT server is available in the local network.
httpServer True Enable HTTP server. Without this option it's not possible to access the UI or control the instance.
telnetServer False Enable Telnet server. Telnet server is only needed for the telnet API. This server receives commands with lower overhead compared to the HTTP server.
logMeterEvents True Enable observers to log the events. This affects all meters in all sessions. When disabled, the readings will not produce session events. This is probably not something you want to disable.
deviceHotplug True Periodically scan for new devices. If this is disabled, meters cannot be added to the instance after the initialization. This might be good for debugging if your application crashes with this option enabled. Otherwise keep it enabled.
sessionLogs True Enable reading/writing of session logs. When disabled, no logs will be written to the disk, but live data can be seen in the UI. This is probably not something you want to disable if doing measurements.
nativeDrivers True Enable native drivers. When disabled, the physical meter devices will not be initialized. This might be good for debugging if your application crashes with this option enabled. RAPL/NVML still works. This is probably not something you want to disable.
implicitSession False Implicitly start a session with all the available meters. The first version of PowerGoblin did not have concurrent session support and the concept of session was implicit. This option is only useful for those old scripts. The new scripts require this to be disabled. If you enable this, e.g. the collectd http stream may trigger a concurrent session and redirect all the resource events to a wrong session.

Session

Option Default Description
name "default" Session name
author "user" Author name
description "Generic measuring session" Session description
resourceFilters Memory and CPU load related List of collectd resource columns to include
autoSave True Automatically save the session when closing. Otherwise and explicit store command is required.
summarizeRun0 False Implicit run 0 is included in the summaries in case there are also explicit runs, Usually not a good idea as initializing measurements requires some time and run 0 is reserved for this.
writeDumps True Write the various data dumps in the log directory
writeReport True Write a report file when saving the session
writeSpreadsheet True Write a spreadsheet file when saving the session
writePlotScripts False Write plot scripts when saving the session
writePlots False Write plots when saving the session

Plot

Option Description
dockerImage Docker image to use when generating plots
enableDocker Use docker / native tools
renderingTimeOut Generation timeout (rendering)

Meter configuration

When launching the application, for each detected SmartPower 3 meter, a configuration file such as powergoblin-SP3-3a08929c0deaea11a5a061e7994a5d01.json will be created on the launch directory. SP3 here refers to the type of meter and 3a08929c0deaea11a5a061e7994a5d01 to its serial number (either extracted from the meter's ROM or a virtual serial number generated from the device parameters).

The default configuration for the SP3 class of devices looks like this:

{
  "pollPeriod" : 10,
  "sampleRate" : 100,
  "portConfiguration" : {
    "baudRate" : "B115200",
    "dataBits" : "DataBits8",
    "stopBits" : "StopBits1",
    "parity" : "None",
    "flowControl" : "None"
  },
  "ignore" : false
}

The default configuration for the SP1 class of devices looks like this:

{
  "ignore" : false
}

The ignore field can be used to hide the meter. This is useful if some other instance of PowerGoblin is already using the meter.

The whole configuration will be rejected if any of the parameters is considered invalid. The data model of these configuration files may change so the files may need to be regenerated at some point.


Node configuration file

On Linux, the node configuration has a well-defined XDG location, namely ~/.config/powergoblin/nodes.json. This file is basically a serialized version of the node summary structures defined in the source code. Sometimes this file may need to be removed due to the propagation of erroneous data.


Examples