######################################################################################################### # MikroTik Bad Blocks Detection # ######################################################################################################### # Author: Rick Frey # # email: support@rickfreyconsulting.com # # Username in MikroTik Forum is rickfrey # ######################################################################################################### # ######################################################################################################### # Features # # # -Runs script every 6 hours to look for bad blocks. Positive and negative conditions are logged. # # -Sends an email when bad blocks are detected. You must specify the address to send to. # ######################################################################################################### ############################################################################################################################ #### The email tool needs to be already configured to use this script (tool e-mail). ## ############################################################################################################################ /system scheduler add interval=6h name="Schedule Bad Block Detection" on-event=\ "/sys script run Bad_Block_Detection" policy=\ ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=may/15/2018 \ start-time=00:00:00 /system script add name=Bad_Block_Detection owner=admin policy=\ ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":global sysname [\ /system identity get name]\r\ \n:if ([/system resource get value-name=bad-blocks ] =0) do={/log info message=\"No Bad Bo\ cks Found\"} else={[/log error message=\"Bad Blocks Found\"\r\ \n /tool e-mail send to=yourdomain@gmail.com subject=\"Bad Blocks Detected\" body=\"Bad \ Blocks were detected on \$sysname\"]}"