Home Network Monitoring

Last updated
Mar 23, 2024 02:43 AM
summary
Shout out to Jeff Geerling!
date
Mar 6, 2024
type
Post
tags
open source
tech
networking
status
Published
slug
home-network-monitoring
I’ve been having some weird home network issues recently, and although I do this type of work on a daily basis in my 9-5, I never took the time to set anything up for home. Luckily, Jeff Geerling is an amazing human and has provided his work to the open source community in and it has saved me a lot of time up front.
 
Thank you Jeff!
 
To learn more about this awesome body of code, check him out at https://www.jeffgeerling.com/blog/2021/monitor-your-internet-raspberry-pi.
 
There was a fair amount of troubleshooting I had to do in order to make this functional in my situation on my old raspberry pi 3, model B. Mostly, elevate privileges with
ansible-playbook main.yml --become-method community.general.sudosu
after updating the Ansible yaml become attribute for each task to true. Because of the elevation of permissions, it throws the service location off so I statically set the location to make the Ansible steps work.
 
Here’s a snapshot of it up and running 🥳 …
notion image
 
With data flowing, and grafana hooked up I enabled dnsmasq since it was built-in and is much better than the ATT router all-in-one I’m stuck with, but the default docker networking mode is bridged, and I had to switch it over to host in order to DHCP packets flowing. Apparently, there’s some sort of Docker DHCP Relay thing but host mode work for my needs.
 
Got the static IP set since this is the DHCP server and static IP reservations aren’t possible.
sudo nmcli c mod "Wired connection 1" ipv4.addresses "192.168.x.x" ipv4.method manual
sudo nmcli con mod "Wired connection 1" ipv4.gateway 192.168.x.x
sudo nmcli con mod "Wired connection 1" ipv4.dns "4.2.2.1, 4.2.2.2, 8.8.8.8"
sudo nmcli c down "Wired connection 1" && sudo nmcli c up "Wired connection 1"
 
I ditched ^^^ in favor of static dhcp leases as it’s easier to manage. Along the way, I ran into this gem https://github.com/akpw/mktxp which saved me countless hours in retrieving the data from my Mikrotik devices.
 
I will be combining mktxp into this ansible playbook setup, but that’s for another day.
 
To help with monitoring my Ubiquiti hardware, I found https://unpoller.com/ which supposedly collects all of the data from Ubiquiti so I don’t have to use the controller dashboard.