Closed ElanHasson closed 5 months ago
nice, your changes worked well. I made a new docker-compose off that still gives some errors but gives enough data for me to be happy.
As a note to anyone reading this assumes having ElanHasson's fork cloned.
version: '3.8'
services:
sense:
container_name: sense
depends_on:
- influxdb
build:
context: ./sense-collector
environment:
TZ: America/New_York
SENSE_COLLECTOR_HOST_HOSTNAME: generated from generate_docker script
SENSE_COLLECTOR_INFLUXDB_PASSWORD: copied from going to influx ui at localhost:8086
SENSE_COLLECTOR_INFLUXDB_URL: http://influxdb:8086/write?db=PUT_YOUR_INIT_BUCKET_HERE
SENSE_COLLECTOR_INFLUXDB_USERNAME: username from influx ui
SENSE_COLLECTOR_PERF_INTERVAL: 60
SENSE_COLLECTOR_DISABLE_HEALTH_CHECK: true
SENSE_COLLECTOR_TOKEN: generated from generate_docker script
SENSE_COLLECTOR_MONITOR_ID: generated from generate_docker script
restart: always
influxdb:
image: influxdb:latest
container_name: influxdb
restart: unless-stopped
ports:
- 8086:8086
volumes:
- ./config:/etc/influxdb2
- ./db:/var/lib/influxdb2
@CodaBool What errors are you seeing?
I'm considering rewriting in go as bash scripts aren't my strength.
Hats off to @lux4rd0 for being able to manage large scripts.
Not at home right now but I believe it was 404 codes (edit: conn refused)
docker logs for sense-collector prints the following line multiple times:
curl: (7) Failed to connect to influxdb port 8086: Connection refused
But again it pulls a lot of data into influx. So, it's not clear if this is even breaking something.
resolved the issue by delaying the startup of sense container. It was trying to connect to the database without it being available yet. You can do this with a healthcheck and depends on docker specs. Here is an example compose file
version: '3.8'
services:
sense:
container_name: sense
depends_on:
- influxdb
build:
context: ./sense-collector
depends_on:
- influxdb
environment:
TZ: America/New_York
SENSE_COLLECTOR_HOST_HOSTNAME: # created from `generate_docker-compose.sh`
SENSE_COLLECTOR_INFLUXDB_PASSWORD: # influx api token (from localhost:8086 ui)
SENSE_COLLECTOR_INFLUXDB_URL: http://influxdb:8086/write?db=PUT_YOUR_INIT_BUCKET_HERE
SENSE_COLLECTOR_INFLUXDB_USERNAME: # influx username (from localhost:8086 ui)
SENSE_COLLECTOR_PERF_INTERVAL: 60
SENSE_COLLECTOR_DISABLE_HEALTH_CHECK: true
SENSE_COLLECTOR_TOKEN: # created from `generate_docker-compose.sh`
SENSE_COLLECTOR_MONITOR_ID: # created from `generate_docker-compose.sh`
restart: unless-stopped
influxdb:
image: influxdb:latest
container_name: influxdb
healthcheck:
test: ["CMD", "curl", "localhost:8086"]
restart: unless-stopped
ports:
- 8086:8086
volumes:
- ./config:/etc/influxdb2
- ./db:/var/lib/influxdb2
ahh, i'm running in kubernetes, so my influx is always on.
@ElanHasson how did you get the grafana graphs working. I have influxdb2 container deployed and deployed new container from your repo. I can see data flowing into influxdb (sense bucket) but i am having hardtime to get grafana graphs working.
Do you know what is the configuration needs to be done on Grafana side?
Thank you!
@everydaylearner I had to modify the scripts to use the new API format. See my fork. https://github.com/ElanHasson/sense-collector
I deployed the container you created but i am not getting any data into grafana some reason, though i can see data is flowing into influxdb2.
Did you need to modify the dashboards? or did you use the original dashboards?
Hey guys, I appreciate your help keeping things alive here! A new version was just released that should be easier to use and run with InfluxDB.
Hi, the live dashboard seems to have different values than the repository used in the dashboard.
I've forked and updated the code to use influx 2.0 api, and got it working.
Any chance you could push the new code and dashboards up to this repo? Thanks!