informatica:linux:grafana
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| informatica:linux:grafana [2019/03/13 12:17] – created jose | informatica:linux:grafana [2023/09/13 15:01] (current) – jose | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| restart: always | restart: always | ||
| environment: | environment: | ||
| - | - INFLUXDB_DB=avantticFlux | + | - INFLUXDB_DB=grafanaFlux |
| - INFLUXDB_ADMIN_ENABLED=true | - INFLUXDB_ADMIN_ENABLED=true | ||
| - INFLUXDB_ADMIN_USER=admin | - INFLUXDB_ADMIN_USER=admin | ||
| - | - INFLUXDB_ADMIN_PASSWORD=4v4nt1c | + | - INFLUXDB_ADMIN_PASSWORD=gr4f4n4 |
| - | - INFLUXDB_USER=nagflux | + | - INFLUXDB_USER=grafanaflux |
| - | - INFLUXDB_USER_PASSWORD=4v4nt1c | + | - INFLUXDB_USER_PASSWORD=gr4f4n4 |
| ports: | ports: | ||
| - 8086:8086 | - 8086:8086 | ||
| Line 42: | Line 42: | ||
| restart: always | restart: always | ||
| </ | </ | ||
| + | |||
| + | Desde el directorio que tenemos el fichero docker-compose.yml lanzamos el comando: | ||
| + | docker-compose up -d | ||
| + | Esto nos levanta un docker con la BBDD de influxdb y otro con grafana: | ||
| + | < | ||
| + | IMAGE | ||
| + | grafana/ | ||
| + | influxdb | ||
| + | </ | ||
| + | |||
| + | Creamos una base de datos: | ||
| + | curl -i -XPOST http:// | ||
| + | Insertamos un dato: | ||
| + | curl -i -XPOST ' | ||
| + | Consultamos el dato | ||
| + | curl -G ' | ||
| + | | ||
| + | Metemos datos:\\ | ||
| + | curl -i -XPOST ' | ||
| + | El fichero data.txt tiene este formato, el último número es el timestamp con 9 ceros mas. | ||
| + | data.txt | ||
| + | < | ||
| + | consumo, | ||
| + | consumo, | ||
| + | consumo, | ||
| + | consumo, | ||
| + | </ | ||
| + | |||
| + | Vamos a Grafana: | ||
| + | |||
| + | http:// | ||
| + | |||
| + | admin/ | ||
| + | Pulsamos add data source\\ | ||
| + | {{: | ||
| + | |||
| + | SeleccionamosInfluxDB: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | |||
| + | ===== Crear Dashboard Gráfica ===== | ||
| + | Vamos al icono de + y create Dashboard y Add query | ||
| + | |||
| + | ===== Dashboard público ===== | ||
| + | / | ||
| + | |||
| + | < | ||
| + | #################################### | ||
| + | [auth.anonymous] | ||
| + | # enable anonymous access | ||
| + | enabled = true | ||
| + | |||
| + | # specify organization name that should be used for unauthenticated users | ||
| + | org_name = Main Org. | ||
| + | |||
| + | # specify role for unauthenticated users | ||
| + | org_role = Viewer | ||
| + | | ||
| + | # mask the Grafana version number for unauthenticated users | ||
| + | ; | ||
| + | </ | ||
| + | |||
informatica/linux/grafana.1552479454.txt.gz · Last modified: by jose
