Re
ok, last online zrobiłem za pomocą accouting
w radiusd.conf czy nowszych raddb/sites-enabled/default
w sekcji
accounting {
sql
sql_last_online
}
sql sql_last_online {
driver = "rlm_sql_mysql"
server = "localhost"
login = "lms"
password = "password"
radius_db = "lms"
postauth_table = "nodes"
deletestalesessions = yes
sqltrace = no
sqltracefile = ${logdir}/sqltrace.sql
num_sql_socks = 15
connect_failure_retry_delay = 60
sql_user_name = "%{User-Name}"
sql_set_password = ""
postauth_query = "UPDATE nodes INNER JOIN macs ON nodeid=
nodes.id SET lastonline = unix_timestamp() WHERE mac='%{Calling-Station-Id}' OR mac='%{User-Name}' AND nodeid=
nodes.id;"
accounting_onoff_query = "UPDATE nodes INNER JOIN macs ON nodeid=
nodes.id SET lastonline = unix_timestamp() WHERE mac='%{Calling-Station-Id}' OR mac='%{User-Name}' A
ND nodeid=
nodes.id;"
accounting_update_query = "UPDATE nodes INNER JOIN macs ON nodeid=
nodes.id SET lastonline = unix_timestamp() WHERE mac='%{Calling-Station-Id}' OR mac='%{User-Name}' AND
nodeid=
nodes.id;"
}
teraz można dodatkowo wrzucać do tableli stats dane, tylko czy robiąc to co 10min mamy update'owac czy dodawać, bo dane sa zliczane. Niewiem jakie założenia ma tabela stats ?