Community discussions

MikroTik App
 
carnevale
just joined
Topic Author
Posts: 13
Joined: Wed Nov 16, 2016 8:59 pm

DHCP new lease

Wed Nov 23, 2016 2:56 am

Hi,

What would be the script code for send email every new lease offered by DHCP ?

I want to receive one email with the IP address and MAC Address of every single lease.

thanks
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: DHCP new lease

Wed Nov 23, 2016 7:48 am

Wasn't it already here in the past? Search and use dhcp script for that.
 
User avatar
BlackVS
Member Candidate
Member Candidate
Posts: 174
Joined: Mon Feb 04, 2013 7:00 pm
Contact:

Re: DHCP new lease

Wed Nov 23, 2016 10:45 am

Hi,

What would be the script code for send email every new lease offered by DHCP ?

I want to receive one email with the IP address and MAC Address of every single lease.

thanks
http://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server
lease-script (string; Default: )
Script that will be executed after lease is assigned or de-assigned. Internal "global" variables that can be used in the script:
leaseBound - set to "1" if bound, otherwise set to "0"
leaseServerName - dhcp server name
leaseActMAC - active mac address
leaseActIP - active IP address
Just put where script which sends email with leaseActMAC and leaseActIP by email
Something like this
If ($leaseBound=1) do={
 /tool e-mail send to=me@somethere.com  subject="DHCPLIST" body="$leaseActIP - $leaseActMAC"
}
Sure you must setup Tools->Setup first for sending emails.
 
aarango
Member Candidate
Member Candidate
Posts: 158
Joined: Wed Nov 30, 2016 7:55 am

Re: DHCP new lease

Wed Nov 30, 2016 1:56 pm

Hi,

I used that script but it only send an email when I execute. How could I keep constantly listening new ask? I would to like to receive an email when DHCP give a IP (email with MAC & IP gave)
And if its possible, steps to do it, I'm newbie on this.
Thanks.

Who is online

Users browsing this forum: No registered users and 20 guests