I recently setup pfsense embedded on an old Watchguard x750e for my home lab. It works great! Lots of community support for this.
For fun, I configured the front LED to change status depending on the results of a ping test. I can glance at the box and verify basic Internet connectivity… specifically, can I ping Google’s public DNS system? Yes is green, no is red.
I’m using WGXepc to set the fan speed down to something reasonable, and it can also control the front LEDs.
NOTE: On pfSense embedded make sure you set the filesystem to read-write first (/etc/rc.conf_mount_rw) and back to read-only when done (/etc/rc.conf_mount_ro).
I wrote “test-host-set-led.sh” to test ping to 126.96.36.199 for about 50 seconds, 1 ping / 5 seconds.
for i in 1 2 3 4 5 6 7 8 9 10
ping -c 1 188.8.131.52 2>/dev/null 1>/dev/null
if [ "$?" = 0 ]
echo Ping test succeeded, setting GREEN
/usr/local/bin/WGXepc -l green
echo Ping test succeeded, setting RED flashing
/usr/local/bin/WGXepc -l red_flash
For testing, I set the IP to a non-responsive IP:
ping -c 1 184.108.40.206 2>/dev/null 1>/dev/null
Placed the test-host-set-led.sh file in /usr/sbin/ and set it to executable:
chmod 755 /usr/sbin/test-host-set-led.sh
And created a cron job to run this script every minute, using the CRON package.
That’s it! Done.