<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><base href="x-msg://557/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Doug,<div>try change directive 'option' to  'config-option' in log function:</div><div><br></div><div>log (info, concat ("DHCPAGENT assigning user-class1: ", config-option porthash));</div><div><br></div><div>Regards</div><div>Michal.</div><div><br></div><div><br><div><div>On 9. 10. 2013, at 20:25, "Hughes, Doug" <<a href="mailto:Douglas.Hughes@DEShawResearch.com">Douglas.Hughes@DEShawResearch.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><font face="Calibri" size="2"><span style="font-size: 11pt; "><div> </div><div>Shouldn’t it work to set an option and then log what was set? Or to set any arbitrary (temporary) variable that you’ve created? I want to dynamically build a variable and then use that for the host identifier match to hand out a fixed address based upon the agent.remote-id *<b>AND</b>* agent.circuit-id.</div><div> </div><div>I see from googling for the last week that a lot of people have tried this with varying degrees of hackishness and success since the dhcpd doesn’t support this directly. I’ve tried subclassing, but you can’t do an allow from a subclass for a pool of 1 IP (another hack). I’ve even looked at patches released in the past for this problem.</div><div> </div><div>But, back to the specific problem, one of debugging.</div><div> </div><div>Take this statement:</div><div>option porthash code 214 = text;</div><div> </div><div>if exists agent.circuit-id</div><div>{</div><div>        if option agent.circuit-id ~= ":" {</div><div>                log (info, concat ("DHCPAGENT ", "stuff"));</div><div>                log (info, concat ("DHCPAGENT lease of ", binary-to-ascii (10,8, ".", leased-address), " for agent ", option agent.remote-id, " on ", option agent.circuit-id));</div><div>                option porthash = concat(substring(option agent.remote-id,0,10), "_", substring(option agent.circuit-id, 0, 10));</div><div>                log (info, concat ("DHCPAGENT assigning user-class1: ", option porthash));</div><div>                log (info, concat ("DHCPAGENT assigning user-class2: ", option agent.remote-id, "_", option agent.circuit-id ));</div><div>                log (info, concat ("DHCPAGENT", " post"));</div><div>       }</div><div>}</div><div> </div><div>It prints:</div><div>DHCPAGENT stuff</div><div>DHCPAGENT lease of 1.1.2.3 for agent s55-test on 53:0:26</div><div>DHCPAGENT assigning user-class2: s55-test_53:0:26</div><div>DHCPAGENT post</div><div> </div><div> </div><div>So:</div><div>I have proven (to myself at least) that:</div><ul style="margin: 0px; padding-left: 20.25pt; "><li>the concatenation of agent.remote-id “_” and agent.circuit-id is a string.</li><li>The above string will log correctly</li><li>If I use any option (pre-existing, or defined. I have tried this with dhcp-client-identifier which is pre-defined) the log will fail, silently</li><li>If I use any temporary variable in the log statement that I assign instead of the porthash example above, it will fail.</li></ul><div> </div><div>Can anybody explain what is going on with the silent failure of the log statement? Why doesn’t it log? Why doesn’t it generate any error or output at all about the failure</div><div>Of the log?  This makes debugging quite difficult…</div><div> </div><div>Thanks</div><div> </div><div> </div></span></font>_______________________________________________<br>dhcp-users mailing list<br><a href="mailto:dhcp-users@lists.isc.org">dhcp-users@lists.isc.org</a><br><a href="https://lists.isc.org/mailman/listinfo/dhcp-users">https://lists.isc.org/mailman/listinfo/dhcp-users</a></div></blockquote></div><br></div></body></html>