Selective logging of Option82 markets

Glenn Satchell glenn.satchell at uniq.com.au
Thu Oct 13 05:01:43 UTC 2016


I don't have a specific answer to your question, but I noticed the
suffix(concat()) usage from a post I originally made way back in 2003. So
great to see that it is still in widespread use.

Original post:

    http://marc.info/?l=dhcp-server&m=105689607527110&w=2

regards,
-glenn

On Thu, October 13, 2016 1:28 am, project722 wrote:
> I'm using a global statement which allows me to log all data that comes
> into the server with Option82 in it. Here is what I am using:
>
> if((option dhcp-message-type = 3 or option dhcp-message-type = 5) and
>       exists agent.circuit-id) {
>
>     log(info, concat( "OPTION-82 | IP =",
>         binary-to-ascii (10, 8, ".",leased-address),
>         " | MAC=",
>         suffix (concat("0", binary-to-ascii (16, 8, "",
>         substring( hardware, 1, 1))),2),":",
>         suffix (concat("0", binary-to-ascii (16, 8, "",
>         substring( hardware, 2, 1))),2),":",
>         suffix (concat("0", binary-to-ascii (16, 8, "",
>         substring( hardware, 3, 1))),2),":",
>         suffix (concat("0", binary-to-ascii (16, 8, "",
>         substring( hardware, 4, 1))),2),":",
>         suffix (concat("0", binary-to-ascii (16, 8, "",
>         substring( hardware, 5, 1))),2),":",
>         suffix (concat("0", binary-to-ascii (16, 8, "",
>         substring( hardware, 6, 1))),2),
>         #" | CIRCUIT-ID=",
>         #binary-to-ascii (10, 8, ".", option agent.circuit-id),
>         #" | REMOTE-ID=",
>         #binary-to-ascii (10, 8, ".", option agent.remote-id),
>         " | CIRCUIT-ID=",
>         substring( option agent.circuit-id, 0, 9999),
>         " | REMOTE-ID=",
>         substring( option agent.remote-id, 0, 9999)));
> }
>
> We have about 25 markets, or "pools", subnet declarations, whatever you
> want to call it. Some of which are test markets we are using for internal
> use. I need the ability to enable/disable option82 logging for these
> markets. I'd rather keep the logging statement global then disable only
> the
> few internal use markets that I need to. Is there a way to accomplish
> this.





More information about the dhcp-users mailing list