Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live dashboard doesn't match code #9

Closed
ElanHasson opened this issue Jun 23, 2023 · 10 comments
Closed

Live dashboard doesn't match code #9

ElanHasson opened this issue Jun 23, 2023 · 10 comments

Comments

@ElanHasson
Copy link

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!

image

@CodaBool
Copy link

CodaBool commented Jun 24, 2023

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

@ElanHasson
Copy link
Author

ElanHasson commented Jun 24, 2023

@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.

@CodaBool
Copy link

CodaBool commented Jun 24, 2023

Not at home right now but I believe it was 404 codes (edit: conn refused)

@CodaBool
Copy link

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.

@CodaBool
Copy link

CodaBool commented Jun 24, 2023

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

@ElanHasson
Copy link
Author

ahh, i'm running in kubernetes, so my influx is always on.

@everydaylearner
Copy link

@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!

@ElanHasson
Copy link
Author

@everydaylearner I had to modify the scripts to use the new API format. See my fork. https://github.com/ElanHasson/sense-collector

@everydaylearner
Copy link

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?

@lux4rd0
Copy link
Owner

lux4rd0 commented Jun 21, 2024

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.

@lux4rd0 lux4rd0 closed this as completed Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants