<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello, I'm having some trouble with custom logging in DHCP. I'd like to
log option 82 info with DHCP requests, using the following commands:<br>
<br>
if exists agent.circuit-id and option dhcp-message-type = 3<br>
{<br>
# Log Circuit ID<br>
log ( info, concat( "OPTION-82 for ", binary-to-ascii
(10, 8, ".",leased-address),<br>
" from ",
substring(binary-to-ascii(16,8,":",hardware),2,24),<br>
" Circuit ID: ", (option agent.circuit-id), "."));<br>
# Log Agent ID<br>
log ( info, concat( "OPTION-82 for ", binary-to-ascii
(10, 8, ".",leased-address),<br>
" from ",
substring(binary-to-ascii(16,8,":",hardware),2,24),<br>
" Agent ID: " , (option agent.remote-id),"."));<br>
<br>
}<br>
<br>
This results in output similar to the following:<br>
<font face="Courier New" size="1"><span
style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New">Mar 12 12:52:20 mamba dhcpd: DHCPDISCOVER from
00:xx:xx:xx:05:5a via xx.xx.70.1</font></tt><br>
<tt><font face="Courier New">Mar 12 12:52:20 mamba dhcpd: DHCPOFFER on
xx.xx.232.223 to </font></tt></span></font><font face="Courier New"
size="1"><span style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New">00:xx:xx:xx:05:5a</font></tt></span></font><font
face="Courier New" size="1"><span
style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New"> via xx.xx.70.1</font></tt><br>
<tt><font face="Courier New">Mar 12 12:52:20 mamba dhcpd: OPTION-82 for
xx.xx.232.223 from </font></tt></span></font><font face="Courier New"
size="1"><span style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New">0:xx:xx:xx:5:5a</font></tt></span></font><font
face="Courier New" size="1"><span
style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New"> Circuit ID: n25-1-vb18-482-vlan8</font></tt><br>
<tt><font face="Courier New">Mar 12 12:52:20 mamba dhcpd: OPTION-82 for
xx.xx.232.223 from </font></tt></span></font><font face="Courier New"
size="1"><span style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New">0:xx:xx:xx:5:5a</font></tt></span></font><font
face="Courier New" size="1"><span
style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New"> Agetnt ID: N60-1-4-1-4-1-1</font></tt><br>
<tt><font face="Courier New">Mar 12 12:52:20 mamba dhcpd: DHCPREQUEST
for xx.xx.232.223 (xx.xx.64.17) from </font></tt></span></font><font
face="Courier New" size="1"><span
style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New">00:xx:xx:xx:05:5a</font></tt></span></font><font
face="Courier New" size="1"><span
style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New"> via xx.xx.70.1</font></tt><br>
<tt><font face="Courier New">Mar 12 12:52:20 mamba dhcpd: DHCPACK on
xx.xx.232.223 to </font></tt></span></font><font face="Courier New"
size="1"><span style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New">00:xx:xx:xx:05:5a</font></tt></span></font><font
face="Courier New" size="1"><span
style="font-size: 7.5pt; font-family: "Courier New";"><tt><font
face="Courier New"> via xx.xx.70.1</font></tt></span></font><br>
<br>
<br>
Notice that any fields in the mac address that had leading zeroes are
now missing them. This makes matching difficult when looking through
the logs. <br>
<br>
I've also tried using the dhcp-client-identifier with no luck, is there
a way to keep this information intact? How is the default logging
mechanism keeping this information whole?<br>
<br>
Thanks,<br>
--Blake<br>
</body>
</html>