https://github.com/jeeftor/otm
OPNSense traffic monitor
https://github.com/jeeftor/otm
Last synced: 21 days ago
JSON representation
OPNSense traffic monitor
- Host: GitHub
- URL: https://github.com/jeeftor/otm
- Owner: jeeftor
- Created: 2026-06-01T10:35:49.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2026-06-01T13:42:51.000Z (about 2 months ago)
- Last Synced: 2026-06-01T15:17:24.630Z (about 2 months ago)
- Language: Go
- Size: 47.9 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OTM
OTM is an early self-hosted OPNsense Traffic Monitor. The first implementation focuses on setup validation:
- confirm the OPNsense API key works,
- check whether NetFlow status/config endpoints are readable,
- check whether OPNsense appears to be exporting NetFlow to this collector,
- listen for NetFlow v9 UDP packets and show packet status.
The long-term goal is per-device hourly/daily internet usage by combining NetFlow with DHCP, ARP, and NDP identity data.
## Quick Start
```bash
cp .env.example .env
make build
./bin/otm
```
Open:
```text
http://127.0.0.1:8080/setup
```
## Important Settings
```text
OTM_WEB_ADDR=127.0.0.1:8080
OTM_NETFLOW_ADDR=0.0.0.0:2055
OTM_NETFLOW_ALLOWED_EXPORTERS=192.168.1.1
OTM_COLLECTOR_ADVERTISE_ADDR=192.168.1.20:2055
OTM_OPNSENSE_URL=https://192.168.1.1
OTM_OPNSENSE_API_KEY_FILE=./secrets/opnsense-key
OTM_OPNSENSE_API_SECRET_FILE=./secrets/opnsense-secret
```
Set `OTM_COLLECTOR_ADVERTISE_ADDR` to the IP and UDP port that OPNsense should export NetFlow to.
## API Endpoints
```text
GET /healthz
GET /readyz
GET /setup
GET /api/status
GET /api/netflow/status
GET /api/opnsense/validate
```
If `OTM_WEB_AUTH_TOKEN` is set, pass it as:
```text
Authorization: Bearer
```
## Development
```bash
make test
make lint
make build
make build-freebsd
```