rlm_rediswho

Synopsis

The rediswho module implements radutmp style user login tracking via the redis module.

Processing Sections

accounting

When listed in the accounting section, the rediswho module will store radutmp style user login information in a redis database.

Return codes

noop The packet contained no Acct-Status-Type attribute, or the value of the attribute is unknown.

fail The module was unable to connect to the redis database.

ok The module wrote the users login information into the redis database.

Expansions

None.

Directives

redis_module_instance
Syntax

redis_module_instance = string

Default

redis

Description

The name of the redis module instance.

trim_count
Syntax

trim_count = integer

Default

15

Description

The number of sessions of which to keep track per user. If there are more than this number, then older sessions are deleted.

Start

Each subsection contains insert, trim, and expire queries. The subsections are named after the contents of the Acct-Status-Type attribute. See dictionary.rfc2866 for names of the various Acct-Status-Type values. This module supports any Acct-Status-Type. Just add a subsection of the appropriate name, along with insert, trim, and expire queries

expire
Syntax

expire = string

Default

EXPIRE %{User-Name} ${..expire-time}

Description

Redis command to expire the user’s session.

insert
Syntax

insert = string

Default

LPUSH %{User-Name} %l,%{Acct-Session-Id},%{NAS-IP-Address},%{Acct-Session-Time},%{Framed-IP-Address},%%​%{Acct-Input-Gigawords}:-0},%%​%{Acct-Output-Gigawords}:-0},%%​%{Acct-Input-Octets}:-0},%%​%{Acct-Output-Octets}:-0}

Description

Redis command to insert the user’s session data.

trim
Syntax

trim = string

Default

LTRIM %{User-Name} 0 ${..trim-count}

Description

Redis command to delete older user sessions.

Interim-Update

expire
Syntax

expire = string

Default

EXPIRE %{User-Name} ${..expire-time}

Description

Redis command to expire the user’s session.

insert
Syntax

insert = string

Default

LPUSH %{User-Name} %l,%{Acct-Session-Id},%{NAS-IP-Address},%{Acct-Session-Time},%{Framed-IP-Address},%%​%{Acct-Input-Gigawords}:-0},%%​%{Acct-Output-Gigawords}:-0},%%​%{Acct-Input-Octets}:-0},%%​%{Acct-Output-Octets}:-0}

Description

Redis command to insert the user’s session data.

trim
Syntax

trim = string

Default

LTRIM %{User-Name} 0 ${..trim-count}

Description

Redis command to delete older user sessions.

Stop

expire
Syntax

expire = string

Default

EXPIRE %{User-Name} ${..expire-time}

Description

Redis command to expire the user’s session.

insert
Syntax

insert = string

Default

LPUSH %{User-Name} %l,%{Acct-Session-Id},%{NAS-IP-Address},%{Acct-Session-Time},%{Framed-IP-Address},%%​%{Acct-Input-Gigawords}:-0},%%​%{Acct-Output-Gigawords}:-0},%%​%{Acct-Input-Octets}:-0},%%​%{Acct-Output-Octets}:-0}

Description

Redis command to insert the user’s session data.

trim
Syntax

trim = string

Default

LTRIM %{User-Name} 0 ${..trim-count}

Description

Redis command to delete older user sessions.