email alert on DHCP lease for specific MAC address

Is there a way I can setup an alert so that when a certin MAC address requests a lease, I can get an alert email ?

There’s no built in hooks, so you’ve got three choices that come to mind (might be more):

  1. use RADIUS for DHCP, and configure some sort of alerting on the RADIUS server (log parsers, for example)
  2. send DHCP events to syslog and use your possibly pre-exsting NMS to filter syslog messages and alert on the message corresponding to that host receiving a lease
  3. write a script that is scheduled to run every x minutes (where x should be less than the lease time) and sends an email when it finds the lease in the lease table. I’m leaving out the email sending portion as you can find that from any number of scripts on the wiki.
:local MAC "aa:bb:cc:dd:ee:ff";
:if ([:len [/ip dhcp-server lease find mac-address="$MAC"]] > 0) do={
  # send email
  :puts "lease found!"
}

Thats exactly what I am looking for (option 3). THanks.