Monitor your host's ingress data packets leveraging the power of eBPF and XDP. Visualise it in Grafana through Prometheus.
- Observe the locations of the Servers you are querying your packets from through the World Map
- Get the number of bytes you are receving on your Network Interface Card
- Get the number and types of Layer 4 protocols your host is dealing wtih
- Set an alert on the % of the CPU used by NetWorth
git clone https://github.com/ShubhamPalriwala/networth.git
cd networth/
docker compose up
Do you want to build it yourself without docker? Click me!
Requirements
- Python3
- pip
- Grafana
- Prometheus
- Clone and get into the repository
git clone https://github.com/ShubhamPalriwala/NetWorth
cd Networth/
- Install the required Python dependencies:
pip install -r requirements.txt
- Install dev tools and Linux Kernel Headers through your package manager (example apt):
sudo pacman -S bcc-tools linux-headers
- Start the Grafana service:
sudo systemctl start grafana.service
- Start the prometheus server:
prometheus --config.file=prometheus.yml
- Finally start the eBPF program:
sudo python3 caller.py
- Now head over to Grafana and import the Dashboard by uploading the
grafana.json
file.
Congrats! You should now be able to see your NetWorth!
- Python client sending data at http://localhost:8000/metrics
- Prometheus Scraping logs at http://localhost:9090
- Grafana Dashboard at http://localhost:3000/d/PyIm36vVk/networth?orgId=1/
- Docker Image for NetWorth App available at: https://hub.docker.com/repository/docker/laalshaitaan/networth
If you plan to use this for more than just fun, I would recommend you get an API key from https://ipinfo.io/ for unobstructed monitoring and add it to the sample.env
and then rename it to .env
Copyright 2022 Shubham Palriwala
Licensed under MIT License
Made to learn and explore 🐝 eBPF