Grafana + InfluxDB

From HELIOS Digital DAQ
Jump to: navigation, search

Introduction

In order to monitor the HELIOS system, for example, the threshold, the tigger rate, the buffer size, etc. We monitor and save those data into a database managed by InfluxDB. The database is further read by Grafana for display.

For more information on InfluxDB and Grafana, see:

InfluxDB documentation

Grafana

Present setting

The data (e.g. trigger Rate, threshold, Buffer ) must be taking in digios1, the DAQ.

Since the DAQ is running on a 32-bit system. the influxDB is unstable.

The database was installed in heliosDB.onenet or heliosDB.

Thus, the data will be push to heliosDB.

To run the monitor program, login to the DAQ (digios1.onenet)

digios1$ Helios_Database Start

To stop the monitor program,

digios1$ Helios_Database Stop

Grafana was also installed in heliosDB.

To run Grafana, from any browser, within onenet, type

http://heliosDB.onenet:3000

if no webpage found, probably the Grafana server is not started. To start the Grafana server

sudo service grafana-server start

Setup InfluxDB

For 64bit-linux, the setup is straight forward.

For example, in Ubuntu-18.x, simply type

sudo apt-get install influxdb

The influxdb contains 2 main programs,

  1. influx, for interactive database operations
  2. influxd, a daemon run in background, for receiving query from port 8086

To run the influxd

sudo service influxdb start

Setup Grafana

sudo apt-get update
sudo apt-get install grafana

Or see Grafana webpage, straight forward.

SSH Tunneling to heliosDB from outside

Since the Grafana is installed in heliosDB inside onenet. There is no simple way to check the Grafana from outside.

One solution is using sonata.phy.anl.gov via ssh tunneling.

ssh -nNT -L 9000:heliosdb.onenet:3000 <username>@sonata

The above ssh command is using sonata, port-forwarding heliosdb.onenet:3000 to localhost:9000.

After typing this in terminal, use any browser, type http://heliosDB.onenet:3000

To push the Grafana screenshot to ANL web page

we store a screenshot in http://www.phy.anl.gov/atlas/helios/grafanaElog.jpg

A bash script in heliosDB is coded to take the screenshot and push it to the webpage.

In order to run for every 60 sec, we use the "watch" command

heliosDB:~>watch -n 60 ./GrafanaWeb.sh

To use dramatic sound alarm for Grafana

heliosDB:~>./NewSoundAlarm.sh