Custom log action for all subnets

Kim Christensen raccoon.lists at gmail.com
Tue Aug 22 08:25:59 UTC 2006


Hi list,

I have a control statement which checks an incoming request for its
circuit ID and creates a custom log string thereafter, and would like
it to be run no matter what subnet it concerns. However, it seems that
the actual action needs to be put inside a subnet clause to work.

How do I get this to work in a proper way, am I alone to want this?

Here's the code, blatantly stolen from the list (thanks author!):

if exists agent.circuit-id
{
        log (info, concat(
		"Lease for ", binary-to-ascii (10, 8, ".", leased-address),
		" is connected to interface ", binary-to-ascii(10, 8, "/",
suffix(option agent.circuit-id, 2)),
		" (add 1 to port number!), VLAN ", binary-to-ascii (10, 16, "",
substring( option agent.circuit-id, 2, 2)),
		" on switch ", binary-to-ascii(16, 8, ":", substring( option
agent.remote-id, 2, 6))));

        log (info, concat(
		"Lease for ", binary-to-ascii (10, 8, ".", leased-address),
        	" raw option-82 info is CID: ", binary-to-ascii (10, 8, ".",
option agent.circuit-id), " AID: ", binary-to-ascii(16, 8, ".", option
agent.remote-id)));
}

Kind regards
-- 
Kim Christensen


More information about the dhcp-users mailing list