help-gnu-radius
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gnu-radius] Mysql Accounting


From: Gerald
Subject: [Help-gnu-radius] Mysql Accounting
Date: Mon, 24 Jun 2002 13:48:37 -0400 (EDT)

I've created the table as per:
http://www.gnu.org/software/radius/manual/html_chapter/radius_8.html#SEC65

Authentication is working from same remote mysql server but a different
DB. I checked and there is no /var/log/radacct/sql-lost. There is the
usual /var/log/radacct/local/detail... that I'm trying to put into mysql
DB.

Settings for the queries below are default to my knowledge (unless
another admin that was helping me changed them) ....

Thanks for any help or pointers in advance.

Gerald

# Accounting-relevant settings

# Enable/Disable Mysql accounting: default no
doacct yes

# Maximum number of open connections. This equals the number of requests
# that can be handled simultaneously.
# Ignored when keepopen is no.
acct_max_connections 16

# accounting database name
acct_db accounting

# Query to be used on session start
acct_start_query     INSERT INTO calls \
                     VALUES(%C{Acct-Status-Type},\
                            '%u',\
                            '%G',\
                            '%C{NAS-IP-Address}',\
                            %C{NAS-Port-Id},\
                            '%C{Acct-Session-Id}',\
                            0,\
                            0,\
                            0,\
                            0,\
                            '%C{Framed-IP-Address}',\
                            '%C{Called-Station-Id}',\
                            '%C{Calling-Station-Id}')

# Query to be used on session end
acct_stop_query      UPDATE calls \
                     SET status=%C{Acct-Status-Type},\
                         acct_session_time=%C{Acct-Session-Time},\
                         acct_input_octets=%C{Acct-Input-Octets},\
                         acct_output_octets=%C{Acct-Output-Octets},\
                         connect_term_reason=%C{Acct-Terminate-Cause} \
                     WHERE user_name='%C{User-Name}' \
                       AND status = 1 \
                       AND acct_session_id='%C{Acct-Session-Id}'

# Query to be used on receiving a keepalive record
acct_alive_query     UPDATE calls \
                     SET acct_session_time=%C{Acct-Session-Time},\
                         acct_input_octets=%C{Acct-Input-Octets},\
                         acct_output_octets=%C{Acct-Output-Octets},\
                         framed_ip_address='%C{Framed-IP-Address}' \
                     WHERE user_name='%C{User-Name}' \
                       AND status = 1 \
                       AND acct_session_id='%C{Acct-Session-Id}'

# Query to be used when a NAS goes down, i.e. when it sends
# Accounting-Off packet
acct_nasdown_query   UPDATE calls \
                     SET status=2,\

acct_session_time=unix_timestamp(now())-unix_timestamp(e
vent_date_time) \
                     WHERE status=1 AND
nas_ip_address='%C{NAS-IP-Address}'


# Query to be used when a NAS goes up, i.e. when it sends
# Accounting-On packet
acct_nasup_query   UPDATE calls \
                   SET status=3,\

acct_session_time=unix_timestamp(now())-unix_timestamp(e
vent_date_time) \
                   WHERE status=1 AND nas_ip_address='%C{NAS-IP-Address}'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]