Question about DHCP log (New feature request)

Hi guys. I have one question :slight_smile: whether it is possible, in one of the new version of Mikrotik OS, add Active Host Name in DHCP log. Now i got this:

Mar/12/2013 12:26:05 dhcp,info DHCP1 assigned 10.10.1.242 to 00:21:85:7A:4F:67

but i wish i could got this, for example:

Mar/12/2013 12:26:05 dhcp,info DHCP1 assigned 10.10.1.242 to 00:21:85:7A:4F:67 Dell-N5050

where is Dell-N5050 Active Host Name.
I hope, that is not a lot of work needed, to add this feature.

Thanks in advance :slight_smile:

I too would love this feature.

I know it’s feature request, but solution for now is adding such script as lease script in DHCP Server:

:log info ($leaseServerName . " " . $leaseActIP . " " . $leaseActMAC . " " . ([/ip dhcp-server lease get [find active-address=$leaseActIP] host-name]))

@Adam84 Thank You for sharing the script. It works Perfect!

@Mikrotik
That would be great if You could add Active Host Name in DHCP log.
I have recently switched from open DHCP server to Mikrotik DHCP server and this is the only thing which is missing in RouterOS.

+1 , need this in native ros logging for dhcp. (as we log all MTs to offsite syslog, and this would help alot). tks

What ever you send to log in lease script is sent to offsite syslog as well (if configured in “/ system logging”).
So why do you think this is required to be a native feature? IMHO this is an example where everything is fine due to extensibility by script.

then why log the leases mac address in default logging? this too could be done via script.

bc its a useful feature to log mac and active-host-name (as both provide different types of information) , and when doing these things via dhcp-server’s script functionality, its yet another thing we admins have to keep an eye on during upgrades (ie changes that may break the users script, we have already had this happen during one upgrade and didnt catch it until we needed to look up active-host-name logs only to find it missing).
The issue becomes a bit mre serious when you are talking about 100-200 mts deployed.
(also this script becomes another thing that we have to add to our default configure script for newly deployed MTs (and any copy/paste or escaping type issues)- ideally we want the new deploy script kept as simple and basic as possible). As well for new users who may not know how to use scripting.
tks

I used this script and i did get some messages into my syslog. Question is if its possible to export info from DHCP lease into 1 message instead of multiple messages? (see attachment)
Thanks
Screenshot_2022-02-04 12.53.11_wW0vow.png

You enabled debug logging for DHCP, is has nothing to do with the script you quoted

So would it be possible to get in log info from DHCP lease with active hostname? (as is written in 1st post of this thread? thanks

Sure, you even quoted it: http://forum.mikrotik.com/t/question-about-dhcp-log-new-feature-request/64400/3