[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.1 radwho

Radwho displays the list of users currently logged in by the Radius server.

Default output information is made compatible with that of the standard UNIX finger(1) utility. For each user the following information is displayed: login name, name, connection protocol, NAS port, login date, NAS name, assigned IP or corresponding network name.

When used with ‘-l’ option, the long output format is used. In this format the following information is output:

Login

Login name of the user

SessionID

Unique session ID assigned by the terminal server.

Proto

Connection prototype.

Port

Port number

When

Login date and time

From

Name of the NAS that accepted the connection.

Location

Framed IP or the corresponding network name.

Caller

Caller station ID ad reported by the NAS.

Duration

Duration of the session.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.1.1 radwho Command Line Options

The following command line options can be used to modify the behavior of the program:

-A
--all

Display the information about logged-out users as well. The logged-out users are shown with ‘Proto’ field set to HUP.

-c
--calling-id

Display the calling station ID in the second column. Equivalent to ‘--format clid’.

-d NAME
--directory NAME

Set the Radius configuration directory name.

-D fmt
--date-format fmt

Set the date representation. Th fmt is usual strftime(3) format string. It defaults to %a %H:%M, i.e. the abbreviated weekday name according to the current locale, and the hour and the minutes as two-digit decimal numbers.

-e STRING
--empty STRING

Display any empty field as STRING. This is useful when the output of radwho is fed to some analyzing program, as it helps to keep the same number of columns on each line of output.

-F
--finger

Start in fingerd mode. In this mode radwho emulates the behavior of the fingerd(8) utility. Use this option if starting radwho from the ‘/etc/inetd.conf’ line like this (5):

 
finger stream tcp nowait nobody /usr/sbin/radwho
radwho -fL

This mode is also enabled by default if radwho notices that its name (argv[0]) is ‘fingerd’ or ‘in.fingerd’.

-H
--no-header

Don't display header line.

-i
--session-id

Display session ID instead of GECOS in the second column. Equivalent to ‘--format sid’.

-I
--ip-strip-domain

Display hostnames without domain part.

-u
--local-also

Display information about local users from the system ‘utmp’ file. May prove useful when running radwho as a finger daemon.

-n
--no-resolve

Do not resolve IP.

-o format
--format format

Select customized output format. This can also be changed by setting the value of environment variable RADWHO_FORMAT. The format is either a symbolic name of one of the predefined formats or a format specification (see next subsection).

-s
--secure

Run in secure mode. Queries without a user name are rejected.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.1.2 radwho Format Strings

A format string controls the output of every record from ‘radutmp’. It contains two types of objects: ordinary characters, which are simply copied to the output, and format specifications, each of which causes output of a particular piece of information from the ‘radutmp’ record.

Each format specification starts with an opening brace and ends with a closing brace. The first word after the brace is the name of the format specification. The rest of words are positional arguments followed by keyword arguments. Both are optional. The keyword arguments begin with a colon and must follow the positional arguments.

The full list of format specifications follows.

Format Spec: newline [count]

Causes the newline character to be output. If the optional count is supplied, that many newlines will be printed

Format Spec: tab [num]

Advance to the next tabstop in the output stream. If optional num is present, then skip num tabstops. Each tabstop is eight characters long.

The following specifications output particular fields of a ‘radutmp’ record. They all take two positional arguments: width and title.

The first argument, width sets the maximum output length for this specification. If the number of characters actually output is less than the width, they will be padded with whitespace either to the left or to the right, depending on the presence of the :right keyword argument. If the number of characters is greater than width, they will be truncated to fit. If width is not given, the exact data are output as is.

The second argument, title, gives the title of this column for the heading line. By default no title is output.

Every field specification accepts at least two keyword arguments. The keyword :right may be used to request alignment to the right for the data. This keyword is ignored if width is not given.

The keyword :empty followed by a string causes radwho to output that string if the resulting value for this specification would otherwise be empty.

Format Spec: login width title [:empty repl][:right]

Print the user login name.

Format Spec: orig-login width title [:empty repl][:right]

Print original login name as supplied with the request.

Format Spec: gecos width title [:empty repl][:right]

The GECOS field from the local ‘/etc/passwd’ corresponding to the login name. If the user does not have a local account, his login name is output.

Format Spec: nas-port width title [:empty repl][:right]

NAS port number

Format Spec: session-id width title [:empty repl][:right]

The session ID.

Format Spec: nas-address width title [:empty repl][:right][:nodomain]

The NAS name or IP.

The :nodomain keyword suppresses the output of the domain part of the name, i.e., the hostname is displayed only up to the first dot.

Format Spec: framed-address width title [:empty repl][:right][:nodomain]

Framed IP assigned to the user, if any.

The :nodomain keyword suppresses the output of the domain part of the name, i.e. the hostname is displayed only up to the first dot.

Format Spec: protocol width title [:empty repl][:right]

Connection protocol as reported by Framed-Protocol attribute. If the symbolic value is found in the dictionary file, it will be displayed. Otherwise, the numeric value will be displayed as is.

Format Spec: time width title [:empty repl][:right][:format date-format]

Date and time when the session started.

The :format keyword introduces the strftime format string to be used when converting the date for printing. The default value is %a %H:%M.

Format Spec: duration width title [:empty repl][:right]

Total time of the session duration.

Format Spec: delay width title [:empty repl][:right]

Delay time (see section Acct-Delay-Time).

Format Spec: port-type width title [:empty repl][:right]

Port type as reported by the value of the NAS-Port-Type attribute. If the symbolic value is found in the dictionary file, it will be displayed. Otherwise, the numeric value will be displayed as is.

Format Spec: clid width title [:empty repl][:right]

The calling station ID.

Format Spec: realm width title [:empty repl][:right][:nodomain]

If the request was forwarded to a realm server, print the symbolic name of the realm from the ‘raddb/realms’ file. If no symbolic name is found, print the remote server IP or hostname. In the latter case, the :nodomain keyword may be used to suppress the output of the domain part of the name, i.e. to display the hostname only up to the first dot.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.1.3 radwho Predefined Formats

The predefined formats are:

default

Default output format. Each record occupies one line. The fields output are: login name, GECOS name, connection protocol, port number, time when the connection was initiated, NAS IP, and assigned framed IP. This corresponds to the following format specification (split in several lines for readability:

 
(login 10 Login) (gecos 17 Name) \
(protocol 5 Proto) (nas-port 5 TTY) \
(time 9 When) (nas-address 9 From) \
(framed-address 16 Location)
sid

The same as ‘default’, except that the session ID is output in the second column.

clid

The same as ‘default’, except that the calling station ID is output in the second column.

long

Outputs all information from each ‘radutmp’ record. It is equivalent to specifying the following format string:

 
(login 32 Login) (session-id 32 SID) \
(protocol 5 Proto) (nas-port 5 Port) \
(time 27 Date) (nas-address 32 NAS) \
(clid 17 CLID) (duration 7 Duration) \
(framed-address 16 Location) (realm 16 Realm)
gnu

Each ‘radutmp’ record is represented as a table. It is equivalent to specifying the following format string:

 
User: (login)(newline)\
In real life: (gecos)(newline)\
Logged in: (time)(newline)\
NAS: (nas-address)(newline)\
Port: (nas-port)(newline)\
CLID: (clid)(newline)\
Protocol: (protocol)(newline)\
Session ID: (session-id)(newline)\
Uptime: (duration)(newline)\
Assigned IP: (framed-address)(newline)\
Realm: (realm)(newline)"

[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Sergey Poznyakoff on December, 6 2008 using texi2html 1.78.