sqlippool log messages to stdout

Alan DeKok aland at deployingradius.com
Mon Mar 14 17:49:11 UTC 2022


On Mar 14, 2022, at 1:24 PM, Matteo Sgalaberni <sgala at sgala.com> wrote:
> Uhu, thanks, found it https://github.com/FreeRADIUS/freeradius-server/commit/6ea9cc233d4a16de2cb23465021635f332a86eab ! 
> 
> Can you help me also with the initial idea to bring the %{control:Module-Success-Message} of sqlippool into the standard logs? 
> 
> I found several people with the same needs in lots of posts but I haven't found any solutions. All mailing lists threads finish with "use linelog". Does exists an alternative or not at all?

  There is no way to log random things into the main log files.  There rarely any need for it.

  If you want to log the output of sqlippool, you can add your own attribute into raddb/dictionary:

ATTRIBUTE SQL-IPPool-Success 3000 string

	...
	sqlippool
	update control {
		SQL-IPPool-Success := &control:Module-Success-Message
	}

 That saves the message into a place where it won't get modified.  You may need to grab the *last* success message with:

	...
	sqlippool
	update control {
		SQL-IPPool-Success := &control:Module-Success-Message[n]
	}

  Then, just use the standard (and documented) logging mechanisms.  See the "log" section of radiusd.conf:

log {
	...

	auth_goodpass = yes
	msg_goodpass = "SQL module says %{control:SQL-IPPool-Success}"
	...

}

  That's it.

  Alan DeKok.



More information about the Freeradius-Users mailing list