Collect various PFSense firewall statistics and send to mqtt queue
Steps:
- Collect sample on pfsense firewall
- Send from pfsense firewall to mqtt queue on Raspberry Pi
- Send sample from Raspberry Pi to Influxdb
- Visualize in Grafana dashboard
Statistics gathered:
- Packet loss (%)
- Round trip + standard deviation (ms)
- Internet capacity (MB/s) - using Speedtest
- enable ssh in web gui
- create new user for collecting stats, e.g. statsuser
- Generate ssh key for statsuser and upload in web gui
ssh firewall1 -l statsuser sudo pkg add http://pkg.freebsd.org/freebsd:11:x86:64/latest/All/c-ares-1.12.0_2.txz sudo pkg add http://pkg.freebsd.org/freebsd:11:x86:64/latest/All/mosquitto-1.4.14.txz rehash
scp scripts/collect-gateway-stats.sh statsuser@firewall1: ssh firewall1 -l statsuser sh collect-gateway-stats.sh &
(or add to startup script so it runs automatically after reboot)
scp scripts/collect-speedtest-stats.sh statsuser@firewall1: ssh firewall1 -l statsuser sh collect-speedtest-stats.sh &
Using a raspberry pi
scp *.py rpi1: scp scripts/*.sh rpi1: scp config-gateway.properties rpi1: ssh rpi1 sudo pip3 install influxdb ./start-gateway-eventlog.sh & ./start-gateway-influxdb-writer.sh & ./start-speedtest-eventlog.sh & ./start-speedtest-influxdb-writer.sh &