<div dir="ltr">It does not seem to like anything I try. My latest attempt: <div><br></div><div>suffix (concat("CIRCUIT-ID=", ( option agent.circuit-id), "."))));<br></div><div><br></div><div>It keeps complaining "comma expected" blah blah<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 5, 2016 at 11:01 AM, project722 <span dir="ltr"><<a href="mailto:project722@gmail.com" target="_blank">project722@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Do you mean something like this:<div><br></div><div>suffix (concat("CIRCUIT-ID=", substring ( option agent.circuit-id, 0, 9999,)<br></div><div><br></div><div>Because this is not working either. </div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 5, 2016 at 10:41 AM, project722 <span dir="ltr"><<a href="mailto:project722@gmail.com" target="_blank">project722@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>When I put that in as you have it listed I get errors when validating the config. </div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">/etc/dhcp/dhcpd.conf line 190: expecting data expression. </span><br></div><div><span style="font-size:12.8px"><br></span></div><div>How does the actual statement need to look?</div><div><span style="font-size:12.8px"><br></span></div></div><div class="m_-7123689881068720315HOEnZb"><div class="m_-7123689881068720315h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 5, 2016 at 9:56 AM, Ilkka Virta <span dir="ltr"><<a href="mailto:itvirta@iki.fi" target="_blank">itvirta@iki.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you want the whole of circuit-id printed, instead of a part, just use concat(... "CIRCUIT-ID=", option agent.circuit-id, ...) instead of calling substring(). substring(x, 2, 9999) takes the 9999 characters (bytes) after the first two, which you'd want to use if you know you don't have anything interesting in the first two bytes.<span><br>
<br>
On 5.10. 17:43, project722 wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ok. Making progress. I have went with the following log statements in my<br>
conf file:<br>
</blockquote>
<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
        " | CIRCUIT-ID=",<br>
        substring( option agent.circuit-id, 2, 9999),<br></span><span>
Which produces log output as follows:<br>
</span></blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
| CIRCUIT-ID=0R_LAB eth 1/2/1/1/1:200 | REMOTE-ID=tion82Test__DATA_ETH<wbr>1<br>
<br>
My question is:<br>
<br>
Are my substrings at the bottom for pulling in text correct? It appears<br>
as if the first part of the strings are cut off. What are my "values" I<br>
can use in these statements instead of 2, 9999? What should I change<br>
here to get the full text output without cutting off text?<br>
<br>
<br>
<br>
<br>
<br>
On Wed, Oct 5, 2016 at 8:04 AM, project722 <<a href="mailto:project722@gmail.com" target="_blank">project722@gmail.com</a><br></span><span>
<mailto:<a href="mailto:project722@gmail.com" target="_blank">project722@gmail.com</a>>> wrote:<br>
<br>
    I have adjusted my statement to account for the binary to ACSII<br>
    conversion. I'll test and report back if I run into any problems.<br>
<br>
    On Tue, Oct 4, 2016 at 7:01 PM, Glenn Satchell<br></span><div><div class="m_-7123689881068720315m_6732488797721571307h5">
    <<a href="mailto:glenn.satchell@uniq.com.au" target="_blank">glenn.satchell@uniq.com.au</a> <mailto:<a href="mailto:glenn.satchell@uniq.com.au" target="_blank">glenn.satchell@uniq.co<wbr>m.au</a>>> wrote:<br>
<br>
        There may be non-ascii characters in your option<br>
        agent.circuit-id, so try<br>
        a suitable binary-to-ascii() around it. If there is a non-ascii<br>
        or null it<br>
        won't print anything.<br>
<br>
        The parenthesis around a variable make no difference, they just<br>
        control<br>
        order of parameters.<br>
<br>
        regards,<br>
        -glenn<br>
<br>
        On Wed, October 5, 2016 3:49 am, project722 wrote:<br>
        > Hmmm.. OK here is the log for the test client.<br>
        ><br>
        > Oct  4 11:39:20 dhcpd: Lease for X.X.X.X with circuit-id<br>
        ><br>
        > That's all it said.<br>
        ><br>
        > I know that my ACL class for circuit id works as it was allowed to get an<br>
        > IP address.<br>
        ><br>
        > The log line reported back the correct IP so I know that the<br>
        ><br>
        > "Lease for ", binary-to-ascii (10, 8, ".", leased-address),<br>
        ><br>
        > Line in my logging clause works.<br>
        ><br>
        > But why did it stop there? Do I need to remove the parenthesis<br>
        around<br>
        > "option agent.circuit-id" since I am not using parenthesis in<br>
        my ACL<br>
        > class?<br>
        ><br>
        > On Tue, Oct 4, 2016 at 11:25 AM, project722<br></div></div><span>
        <<a href="mailto:project722@gmail.com" target="_blank">project722@gmail.com</a> <mailto:<a href="mailto:project722@gmail.com" target="_blank">project722@gmail.com</a>>> wrote:<br>
        ><br>
        >> Alfred - thanks but your setup is much more complex than mine.<br>
        >><br>
        >> Alex, I have put in the changes as you suggested and it passed<br>
        >> validation.<br>
        >> I'll report back what the logs look like or if I have any further<br>
        >> problems.<br>
        >><br>
        >> Thanks!<br>
        >><br>
        >> On Tue, Oct 4, 2016 at 11:12 AM, Alex Moen <<a href="mailto:alexm@ndtel.com" target="_blank">alexm@ndtel.com</a><br></span><div><div class="m_-7123689881068720315m_6732488797721571307h5">
        <mailto:<a href="mailto:alexm@ndtel.com" target="_blank">alexm@ndtel.com</a>>> wrote:<br>
        >><br>
        >>> Just comparing with mine, it seems that the "option<br>
        agent.circuit-id"<br>
        >>> needs to be in parens.  And, I don't know the use of the<br>
        >>> "(leased-address)"<br>
        >>> is.  So, try this:<br>
        >>><br>
        >>> ------------------------------<wbr>-----------------------<br>
        >>> ## Option 82 Class<br>
        >>> class "myvendor" {<br>
        >>> match if option agent.circuit-id = 00:04:00:6b:00:84;<br>
        >>> }<br>
        >>><br>
        >>> # Test Option 82 logging<br>
        >>> if exists agent.circuit-id<br>
        >>> {<br>
        >>> log (info, concat(<br>
        >>>     "Lease for ", binary-to-ascii (10, 8, ".", leased-address),<br>
        >>>     " with circuit-id ", (option agent.circuit-id),<br>
        >>>     " is assigned using Option82"<br>
        >>>     ));<br>
        >>> }<br>
        >>><br>
        >>> pool {<br>
        >>>                 allow members of "myvendor";<br>
        >>>                 range x.x.x.x x.x.x.x;<br>
        >>>         }<br>
        >>> ------------------------------<wbr>-----------------------<br>
        >>><br>
        >>> This should give you a line that looks something like:<br>
        >>><br>
        >>> Lease for 192.168.0.10 with circuit-id Ethernet 5 is<br>
        assigned using<br>
        >>> Option82<br>
        >>><br>
        >>> Obviously, your circuit-id will most likely be something<br>
        other than<br>
        >>> "Ethernet 5", but you get the idea.<br>
        >>><br>
        >>> If I'm way off base, someone please correct me!<br>
        >>><br>
        >>> Good luck,<br>
        >>><br>
        >>> Alex<br>
        >>><br>
        >>><br>
        >>><br>
        >>> On 10/04/2016 10:27 AM, project722 wrote:<br>
        >>><br>
        >>>> Hello DHCP experts! We are implementing Option 82 in our<br>
        network and I<br>
        >>>> am just scratching the surface of how to setup my server. I<br>
        have<br>
        >>>> successfully created my first Option 82 ACL based on the<br>
        agent circuit<br>
        >>>> ID<br>
        >>>> that is contained in the packet, now I just need guidance<br>
        on how I get<br>
        >>>> the<br>
        >>>> Option 82 data into the logs. Here is my O82 setup on the<br>
        server:<br>
        >>>><br>
        >>>> ## Option 82 Class<br>
        >>>> class "myvendor" {<br>
        >>>> match if option agent.circuit-id = 00:04:00:6b:00:84;<br>
        >>>> }<br>
        >>>><br>
        >>>> # Test Option 82 logging<br>
        >>>> if exists agent.circuit-id<br>
        >>>> {<br>
        >>>> log (info, concat( "Lease for ", option agent.circuit-id<br>
        >>>> (leased-address), "is an address assigned using Option82"));<br>
        >>>> }<br>
        >>>><br>
        >>>> pool {<br>
        >>>>                 allow members of "myvendor";<br>
        >>>>                 range x.x.x.x x.x.x.x;<br>
        >>>>         }<br>
        >>>><br>
        >>>> The problem I am having is when I go to check the conf before<br>
        >>>> restarting<br>
        >>>> dhcpd I am getting the error:<br>
        >>>><br>
        >>>> etc/dhcp/dhcpd.conf line 135: right parenthesis expected.<br>
        >>>> log (info, concat( "Lease for ", option agent.circuit-id (<br>
        >>>> ^<br>
        >>>> Can anyone tell me what I am doing wrong and how to fix<br>
        this error?<br>
        >>>><br>
        >>>><br>
        >>>> ______________________________<wbr>_________________<br>
        >>>> dhcp-users mailing list<br></div></div>
        >>>> <a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a> <mailto:<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.o<wbr>rg</a>><br>
        >>>> <a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/dhcp-users</a><span><br>
        <<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman<wbr>/listinfo/dhcp-users</a>><br>
        >>>><br>
        >>><br>
        >>><br>
        >>> --<br>
        >>> Alex Moen<br>
        >>> NSTII<br>
        >>> Calix System Specialist<br>
        >>> North Dakota Telephone Company<br></span>
        >>> <a href="tel:701-662-6481" value="+17016626481" target="_blank">701-662-6481</a> <tel:<a href="tel:701-662-6481" value="+17016626481" target="_blank">701-662-6481</a>><br>
        >>><br>
        >>> ______________________________<wbr>_________________<br>
        >>> dhcp-users mailing list<br>
        >>> <a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a> <mailto:<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.o<wbr>rg</a>><br>
        >>> <a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/dhcp-users</a><span><br>
        <<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman<wbr>/listinfo/dhcp-users</a>><br>
        >>><br>
        >><br>
        >><br>
        > ______________________________<wbr>_________________<br>
        > dhcp-users mailing list<br></span>
        > <a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a> <mailto:<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.o<wbr>rg</a>><br>
        > <a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/dhcp-users</a><span><br>
        <<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman<wbr>/listinfo/dhcp-users</a>><br>
<br>
<br>
        ______________________________<wbr>_________________<br>
        dhcp-users mailing list<br></span>
        <a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a> <mailto:<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.o<wbr>rg</a>><br>
        <a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/dhcp-users</a><span><br>
        <<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman<wbr>/listinfo/dhcp-users</a>><br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
dhcp-users mailing list<br>
<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/dhcp-users</a><br>
<br>
</span></blockquote><div class="m_-7123689881068720315m_6732488797721571307HOEnZb"><div class="m_-7123689881068720315m_6732488797721571307h5">
<br>
______________________________<wbr>_________________<br>
dhcp-users mailing list<br>
<a href="mailto:dhcp-users@lists.isc.org" target="_blank">dhcp-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/dhcp-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/dhcp-users</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>