[ < ] [ > ]   [ << ] [ 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] [ ? ]

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