HP-UX AAA Server A.08.02.10 Administrator's Guide HP-UX 11i v3 (T1428-90093, November 2013)

Example 8 Timestamp Synchronization
For OCI:
SQLAction UpdateAcct {
{
input
RAD(Class) DBP(sessid, 254, CHAR)
output
DBR(-1:*) RET(ERROR)
DBR(0:0) RET(ACK)
DBR(*:*) RET(NAK)
SQLStatement db_oci {
UPDATE RAD_ACCT_TABLE
SET update_time=current_timestamp
WHERE session_id=:sessid
}
}
}
Finite State Table Configuration in the FSM
SQL Access for user profile retrieval requires no modification to the FSM. Use the Local Realm
screen in the Server Manager to configure the SQL action for the desired realm. However, the
FSM must be modified to perform more complex database interactions such as accounting or
session management with SQL Access.
At server startup, the FSM reads instructions from a state table by loading and parsing the
radius.fsm file. The radius.fsm file consists of definitions for states, events, and actions that
determine how a request is processed. See Chapter 26: “Customizing the HP-UX AAA Server Using
the Finite State Machine” (page 291) for more details on state tables in the FSM.
To specify the SQL action to be executed during a particular state, modify the radius.fsm file
as follows:
1. Set ‘ Action’ to ‘SQLAccess’ for the state event to trigger the execution of an SQL action.
2. Specify the SQL action in the xstring argument.
The following is an example of a modified FSM that executes account log requests via SQL Access:
Example 9 FSM with Accounting Log via SQL Access
#####################################
## Start Accounting via SQL Access ##
AcctLog:
*.*.ACCT_START SQLAccess ReplyHold xstring="ActionID=InsertAcct"
*.*.ACCT_STOP SQLAccess ReplyHold xstring="ActionID=StopAcct"
*.*.ACCT_ALIVE SQLAccess ReplyHold xstring="ActionID=UpdateAcct"
*.*.ACCT_MSTART SQLAccess ReplyHold xstring="ActionID=StopAllAccts"
*.*.ACCT_MSTOP SQLAccess ReplyHold xstring="ActionID=StopAllAccts"
*.*.ACCT_CANCEL SQLAccess ReplyHold xstring="ActionID=StopAcct"
*.*.ACCT_ON SQLAccess ReplyHold xstring="ActionID=StopAllAccts"
*.*.ACCT_OFF SQLAccess ReplyHold xstring="ActionID=StopAllAccts"
## End Accounting via SQL Access ##
#####################################
Stored Procedures
Most databases support stored procedures. Stored procedures are a set of SQL statements that
are stored on the database server and executed when necessary, instead of issuing individual SQL
statements.
272 SQL Access