IP > DHCP Server > [+] > zakładka [Script]

Lease Script:

:local recipient "user@domain.com"
/ip dhcp-server lease

:if ($leaseBound = 1 && ([/ip dhcp-server lease find where dynamic mac-address=$leaseActMAC])) do={
	:do {
        :local dhcphostname $"lease-hostname"        
		:tool e-mail send to=$recipient subject="DHCP Address Alert [$leaseActIP] [$leaseActMAC] [$dhcphostname]" body="MAC address: [$leaseActMAC]\nIP address: [$leaseActIP]\nDHCP Server: [$leaseServerName]\nHostname: [$dhcphostname]"
		#:log info "Sent DHCP alert for MAC $leaseActMAC"
        
	} on-error={:log error "Failed to send alert email to $recipient"}}

https://forum.mikrotik.com/viewtopic.php?t=153641

Dodaj komentarz

Brak komentarzy, bądź pierwszy i dodaj swój komentarz