How bsmithio/opnsense-dashboard works
Project Type and Purpose
• This is an open-source monitoring/dashboard project for OPNsense (a firewall) that integrates Suricata IDS data.
• It uses Telegraf to collect metrics, InfluxDB as a time-series store, Graylog for log aggregation, and Grafana for visualization.
• Deployment is managed via Docker Compose and Ansible; custom plugins and configuration files extend Telegraf and the dashboards.
Main Architectural Components
A. Data Sources
• OPNsense firewall (system metrics & interface stats)
• Suricata IDS (alert and event logs)
B. Metric Collector
• Telegraf agent
– Built from Docker Compose, including custom plugins (telegraf_pfifgw.php, telegraf_temperature.sh)
– Reads OPNsense API, SNMP, ACPI sensors, Suricata stats
C. Log Aggregator
• Graylog
– Ingests RFC5424 logs (firewall events, Suricata alerts)
D. Time-Series Database
• InfluxDB 2.x
– Stores metrics sent by Telegraf (Flux queries in dashboards)
E. Visualization Layer
• Grafana
– Hosts two JSON dashboards (OPNsense and Suricata)
– Queries InfluxDB and Graylog via data sources
F. Deployment & Configuration
• Docker Compose
– Defines Grafana, InfluxDB, Graylog, Telegraf containers
• Ansible
– inventory.yml, playbook.yml for provisioning hosts, installing Docker, deploying compose stack
• config/ directory
– OPNsense API pack, Suricata YAML, custom.conf
Data Flows and Relationships
• OPNsense → Telegraf → InfluxDB
• OPNsense & Suricata logs → Graylog
• Grafana → queries InfluxDB (metrics) & Graylog (logs) → renders dashboards
• Ansible & Docker Compose → deploy & configure all services
Architectural Patterns and Design Principles
• “Separation of Concerns”:
→ Collection vs. Storage vs. Visualization vs. Logging
• Micro-services-like: each service in its own container
• Extensibility points: custom Telegraf plugins, JSON dashboards, config folder