danifr / internet-pi

Raspberry Pi config for all things Internet.
MIT License
3 stars 0 forks source link

What are the complete steps to setup your Raspberry Pi Monitoring dashboard? #3

Closed Vardoger closed 2 years ago

Vardoger commented 2 years ago

Hi,

I've been trying to follow along the steps, parsing https://github.com/geerlingguy/internet-pi/issues/226#issuecomment-921916570 and https://github.com/danifr/internet-pi/issues/1

But I cannot get Grafana to show your raspberry pi monitoring dashboard.

Note: my 'Internet connection' and 'Power consumption' dashboards work fine / I do not have an Air Gradient, so no dash needed for that.

Can you include the full start to end steps, to replicate adding your Raspberry Pi Monitoring dashboard, please?

danifr commented 2 years ago

Hi sorry for the huge delay, for some reason Github never notified me and I missed your comment.

These are the steps:

git clone https://github.com/danifr/internet-pi.git
cd internet-pi
git checkout rpi_monitoring

Create a config.yml with the following content (edit it to match your desired config):

# General configuration
config_dir: '/opt/internet-pi/'

domain_name_enable: true
domain_name: 'home.local' # whatever you want basically
domain_grafana: 'grafana' # to access grafana via http://grafana.home.local
domain_prometheus: 'prometheus'
domain_pihole: 'pihole'  # to access pihole via http://pihole.home.local

# Pi-hole configuration.
pihole_enable: true
pihole_hostname: pihole
pihole_timezone: Europe/Madrid
pihole_password: "admin"

# Raspberry monitoring configuration
raspberry_monitoring_enable: true
telegraf_retention_policy: '90d'
telegraf_password: 'admin'

# Internet monitoring configuration.
monitoring_enable: true
monitoring_grafana_admin_password: "admin"
monitoring_speedtest_interval: 60m
monitoring_ping_hosts:  # [URL];[HUMAN_READABLE_NAME]
  - https://netflix.com/;netflix.com
  - https://github.com/;github.com
  - https://www.apple.com/;apple.com

# Shelly Plug configuration. (Also requires `monitoring_enable`)
shelly_plug_enable: false
shelly_plug_hostname: my-shelly-plug-host-or-ip
shelly_plug_http_username: username
shelly_plug_http_password: "password"

# Starlink configuration. (Also requires `monitoring_enable`)
starlink_enable: false

After that just run the ansible playbook command: ansible-playbook main.yml

That should be it :)

SoongJr commented 2 years ago

I had to make some adjustments because my config_dir is in home (like in the original example-config). See comments here: https://github.com/danifr/internet-pi/commit/5fe5fe16c4bfd7b0bc99d1a0b0657f5fb6cb3aba

The dashboard showed up without problem, but it just gave me "Bad Gateway" errors. The InfluxDB datasource seems not to be reachable... Haven't been able to fix that yet. Do I need the custom domain names changs? I only cherry-picked the three commits related to raspberry-monitoring... I'll try picking the rest as well tomorrow.

SoongJr commented 2 years ago

OK, I did pick the domain_name commit as well, but also had to docker-compose down -v all the internet-monitoring and the raspberrypi-monitoring before it finally worked. Not sure if it really was the domain_name commit that did it in the end or if I had some other trouble, but I think there was a definition of the back_tier network in that commit that was might have been the crucial bit. Anyway, working now, thanks for your repository, definitely gets a Star ⭐

danifr commented 2 years ago

@SoongJr Thanks! :)

still waiting for @geerlingguy to merge https://github.com/geerlingguy/internet-pi/pull/179. I am wondering if he will ever do it...

My fork was never intended to be used by other people (other than me), but regarding the current situation, what I can do is to keep improving my fork (adding better docs for example) so more and more people find it easy to use.

This is not the way opensource should work but it has been over 6 months since I opened the PR so I guess Jeff is simply not interested in having this change merged.

SoongJr commented 2 years ago

@danifr yeah I was considering whether it would be worth opening a PR with some of my own changes... He's churning out so much content, I think it's just not feasible to maintain all of that even mid-term. In the code for reading values from the shelly-plug he writes himself that it's not the best solution, just a case of using the tools he knows to achieve this small task. The fact it reads only exactly one plug value also tells me it's just a way to point others in the right direction, not production-level code 😉

He does have to think about where to spend his time, is it best spent perfecting one project, or putting out the next decent project he can do a video about and actually earn some money ;) I don't begrudge it. His repo did teach me a lot about ansible, prometheus, grafna, and shelly, so for me it did its job. Maybe one day he'll find a volunteer to do maintenance on his projects, but I'm certainly not it 😜 And to be fair it's not like he's totally abandoning it, there were plenty of improvements since the video came out.

Anyway, I'm on sick leave right now, so it might take a couple days, but if you're willing to look at a PR for the directory creation then I'm gonna write one ;)

geerlingguy commented 2 years ago

Maybe one day he'll find a volunteer to do maintenance on his projects, but I'm certainly not it 😜 And to be fair it's not like he's totally abandoning it, there were plenty of improvements since the video came out.

Typically for projects like this—where I am actually using the project—I will update things in batches from time to time, but typically my philosophy on my GitHub projects is:

  1. I build it for myself
  2. I add an extremely permissive license and encourage forks
  3. I monitor the repo and usually merge easy bug/docs fixes quickly
  4. I mark PRs and issues that I'm interested in with 'planned'
  5. Every few months (sometimes longer... heh), I'll merge some of the 'planned' things or at least leave a follow-up review

But as you mention, having 200+ OSS projects with thousands of active users, plus trying to make a living writing and doing YouTube means I don't have a lot of time for any individual project.

I've tried sharing responsibility, adding maintainers, etc. from time to time, but there's a separate risk profile attached to that—and more often than not, someone pops in, solves their own issues, then abandons maintenance, meaning now I have a project I'm still maintaining effectively on my own, but now it has a bunch of someone else's code in it, and that makes it harder for me to pop back in and work on it again :(

Anyways, I've written about it on my blog from time to time, most recently The burden of an Open Source maintainer.

Anyways, I do plan on updating this repo and merging PRs like the domain-per-service one... but when is a good question. For most people interested in using the project long-term, I recommend forking the project, and then if I update things down the line, you can decide whether to pull my changes into your fork as well.

SoongJr commented 2 years ago

Thanks for that detailed insight @geerlingguy, that's exactly what I assumed your stance on PRs might be (sorry to hear about your burnouts though). I did fork it immediately, simply because I want to backup my config and inventory to github 😉

Maybe linking that blog post directly in your readme(s) would set the right expectations for some of the less empathetic people? Maybe a few lines encouraging people who are looking for functionality to check out the PRs, even the closed ones, as there may be some nuggets there (I just noticed that there was already a PR for multiple shelly plugs, I might not have needed to implement my own 😅). You could even introduce a "GoodIdea-WontMerge" tag for PRs that looked great but you decided not to even mark as "planned" (which implies you're planning to merge it), to highlight PRs people should take a look at. This way contributions of others will be in your repo (as PRs) but not your duty to maintain. Just an idea, I don't want to cause you more work, we want to see regular videos from you after all 😜 And once we know what the "planned" tag means we can look out for it, so that's probably already enough.

Anyway, hope you stay healthy!