SQLIPPOOL + LINELOG
Alan DeKok
aland at deployingradius.com
Fri Jan 4 20:17:29 CET 2019
On Jan 3, 2019, at 2:57 PM, Aurélio de Souza Ribeiro Neto <netolistas at mpc.com.br> wrote:
>
> I'm trying to write in radius.log some logs from SQLIPPOOL.
>
> I wrote this code in linelog:
>
> linelog log_sqlippool {
> destination = file
> format = "%S, %{control:Module-Success-Message}"
> filename = ${logdir}/radius.log
> permissions = 0600
> reference =
> "sqlippool.%{%{control:Module-Success-Message}:-default}"
The Module-Success-Message contains a lot more than a simple "exists" or "success" word.
> sqlippool {
> exists = "Existing IP: %{reply:Framed-IP-Address} (did
> %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user
> %{User-Name})"
> success = "Allocated IP: %{reply:Framed-IP-Address}
> from %{control:Pool-Name} (did %{Called-Station-Id} cli
> %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
> clear = "Released IP %{Framed-IP-Address} (did
> %{Called-Station-Id} cli %{Calling-Station-Id} user %{User-Name})"
> failed = "IP Allocation FAILED from
> %{control:Pool-Name} (did %{Called-Station-Id} cli
> %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
> nopool = "No Pool-Name defined (did
> %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user
> %{User-Name})"
> }
> }
You've configured "line log" to look for "sqlippool.exists", or "sqlippool.success", or similar things.
The Module-Success-Message isn't that simple.
> And in defaults file at post-auth section insert log_sqlippool, and
> here is my radiusd -X output. Look Bold Lines:
> ...
> (78) log_sqlippool: EXPAND
> sqlippool.%{%{control:Module-Success-Message}:-default}
> (78) log_sqlippool: --> sqlippool.Allocated IP: 10.10.10.6 from
> mkt_pool (did CE - TESTE PPPoE - 2 cli 18:D6:C7:37:8B:BB port 15728702
> user testepppoe)
i.e. the Module-Success-Message is a long string that describes what the module did. The Module-Success-Message is *not* a simple word like "success" or "exists".
> How can I solve this problem?
>
> (78) log_sqlippool: No such entry ".sqlippool.Allocated IP:
> 10.10.10.6 from mkt_pool (did CE - TESTE PPPoE - 2 cli
> 18:D6:C7:37:8B:BB port 15728702 user testepppoe)"
Don't configure the linelog module like you did. It's wrong. It won't work.
The Module-Success-Message attribute already contains a full description of what happened. You don't need to add another one.
Just configure the linelog module to user Module-Success-Message as the *message*. And not as the *reference*. Delete the whole "sqlippool" subsection from the linelog configuration. It's not necessary.
Alan DeKok.
More information about the Freeradius-Users
mailing list