<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks Ray <br>Both of you suggestions look like they are working.<br><br>Wayne<br><br>--- On <b>Thu, 1/8/09, Ray Phillips <i><r.phillips@jkmrc.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Ray Phillips <r.phillips@jkmrc.com><br>Subject: Re: Logging host-name and hardware<br>To: "Users of ISC DHCP" <dhcp-users@lists.isc.org><br>Date: Thursday, January 8, 2009, 1:08 AM<br><br><pre>Wayne:<br><br>> I am working on logging option82 information for requests. I would like to<br>just have one line that gives the option82 information, lease time, IP address,<br>hardware address, and host-name if the client has it set. Currently I am using.<br>> <br>> if exists agent.remote-id<br>>         {<br>>         log ( info, concat( "lease,", binary-to-ascii (10,
 8,<br>".", leased-address),",",<br>>         "agent,",option agent.remote-id,",",<br>>         "time,",binary-to-ascii(10,32,"",encode-int<br>(lease-time,32)),",",<br>>        <br>"hardware,",binary-to-ascii(16,8,":",substring(hardware,1,7))<br>>          ) );<br>> <br>> This gives me<br>> lease,192.168.11.250,agent,0003,time,600,hardware,0:1e:a:db:58:4f<br>> <br>> I would like to see the hardware address get formatted with<br>XX:XX:XX:XX:XX:XX currently if the hex value starts with 0 if gets dropped.<br><br>This piece of configuration-file code (courtesy of Glenn [1]) inserts the<br>leading 0 when required:<br><br>concat (<br>      suffix (concat ("0", binary-to-ascii (16, 8, "",<br>        substring (hardware, 1, 1))),2), ":",<br>      suffix (concat ("0", binary-to-ascii (16, 8, "",<br>        substring (hardware, 2, 1))),2), ":",<br>      suffix (concat ("0", binary-to-ascii (16, 8, "",<br>        substring (hardware, 3,
 1))),2), ":",<br>      suffix (concat ("0", binary-to-ascii (16, 8, "",<br>        substring (hardware, 4, 1))),2), ":",<br>      suffix (concat ("0", binary-to-ascii (16, 8, "",<br>        substring (hardware, 5, 1))),2), ":",<br>      suffix (concat ("0", binary-to-ascii (16, 8, "",<br>        substring (hardware, 6, 1))),2)<br>)<br><br><br>> Also I can't figure out how to extract the host-name.<br><br>I'm not too confident about this but I use this code to assign DNS names to<br>hosts which don't provide a name to the dhcp server:<br><br>option server.ddns-hostname = pick-first-value (<br>  option fqdn.hostname,<br>  option host-name,<br>  concat (<br>    "nn-",<br>#    suffix (concat ("0", binary-to-ascii (16, 8, "",<br>#      substring (hardware, 1, 1))),2), "-",<br>#    suffix (concat ("0", binary-to-ascii (16, 8, "",<br>#      substring (hardware, 2, 1))),2), "-",<br>#    suffix (concat ("0", binary-to-ascii (16, 8, "",<br>#      substring
 (hardware, 3, 1))),2), "-",<br>    suffix (concat ("0", binary-to-ascii (16, 8, "",<br>      substring (hardware, 4, 1))),2), "-",<br>    suffix (concat ("0", binary-to-ascii (16, 8, "",<br>      substring (hardware, 5, 1))),2), "-",<br>    suffix (concat ("0", binary-to-ascii (16, 8, "",<br>      substring (hardware, 6, 1))),2)<br>  )<br>);<br><br><br>so perhaps you need  option fqdn.hostname<br><br><br><br>Ray<br><br><br><br>[1]  http://marc.theaimsgroup.com/?l=dhcp-server&m=105689607527110&w=2<br>_______________________________________________<br>dhcp-users mailing list<br>dhcp-users@lists.isc.org<br>https://lists.isc.org/mailman/listinfo/dhcp-users<br></pre></blockquote></td></tr></table><br>