Get DHCP-Client Gateway and search in ARP table

Hello, I am new in scripting. I wanna write a simple script of getting DHCP-Client’s Gateway address, then search it in the ARP table and if has status “failed” then beep. Thanks in advance.