<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi friends… i am facing a problem here….<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">post-auth {</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class=""> . . . . . . . . . . . . . . . . </div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">update request {</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; background-color: rgb(0, 0, 0);" class=""><span style="color: rgb(245, 245, 245);" class=""> Tmp-Integer-0 := "%{sql: UPDATE acess set con_id = (select con_id from mynastable where con_ip = '%{Nas-IP-Address}'), </span><font color="#fffc41" class="">ace_last_ip = '%{Framed-IP-Address}'</font><font color="#f5f5f5" class=""> where ace_login = '%{SQL-User-Name}'}"</font></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class=""> }</div></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">}</div><div class=""><br class=""></div><div class="">ace_last_ip = ‘%{Framed-IP-Address}’ - "is always Null…."</div><div class=""><br class=""></div><div class="">i am executing this call in post-auth section in file: freeradius/sites-enabled/default</div><div class=""><br class=""></div><div class="">this is my last line inside post-auth block.</div><div class=""><br class=""></div><div class="">and also… i am getting a log error after any login:</div><div class=""><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Auth: Login OK: [teste1] (from client Auth_PPPOE_T1 port 15728650 cli C4:6E:1F:98:1D:4F)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Info: rlm_sql (sql): Attempting to connect rlm_sql_mysql #118</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Info: rlm_sql_mysql: Starting connect to MySQL server for #118</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Info: rlm_sql (sql): Connected new DB handle, #118</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Info: Allocated IP: 131.0.120.0 from db_pool (did pppoe-1 cli C4:6E:1F:98:1D:4F port 15728650 user teste1)</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Info: rlm_sql (sql): Attempting to connect rlm_sql_mysql #117</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Info: rlm_sql_mysql: Starting connect to MySQL server for #117</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Info: rlm_sql (sql): Connected new DB handle, #117</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Info: rlm_sql (sql): Attempting to connect rlm_sql_mysql #116</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Info: rlm_sql_mysql: Starting connect to MySQL server for #116</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; color: rgb(245, 245, 245); background-color: rgb(0, 0, 0);" class="">Fri Jan 9 10:49:45 2015 : Info: rlm_sql (sql): Connected new DB handle, #116</div><div style="margin: 0px; font-size: 10px; font-family: Monaco; background-color: rgb(0, 0, 0);" class=""><font color="#fffc41" class="">Fri Jan 9 10:49:45 2015 : Error: rlm_sql_mysql: MYSQL Error: No Fields</font></div><div style="margin: 0px; font-size: 10px; font-family: Monaco; background-color: rgb(0, 0, 0);" class=""><font color="#fffc41" class="">Fri Jan 9 10:49:45 2015 : Error: rlm_sql_mysql: MYSQL error: </font></div></div><div class=""><br class=""></div><div class="">MYSQL ERROR: No Fields ——— What is it ? </div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Tks for your support !!!</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Em 02/01/2015, à(s) 17:15, Arran Cudbard-Bell <<a href="mailto:a.cudbardb@freeradius.org" class="">a.cudbardb@freeradius.org</a>> escreveu:</div><br class="Apple-interchange-newline"><div class=""><br class=""><blockquote type="cite" class="">On 2 Jan 2015, at 13:55, Marcelo Santoro <<a href="mailto:santoro.ice@gmail.com" class="">santoro.ice@gmail.com</a>> wrote:<br class=""><br class="">Hi Friends… <br class=""><br class="">i Would like to know, how to execute a SQL UPDATE command after my client Authenticate for example.<br class=""><br class="">After client Authenticate… i want to execute a UPDATE command to my database sending the NAS where the client is connected… i know that this information exist in radacct, but i need this information in another table… <br class=""><br class="">My RadAcct table has more than 9 millions of registers… and i don`t want to make SELECTs in this table.<br class=""></blockquote><br class="">post-auth {<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>update request {<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre"> </span>Tmp-Integer-0 := "%{sql:UPDATE foo bar}"<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>}<br class="">}<br class=""><br class="">Arran Cudbard-Bell <<a href="mailto:a.cudbardb@freeradius.org" class="">a.cudbardb@freeradius.org</a>><br class="">FreeRADIUS development team<br class=""><br class="">FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2<br class=""><br class="">-<br class="">List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" class="">http://www.freeradius.org/list/users.html</a></div></blockquote></div><br class=""></div></body></html>