====== Accounting CLI ======
{{indexmenu_n>6}}
View and management of fastpcrf accounting-sessions.
This is a fastdpi command, so you have to specify the fastdpi address in the -r argument of the utility.
==== pcrf acct show all ====
Output of fastpcrf accounting database. Note that the presence of an entry in the output of this command does not necessarily mean that there is an active accounting-session. If the entry does not have a session-id attribute, then such entry is not active.
fdpi_cli pcrf acct show all
==== pcrf acct show active ====
Output of fastpcrf accounting active sessions database. The output of this command includes active sessions and sessions terminated in the previous 5 minutes
fdpi_cli pcrf acct show active
==== pcrf acct show ====
Output of accounting-sessions by a specified key.
fdpi_cli pcrf acct show [ip=X | session=X | multi_session_id=X | login=X | uid=X]
You should set one of the keys:
* ''ip'' - subscriber's IPv4- or IPv6-address
* ''session'' - accounting session-id
* ''multi_session_id'' - accounting multi-session-id
* ''login'' - subscriber's login
* ''uid'' - internal unique identifier of the aggregation record. This id is assigned when the record is created and, unlike the session-id, never changes.
Examples (10.20.98.78 - fastpcrf-server address):
fdpi_cli -r 10.20.98.78 pcrf acct show ip=192.168.0.25
fdpi_cli -r 10.20.98.78 pcrf acct show ip=2001:5098:89::/64
fdpi_cli -r 10.20.98.78 pcrf acct show session=67890978DAE00067
fdpi_cli -r 10.20.98.78 pcrf acct show multi_session_id=M67890978DAE00067
fdpi_cli -r 10.20.98.78 pcrf acct show login=JohnSmith
fdpi_cli -r 10.20.98.78 pcrf acct show uid=1034
==== pcrf acct raw show ====
Output of raw data (raw-level by IP) of the accounting database. This is non-aggregated data coming from fastDPI.
fdpi_cli pcrf acct raw show [all | ip=X | session=X | multi_session_id=X | login=X | uid=X]
You should set one of the keys:
* ''all'' - output of complete raw DB
* ''ip'' - subscriber's IPv4- or IPv6-address
* ''session'' - accounting session-id
* ''multi_session_id'' - accounting multi-session-id
* ''login'' - subscriber's login
* ''uid'' - output of raw records included in the aggregation record with the specified internal unique identifier
Examples:
# output of all records
fdpi_cli pcrf acct raw show all
# search by IP
fdpi_cli pcrf acct raw show ip=192.168.0.25
fdpi_cli pcrf acct raw show ip=2001:5098:89::/64
# search by session-id or multi-session-id:
fdpi_cli pcrf acct raw show session=67890978DAE00067
fdpi_cli pcrf acct raw show multi_session_id=M67890978DAE00067
# search by login:
fdpi_cli pcrf acct raw show login=JohnSmith
# search by UID
fdpi_cli pcrf acct raw show uid=34098
==== pcrf acct show stat ====
Output of internal statistics of fastpcrf accounting database
fdpi_cli pcrf acct show stat
==== pcrf acct [start | stop | idle | restart] ====
Accounting sessions management
fdpi_cli pcrf acct [start | stop | idle | restart] [ip=X | session=X | multi_session_id=X | login=X | uid=X]
Actions:
* ''start'' - starts the accounting-сессию for the specified subscriber. Valid arguments are ''ip'', ''login''. If the session is already active, the command is ignored.
* ''stop'' - stops the accounting-sessions. Such arguments as ''session'' and ''ip'' stop one session, others can stop multiple sessions.
* ''idle'' - stops the accounting-sessions in case of idle timeout. The difference from ''stop'' command is that a session terminated by a data immutability timeout starts automatically when subscriber traffic appears, unless the [[dpi:bras_bng:radius_integration:radius_accounting:setup#acct_auth_sync|acct_auth_sync]] synchronization mode is enabled. Such arguments as ''session'' and ''ip'' stop one session, others can stop multiple sessions.
* ''restart'' - stops the current active session and starts a new one. Если сессия неактивна, она становится активной. If the session is inactive, it becomes active. If the session is active, it is stopped and a new session is started with a different session id.
You should set one of the arguments:
* ''ip'' - subscriber's IPv4- or IPv6-address
* ''session'' - accounting session-id (relates to ''stop'', ''restrart'', ''idle'' commands)
* ''multi_session_id'' - accounting multi-session-id
* ''login'' - subscriber's login
* ''uid'' - internal unique identifier of the aggregation record. This id is assigned when the record is created and, unlike the session-id, never changes.
Examples:
# Start of accounting sessions for all login IP addresses
fdpi_cli pcrf acct start login=JohnSmith
# Send Acct Stop for session 67890978DAE00067
fdpi_cli pcrf acct stop pcrf acct stop session=67890978DAE00067
# Restart an acct-session for IP
fdpi_cli pcrf acct restart ip=192.168.52.36
fdpi_cli pcrf acct restart ip=2001:5098:89::/64
# Stop all multisessions by idle timeout
fdpi_cli pcrf acct idle multi_session_id=M67890978DAE00067
==== pcrf acct interim ====
Sending interim update immediately for specified sessions.
To send an interim update, the session must be active.
fdpi_cli pcrf acct interim [ip=X | session=X | multi_session_id=X | login=X | uid=X]
You should set one of the arguments:
* ''ip'' - subscriber's IPv4- or IPv6-address
* ''session'' - accounting session-id
* ''multi_session_id'' - accounting multi-session-id
* ''login'' - subscriber's login
* ''uid'' - internal unique identifier of the aggregation record. This id is assigned when the record is created and, unlike the session-id, never changes.
Examples:
fdpi_cli pcrf acct interim ip=192.168.52.36
fdpi_cli pcrf acct interim ip=2001:5098:89::/64
fdpi_cli pcrf acct interim multi_session_id=M67890978DAE00067
fdpi_cli pcrf acct interim session=67890978DAE00067
fdpi_cli pcrf acct interim login=JohnSmith