Cisco Access Registrar: Automatically Clear Old Sessions

Posted on in System Administration

While doing some testing with Cisco Access Registrar (CAR) 5.0, I noticed that the test user had hundreds of old sessions hanging around:

--> query-sessions /r with-User X
Sessions with-User X for /Radius
  Sessions for /Radius/SessionManagers/session-mgr-1:
    S432 Key: 04000000000CF660, NAS:, NAS-Port: 0, User-Name: X, Time: 21:19:26, Acct-Session-Id: 04000000000CF660
<snipped a lot of lines>

--> count-sessions /r with-User X

Total 469 session(s) with-User X for /Radius/SessionManagers

It seemed like a good idea to have these old sessions be cleared out rather than sitting around forever. These sessions were likely created during testing when things may not have worked perfectly right. Although this can be done by hand (release-sessions), I decided to have it done automatically. You have to change two settings.

First, set the PhantomSessionTimeOut in your session manager. This controls how long it takes for an accounting start record to appear before CAR believes the session is never going to start.

--> cd /Radius/SessionManagers/session-mgr-1/

[ //localhost/Radius/SessionManagers/session-mgr-1 ]
    Name = session-mgr-1
    Description = 
    Type = Local
    IncomingScript = 
    OutgoingScript = 
    AllowAccountingStartToCreateSession = False
    SessionTimeOut = 
    PhantomSessionTimeOut = 
    SessionKey = User-Name

--> set PhantomSessionTimeOut "10 Minutes"

Set PhantomSessionTimeOut "10 Minutes"

--> cd /Radius/Advanced/

[ //localhost/Radius/Advanced ]
    SessionPurgeInterval =

--> set SessionPurgeInterval "1 Hour"

Set SessionPurgeInterval "1 Hour"

--> save

Validating //localhost...
Saving //localhost...

--> reload

Reloading Server 'Radius'...
Server 'Radius' is Running, its health is 10 out of 10

As you remember, we had 469 sessions for user X. After an hour...

--> count-sessions /r with-User X

No active sessions found with-User X for /Radius/SessionManagers

My Bookshelf

Reading Now

Other Stuff