Thanks. This is what I ended up using: if ("%{sql:INSERT INTO raddhcplog (date, username, mac, ip) VALUES (NOW(), '%{User-Name}', upper(replace('%{DHCP-Client-Hardware-Address}',':','-')), '%{reply:DHCP-Your-IP-Address}')}") { # insert succeeded ok } On Sun, Oct 4, 2015 at 12:45 PM, Alan DeKok <aland@deployingradius.com> wrote:
On Oct 4, 2015, at 10:55 AM, Hernán Freschi <hjf@hjf.com.ar> wrote:
Is there a way to log DHCP queries? I would like to keep a log of timestamp, MAC address and assigned IP address for every request.
You can just write the SQL insert statement directly in "unlang", with a bit of text to wrap it:
... if ("%{sql:INSERT ....}") { # insert succeeded }
...
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html