i was surprised there is no audible alarm on a pool degrade (ie disk failure). I come from the enterprise / hw raid world and audible alarms are everywhere bc they are the most reliable (vs email or sms alerts) - for the most important alerts (of which, for FN there is no more important alert). I searched pretty hard on google and forums, and could not find anything like this. Depending upon your noise level, it may be hard to hear the buzzer , so do test this (just change DEGRADED to ONLINE in the script). i have 4x sm servers on a rack and was able to hear the buzzer nicely (fans on them ~3k rpm). even when i set 2 of the server to run their fans at 6k rpm , i could still hear it (however at full, 8k rpm fans on 2x servers, i could NOT hear it).
After thinking about it, i think the reason ixSys does not include an audible alarm in freenas is they cant guarantee it will work as users have different MB / hardware (so some wo any buzzer on mb), so they dont want to create a scenario where users expect to hear an alarm (when ixSys is hard pressed to guarantee that an alarm/buzzer will universally work due to users' differentiating hardware). ie on their TrueNAS paid line, there is a blue/red light on the chassis bezel that preforms this function (however they should still have an audible alarm imo). Im not against email alerts, but it should be audable alarm + email alerts. email can be un-reliable, requires LAN+internet (often), and expecting users to look at a 3am email report *every single day* is unseasonably burden sum (depending upon how you freenas is used).
another , even remote/offisite / different room- buzzer solution, would be to use a cheap mikrotik router($20-$50), with a on pcb buzzer (most have them), and then have the FN server send a snmpget request to the mikrotik's IP , which will trigger a script to run on the MT (which will sound the mikrotik's buzzer at various hz / levels). if anyone is interested in this, reply and i can give u all info to do it. you could even have the mt do a short different hz beep if it cant reach the FN box/boxes.
so i made this rough script to every 5min scan zpool status for the word DEGRADED, and if so then keep beeping the motherboard buzzer. I have only tested this on supermicro MB buzzers (tested on X8 , X9 , X10 sm MBs- works and is loud enough over fans) - i am using the standard freebsd method for beeping the bios/mb buzzer : printf "\007" > /dev/ttyv6 , so it should work on other MB types w on-board (or dongle) buzzers. Please lmk if im missing some other terms to grep for, or if there is a better way to do this.
I schedule cron (via gui, for persistence) to run this script every 5min, if it should fire, the alarm sounds for 3min, then 5min later will run again for 3min (until u disable cront task, or pool is not degraded).
1- scp the script to your FN box, or copy paste via vi/ee - (either put on a pool, or i put it on /root/ if you have recent version of FN with /root/ persistance)
2- chmod +x scriptname.sh
3- add gui cront entry for every X minutes. ( i do every 5min , so it keeps repeating till if fix HDD)
(if you want to test if buzzer works on your MB, just copy paste this into ssh/cli:
printf "\007" > /dev/ttyv6
(should hear a short beep)
a cool side effect of logger is that the web gui will keep scrolling the DEGRADED message every 3 -5 minutes when degraded. nice to grab attention (in case you miss the red alert in top right, the more alerts the better on a degrade imo)
pls lmk any feedback, thanks!
After thinking about it, i think the reason ixSys does not include an audible alarm in freenas is they cant guarantee it will work as users have different MB / hardware (so some wo any buzzer on mb), so they dont want to create a scenario where users expect to hear an alarm (when ixSys is hard pressed to guarantee that an alarm/buzzer will universally work due to users' differentiating hardware). ie on their TrueNAS paid line, there is a blue/red light on the chassis bezel that preforms this function (however they should still have an audible alarm imo). Im not against email alerts, but it should be audable alarm + email alerts. email can be un-reliable, requires LAN+internet (often), and expecting users to look at a 3am email report *every single day* is unseasonably burden sum (depending upon how you freenas is used).
another , even remote/offisite / different room- buzzer solution, would be to use a cheap mikrotik router($20-$50), with a on pcb buzzer (most have them), and then have the FN server send a snmpget request to the mikrotik's IP , which will trigger a script to run on the MT (which will sound the mikrotik's buzzer at various hz / levels). if anyone is interested in this, reply and i can give u all info to do it. you could even have the mt do a short different hz beep if it cant reach the FN box/boxes.
so i made this rough script to every 5min scan zpool status for the word DEGRADED, and if so then keep beeping the motherboard buzzer. I have only tested this on supermicro MB buzzers (tested on X8 , X9 , X10 sm MBs- works and is loud enough over fans) - i am using the standard freebsd method for beeping the bios/mb buzzer : printf "\007" > /dev/ttyv6 , so it should work on other MB types w on-board (or dongle) buzzers. Please lmk if im missing some other terms to grep for, or if there is a better way to do this.
I schedule cron (via gui, for persistence) to run this script every 5min, if it should fire, the alarm sounds for 3min, then 5min later will run again for 3min (until u disable cront task, or pool is not degraded).
1- scp the script to your FN box, or copy paste via vi/ee - (either put on a pool, or i put it on /root/ if you have recent version of FN with /root/ persistance)
2- chmod +x scriptname.sh
3- add gui cront entry for every X minutes. ( i do every 5min , so it keeps repeating till if fix HDD)
(if you want to test if buzzer works on your MB, just copy paste this into ssh/cli:
printf "\007" > /dev/ttyv6
(should hear a short beep)
Code:
#!/usr/local/bin/bash if zpool status -v | grep -q DEGRADED; then echo Degraded Found logger buzzerAlarm a pool is DEGRADED SOUND MB BUZZER # run alarm 1800 times every .1 sec = sounds beeper for 180s / 3min exactly for i in {1..1800} do sleep 0.1 printf "\007" > /dev/ttyv6 done # send to local and remote log logger buzzerAlarm script JUST FINISHED fireing for 3min bc pool DEGRADED else echo phrase not found # only occasionally (1 in 12 chance) send a log msg showing this script is running/working if (( RANDOM % 12 )); then logger buzzerAlarm script is running every 5min log msgs are random time fi fi
a cool side effect of logger is that the web gui will keep scrolling the DEGRADED message every 3 -5 minutes when degraded. nice to grab attention (in case you miss the red alert in top right, the more alerts the better on a degrade imo)
pls lmk any feedback, thanks!
Last edited: