Skip to content

Commit

Permalink
Merge branch 'bonitoo-io-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mhall119 committed Mar 31, 2021
2 parents 7009fb1 + 3cae097 commit adb5c7c
Show file tree
Hide file tree
Showing 9 changed files with 868 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Start by reading [how to use a template](docs/use_a_template.md), then check eac
| [InfluxDB 2 OSS Metrics](influxdb2_oss_metrics/) | Monitor your InfluxDB 2 OSS instance using scrapers. | [@russorat](https://github.com/russorat) |
| [InfluxDB 2 Operational Monitoring](influxdb2_operational_monitoring/) | Monitor you tasks and cardinality on your already running InfluxDB 2 instance. | [@Anaisdg](https://github.com/Anaisdg) |
| [Island Pulse (Modbus)](modbus/) | Monitor Island Pulse energy gauge over Modbus | Ray Farias |
| [IoT Center example app](iot_center/) | Simple dashboard showing measured values from IoT devices. | [@bonitoo.io](https://github.com/bonitoo-io) |
| [Jboss Wildfly](jboss_wildfly/) | View information your Jboss Wildfly Instance using Jolokia. Uptime, Heap Memory, Non Heap Memory, Memory Pool, etc | [Ignacio Van Droogenbroeck](https://github.com/xe-nvdk) |
| [JMeter](apache_jmeter/) | This template provides Apache JMeter dashboard | [bonitoo.io](.) |
| [Kafka](kafka/) | Monitor Kafka via Jolokia agent | [@samhld](https:/github.com/samhld)
Expand All @@ -54,6 +55,7 @@ Start by reading [how to use a template](docs/use_a_template.md), then check eac
| [MySQL / MariaDB](mysql_mariadb/) | View information of MySQL Instance. Uptime, Current Queries, Active Threads, Connections, Traffic and more. | [Ignacio Van Droogenbroeck](https://github.com/xe-nvdk) |
| [Network Interface Monitor](network_interface_performance/) | Monitor network interfaces on one or more hosts. | [@russorat](https://github.com/russorat) |
| [Nextcloud](nextcloud/) | Show stats about your Nextcloud Instance. | [Ignacio Van Droogenbroeck](https://github.com/xe-nvdk) |
| [Node.js](node_js/) | Monitor Node.js application. CPU, Memory, HTTP response time and more | [@bonitoo.io](https://github.com/bonitoo-io) |
| [Postgres Monitor](postgresql/) | Monitor Postgres Server. CPU, Deadlocks, Data and more | [Ignacio Van Droogenbroeck](https://github.com/xe-nvdk) |
| [Raspberry Pi System Monitor](raspberry-pi/) | System overview monitoring for your Raspberry Pi with Raspbian. | [@bonitoo.io](https://github.com/bonitoo-io) |
| [Redis Monitor](redis/) | Monitor your Redis server. | [@russorat](https://github.com/russorat) |
Expand Down
263 changes: 263 additions & 0 deletions iot_center/iot_center.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
apiVersion: influxdata.com/v2alpha1
kind: Label
metadata:
name: tender-booth-bd5001
spec:
color: '#be2ee4'
name: IoT
---
apiVersion: influxdata.com/v2alpha1
kind: Bucket
metadata:
name: inspiring-tesla-bd5001
spec:
name: iot_center
retentionRules:
- everySeconds: 2.592e+06
type: expire
---
apiVersion: influxdata.com/v2alpha1
kind: Variable
metadata:
name: suspicious-mahavira-fd5001
spec:
language: flux
name: IoT_Device
query: "import \"influxdata/influxdb/v1\"\r\nv1.tagValues(bucket: \"iot_center\",
tag: \"clientId\")"
type: query
---
apiVersion: influxdata.com/v2alpha1
kind: Dashboard
metadata:
name: elated-wescoff-7d5001
spec:
charts:
- colors:
- hex: '#00C9FF'
id: "0"
name: laser
type: min
value: -30
- hex: '#BF3D5E'
id: "1"
name: ruby
type: max
value: 60
decimalPlaces: 2
height: 5
kind: Gauge
name: Actual Temperature
queries:
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart,
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"]
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"Temperature\")\n
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every:
v.windowPeriod, fn: last, createEmpty: false)\n |> yield(name: \"last\")"
suffix: ' °C'
width: 5
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
label: Temperature °C
name: y
scale: linear
colors:
- hex: '#31C0F6'
id: 024cd205-6cf6-4aa2-b6da-d8d052bb1f9b
name: Nineteen Eighty Four
type: scale
- hex: '#A500A5'
id: c5472a5f-6349-40a2-9374-d7eaca9864e8
name: Nineteen Eighty Four
type: scale
- hex: '#FF7E27'
id: 355ddac5-4625-49f7-aa78-00202e3e51c4
name: Nineteen Eighty Four
type: scale
geom: line
height: 4
kind: Xy
name: Temperature
position: overlaid
queries:
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart,
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"]
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"Temperature\")\n
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every:
v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"
shade: true
width: 12
xCol: _time
yCol: _value
yPos: 5
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
label: Humidity %
name: y
scale: linear
colors:
- hex: '#31C0F6'
id: 024cd205-6cf6-4aa2-b6da-d8d052bb1f9b
name: Nineteen Eighty Four
type: scale
- hex: '#A500A5'
id: c5472a5f-6349-40a2-9374-d7eaca9864e8
name: Nineteen Eighty Four
type: scale
- hex: '#FF7E27'
id: 355ddac5-4625-49f7-aa78-00202e3e51c4
name: Nineteen Eighty Four
type: scale
geom: line
height: 4
kind: Xy
name: Humidity
position: overlaid
queries:
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart,
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"]
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"Humidity\")\n
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every:
v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"
width: 12
xCol: _time
yCol: _value
yPos: 9
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
label: Pressure hPa
name: y
scale: linear
colors:
- hex: '#31C0F6'
id: 024cd205-6cf6-4aa2-b6da-d8d052bb1f9b
name: Nineteen Eighty Four
type: scale
- hex: '#A500A5'
id: c5472a5f-6349-40a2-9374-d7eaca9864e8
name: Nineteen Eighty Four
type: scale
- hex: '#FF7E27'
id: 355ddac5-4625-49f7-aa78-00202e3e51c4
name: Nineteen Eighty Four
type: scale
geom: line
height: 4
kind: Xy
name: Pressure
position: overlaid
queries:
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart,
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"]
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"Pressure\")\n
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every:
v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"
width: 12
xCol: _time
yCol: _value
yPos: 13
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
label: CO2 ppm
name: y
scale: linear
colors:
- hex: '#31C0F6'
id: 024cd205-6cf6-4aa2-b6da-d8d052bb1f9b
name: Nineteen Eighty Four
type: scale
- hex: '#A500A5'
id: c5472a5f-6349-40a2-9374-d7eaca9864e8
name: Nineteen Eighty Four
type: scale
- hex: '#FF7E27'
id: 355ddac5-4625-49f7-aa78-00202e3e51c4
name: Nineteen Eighty Four
type: scale
geom: line
height: 4
kind: Xy
name: CO2
position: overlaid
queries:
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart,
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"]
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"CO2\")\n
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every:
v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"
width: 12
xCol: _time
yCol: _value
yPos: 17
- axes:
- base: "10"
name: x
scale: linear
- base: "10"
label: TVOC ppb
name: y
scale: linear
colors:
- hex: '#31C0F6'
id: 024cd205-6cf6-4aa2-b6da-d8d052bb1f9b
name: Nineteen Eighty Four
type: scale
- hex: '#A500A5'
id: c5472a5f-6349-40a2-9374-d7eaca9864e8
name: Nineteen Eighty Four
type: scale
- hex: '#FF7E27'
id: 355ddac5-4625-49f7-aa78-00202e3e51c4
name: Nineteen Eighty Four
type: scale
geom: line
height: 4
kind: Xy
name: TVOC
position: overlaid
queries:
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart,
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"]
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"TVOC\")\n
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every:
v.windowPeriod, fn: mean, createEmpty: false)\n |> yield(name: \"mean\")"
width: 12
xCol: _time
yCol: _value
yPos: 21
- colors:
- hex: '#00C9FF'
id: "0"
name: laser
type: min
- hex: '#BF3D5E'
id: "1"
name: ruby
type: max
value: 100
decimalPlaces: 2
height: 5
kind: Gauge
name: Actual Humidity
queries:
- query: "from(bucket: \"iot_center\")\n |> range(start: v.timeRangeStart,
stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"]
== \"environment\")\n |> filter(fn: (r) => r[\"_field\"] == \"Humidity\")\n
\ |> filter(fn: (r) => r[\"clientId\"] == v.IoT_Device) \n |> aggregateWindow(every:
v.windowPeriod, fn: last, createEmpty: false)\n |> yield(name: \"last\")"
suffix: ' %'
width: 5
xPos: 5
name: IoT Center
Binary file added iot_center/iot_center_dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions iot_center/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# IoT Center Template

Provided by: [bonitoo.io](.)

This template provides a dashboard for [IoT Center](https://github.com/bonitoo-io/iot-center-v2) dev demo application.

### Dashboard example

![Screenshot](iot_center_dashboard.png)

### Quick Install

#### InfluxDB UI

In the InfluxDB UI, go to Settings->Templates and enter this URL: https://github.com/influxdata/community-templates/tree/master/iot_center/iot_center.yml

#### Influx CLI
If you have your InfluxDB credentials [configured in the CLI](https://v2.docs.influxdata.com/v2.0/reference/cli/influx/config/), you can install this template with:

```
influx apply https://github.com/influxdata/community-templates/tree/master/iot_center/iot_center.yml
```

## Included Resources

This template includes the following:

- 1 Bucket: `iot_center`
- 1 Label: `IoT`
- 1 Dashboards: `IoT Center Application Monitoring`
- 1 Variable: `IoT_Device`

## Setup Instructions

1. Load the dashboard according to the the paragraph above
1. Run IoT Center application according to the [installation steps](https://github.com/bonitoo-io/iot-center-v2)
1. Generate demo data using Virtual device

## Contact

Author: Miroslav Malecha, https://www.bonitoo.io
35 changes: 35 additions & 0 deletions node_js/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/** InfluxDB URL */
const INFLUX_URL = process.env.INFLUX_URL || 'http://localhost:8086'
/** InfluxDB authorization token */
const INFLUX_TOKEN = process.env.INFLUX_TOKEN || 'my-token'
/** Organization within InfluxDB */
const INFLUX_ORG = process.env.INFLUX_ORG || 'my-org'
/** InfluxDB bucket */
const INFLUX_BUCKET = 'iot_center'

// Defaults when on boarding a fresh new InfluxDB instance
/** InfluxDB user */
const onboarding_username = 'my-user'
/** InfluxDB password */
const onboarding_password = 'my-password'

/** recommended interval for client's to refresh configuration in seconds */
const configuration_refresh = 3600

function logEnvironment() {
console.log(`INFLUX_URL=${INFLUX_URL}`)
console.log(`INFLUX_TOKEN=${INFLUX_TOKEN ? '***' : ''}`)
console.log(`INFLUX_ORG=${INFLUX_ORG}`)
console.log(`INFLUX_BUCKET=${INFLUX_BUCKET}`)
}

module.exports = {
INFLUX_URL,
INFLUX_TOKEN,
INFLUX_ORG,
onboarding_username,
onboarding_password,
configuration_refresh,
INFLUX_BUCKET,
logEnvironment,
}
Loading

0 comments on commit adb5c7c

Please sign in to comment.