“Machine Utilization Example” - Dashboards with role based access permission

In this file, data is pushed into the InfluxDB and two dashboards with different viewing permissions has been configured.

Download: utilization-grafana.yml

Note

The example below uses an additional Docker image provided by Cybus that requires a suitable license. You can check the current capabilities and permissions of your Connectware license in the Cybus Portal (https://portal.cybus.io). If your license is not eligible to use the example Docker image, please contact Cybus Sales (sales@cybus.io).

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
description: >
  The generic Grafana Service

metadata:
  name: Generic Grafana Dashboard
  icon: https://www.cybus.io/wp-content/uploads/2017/10/for-whom3.svg
  provider: cybus
  homepage: https://www.cybus.io
  version: 1.2.1

definitions:
  SID: !ref Cybus::ServiceId
  CYBUS_MQTT_ROOT: 'services'

resources:

  #----------------------------------------------------------------------------
  # VOLUMES
  #----------------------------------------------------------------------------

  grafanaVolume:
    type: Cybus::Volume

  influxdbVolume:
    type: Cybus::Volume

  #----------------------------------------------------------------------------
  # FRONTENDS
  #----------------------------------------------------------------------------

  # Grafana
  grafanaURL:
    type: Cybus::IngressRoute
    properties:
      container: !ref genericGrafana
      type: http
      slug: grafana
      target:
        path: '/'
        port: 3000

  dashboard:
    type: Cybus::Link
    properties:
      name: Dashboard
      ingressRoute: !ref grafanaURL
      href: ''

  #----------------------------------------------------------------------------
  # Cybus Timeseris & Dashboard service containers
  #----------------------------------------------------------------------------

  influxdbPush:
      type: Cybus::Container
      properties:
        image: registry.cybus.io/cybus-services/influxdb-push:0.0.3
        environment:
          MQTT_HOST: !ref Cybus::MqttHost
          MQTT_USER: !ref Cybus::MqttUser
          MQTT_PORT: !ref Cybus::MqttPort
          MQTT_PASS: !ref Cybus::MqttPassword
          MQTT_ROOT_TOPIC: !sub "services/#"
          INFLUX_HOST: !ref influxdb
          INFLUX_PORT: 8086
          INFLUX_DB: generic
          HTTP_ROOT: /

  influxdb:
    type: Cybus::Container
    properties:
      image: registry.cybus.io/cybus-services/influxdb:1.7.7-alpine
      ports:
        - 8086:8086/tcp
      volumes:
        - !sub "${influxdbVolume}:/var/lib/influxdb"
      environment:
        INFLUXDB_DB: generic

  genericGrafana:
    type: Cybus::Container
    properties:
      image: registry.cybus.io/cybus-services/generic-grafana:1.2.1
      volumes:
        - !sub "${grafanaVolume}:/var/lib/grafana"
      environment:
        GF_SERVER_ROOT_URL: !sub "/services/${SID}/grafana"
        GF_AUTH_ANONYMOUS_ENABLED: true
        INFLUX_DB: generic
        INFLUX_HOST: !ref influxdb
        INFLUX_PORT: 8086