This datasource was created to connect Grafana with DeviceHive to track commands and notifications by particular device.
Based on Grafana Simple JSON Datasource plugin.
Prerequisites: You should have Grafana and npm installed and have permissions to copy data to Plugins folder(you could set it in grafana.ini
in Paths->plugins
).
- Clone this repo to Plugins folder -
git clone https://github.com/devicehive/devicehive-grafana-datasource.git
; - Go into folder -
cd devicehive-grafana-datasource
; - Install all packages -
npm install
; - Build plugin -
npm run build
; - Restart Grafana -
sudo service grafana-server restart
; - Open Grafana in any browser;
- Open the side menu by clicking the Grafana icon in the top header;
- In the side menu click
Data Sources
; - Click the
+ Add data source
in the top header; - Select
DeviceHive
from theType
dropdown; - Configure datasource.
- Open Grafana in any browser;
- Open the side menu by clicking the Grafana icon in the top header;
- In the side menu find
Dashboards
and in context menu click+ New
; - Select Panel type from top header. Currently this plugin wirks fine with
Graph
andSinglestat
types. - Click on
Panel Title
and chooseEdit
; - In
Metrics
tab choose your data source name fromPanel Data Source
; - Choose metric type from dropdown (
command
ornotification
); - Type path to variable inside command in input. (Remember you could use object and arrays inside it, f.e.
parameters.testData[0].temperature
); - Click time range burron in the top header on the right.
- Type
now-2m
inFrom
text field, choose refreshing option from dropdown and clickApply
. (Remember cache is available for last 2 minutes only)