все работает, только аккаунтинг видимо не производится.
Гадать можно сколько угодно, тут нужно чтобы ты привел свой файл sql.conf и процедуру radupdate
sql {
driver = "rlm_sql_mysql"
mysql {
warnings = auto
}
server = "localhost"
port = 3306
login = "nodeny" # користувач бази данних Нодені
password = "Nod+SQL#1" # пароль до бази данних Нодені
radius_db = "nodeny" # база Нодені
authorize_check_query = "call radcheck('%{User-Name}')"
authorize_reply_query = "call radreply('%{User-Name}')"
accounting {
query = "call radupdate('%{User-Name}','%{Framed-IP-Address}',\
'user=%{Calling-Station-Id};nas=%{NAS-IP-Address}','%{Acct-Session-Id}',\
(%{%{Acct-Input-Gigawords}:-0} * POWER(2, 32)) + %{%{Acct-Input-Octets}:-0},\
(%{%{Acct-Output-Gigawords}:-0} * POWER(2, 32)) + %{%{Acct-Output-Octets}:-0})"
type {
start {
query = "call radupdate('%{User-Name}','%{Framed-IP-Address}',\
'user=%{Calling-Station-Id};nas=%{NAS-IP-Address}','%{Acct-Session-Id}',\
(%{%{Acct-Input-Gigawords}:-0} * POWER(2, 32)) + %{%{Acct-Input-Octets}:-0},\
(%{%{Acct-Output-Gigawords}:-0} * POWER(2, 32)) + %{%{Acct-Output-Octets}:-0})"
}
}
}
}
CREATE PROCEDURE `radupdate`(IN login VARCHAR(64), IN ip VARCHAR(16),
IN properties VARCHAR(255), IN ses VARCHAR(32), IN trafin BIGINT(20), IN trafout BIGINT(20))
BEGIN
DECLARE usr_id INT;
DECLARE usr_ip VARCHAR(15) DEFAULT NULL;
DECLARE t_in BIGINT;
DECLARE t_out BIGINT;
SELECT id INTO usr_id FROM users WHERE name=login LIMIT 1; SELECT get_ip(usr_id) INTO usr_ip;
CALL set_auth(usr_ip, CONCAT('mod=pppoe;',REPLACE(properties,':','')));
SELECT trafin - IFNULL((SELECT traf_in FROM ses_traf WHERE ses_id=ses LIMIT 1),0) INTO t_in;
UPDATE users_trf SET in1=in1 + t_in WHERE uid=usr_id; SELECT trafout - IFNULL((SELECT traf_out FROM ses_traf WHERE ses_id=ses LIMIT 1),0) INTO t_out;
UPDATE users_trf SET out1=out1 + t_out WHERE uid=usr_id; INSERT INTO ses_traf SET ses_id=ses, traf_in=trafin, traf_out=trafout, time=UNIX_TIMESTAMP()
ON DUPLICATE KEY UPDATE traf_in=trafin, traf_out=trafout, time=UNIX_TIMESTAMP();
SET @s = CONCAT('INSERT INTO X', YEAR(NOW()), '_', MONTH(NOW()), '_', DAY(NOW()), ' VALUES(?,?,?,?,?,?)');
PREPARE stmt1 FROM @s;
SET @iface = 0;
SET @cls = 1;
SET @ts = CEIL(UNIX_TIMESTAMP() / 60) * 60;
SET @usr_id = usr_id;
SET @t_in = t_in;
SET @t_out = t_out;
EXECUTE stmt1 USING @usr_id, @iface, @ts, @cls, @t_in, @t_out;
DEALLOCATE PREPARE stmt1;
END$$