Logging host-name and hardware

Test Cat testcat2003 at yahoo.com
Mon Jan 5 17:38:48 UTC 2009


I am working on logging option82 information for requests. I would like to just have one line that gives the option82 information, lease time, IP address, hardware address, and host-name if the client has it set. Currently I am using.


if exists agent.remote-id
        {
        log ( info, concat( "lease,", binary-to-ascii (10, 8, ".", leased-address),",",
        "agent,",option agent.remote-id,",",
        "time,",binary-to-ascii(10,32,"",encode-int (lease-time,32)),",",
        "hardware,",binary-to-ascii(16,8,":",substring(hardware,1,7))
         ) );

This gives me 
lease,192.168.11.250,agent,0003,time,600,hardware,0:1e:a:db:58:4f

I would like to see the hardware address get formatted with XX:XX:XX:XX:XX:XX currently if the hex value starts with 0 if gets dropped.
Also I can't figure out how to extract the host-name. I know that it can be done because both of the values appear correctly in the normal DHCP logging.

So if someone has some working examples or is willing to help me out that would be great.

Wayne


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20090105/56f1a6af/attachment.html>


More information about the dhcp-users mailing list