NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXPRESSIONS | IDENTIFIERS | FORMATS | EXAMPLES | ATTRIBUTES | SEE ALSO | DIAGNOSTICS | NOTES
limreport is a simple but powerful report generator. limreport scans sequentially through the password map, evaluating select-expression for each user. If the result is non-zero, a non-empty string, or a set flag, then formatted data is written to standard output by interpreting the remaining arguments in the style of printf (see printf(3C)).
The command:
limreport 'uid>=100&&cpu.accrue>1.5e10' '%s\t%-.0f\n' lname cpu.accrue
lists the login names and accrued CPU usages of all users whose UIDs are 100 or more and whose accrued usage exceeds a given amount.
limreport reads information from the password map and from users' lnodes. If limreport is invoked such that no lnode data is required, then no lnodes are read. This means that even if no lnodes are available, limreport may still be used successfully on password map data only.
The command-line option is:
Use local lnode database file instead of password map. This option is useful when the system has a large list of users in the /etc/passwd file (and in corresponding network name services such as NIS, NIS+ or LDAP). When used, this option forces limreport to use the local lnode database file (/var/srm/srmDB) to get information about created lnodes.
This option has the following limitations:
The value of the level and orphan attributes will always be 0.
The value of the sgroupname attribute will always be an empty string.
It is possible for the CPU and memory accruals to not be up-to-date.
limreport uses C-style expressions with five special
types and a few additional operators. There is a string
type,
a flag
type similar to a C enum
type, the integer
and long
numeric types, and the floating-point
type double
. Operators have C-like precedence, with the exception
that relational operators have lower precedence than bitwise operators.
flag operands are accepted by relational operators only. C-style type conversion is performed on numeric operands of arithmetic and relational operators to raise them to equivalent types.
The elements of an expression are:
Multiply/divide. Numeric operands only.
Integer modulo. Integral numeric operands only.
Add/subtract (or unary negate). Numeric operands only.
Bitwise and/or/exclusive-or.
Bitwise complement (single operand), or regular expression matching (two string operands). With two operands, evaluates to 1 if the string on the left side contains a match for the regular expression string on the right side. Evaluates to 0 otherwise. Regular expressions are in the style of ed(1).
Is a member of scheduling group. Evaluates to 1 if the user whose numeric UID or string login name on the left side is a member of the scheduling group whose numeric UID or string login name is on the right side. Evaluates to 0 otherwise. (Note that users are not considered to belong to the group of which they are the header.)
Equal/not equal to. Evaluates to 1 if the left side and the right side evaluate to identical/different numeric, string, or flag values. Evaluates to 0 otherwise.
Greater/less than. Evaluates to 1 if the left side evaluates to a numeric (or string) value which is greater/less than the value of the right side. Evaluates to 0 otherwise.
Greater/less than or equal to. Evaluates to 1 if the left side evaluates to a numeric (or string) value which is greater/less than or equal to the value of the right side. Evaluates to 0 otherwise.
Logical and/or. Evaluates to 1 if the left side and/or the right side evaluates to a non-zero numeric value, a non-null string value, or a set flag value. Evaluates to 0 otherwise.
Unary logical not. Evaluates to 1 if the right side evaluates to a zero numeric value, a null string value, or a non-set flag value. Evaluates to 0 otherwise.
A sub-expression. May be used to override default operator precedence.
A constant string of characters.
A date
and time, equivalent to an integer
constant giving the number
of seconds since an epoch. The format is {[[[[year/]month/]day]hour:]min[.sec]}. Year is
a four-digit integer (for example, 1989, 2001). Month may be a one- or two-digit number
from 1 to 12, or (deprecated) a three-letter, mixed-case English month name
(for example, Jan, sep, NOV). Day is a one- or two-digit day-of-the-month
from 1 to 28, 29, 30, or 31, depending on the number of days in a given month. Hour is a one- or two-digit number from 0 to 23. Min is a one- or two-digit number from 0 to 59. Sec is a two-digit number from 00 to 59. The separators /, :, and space are optional, and in their absence
the numeric values month, day, hour, and min must each be exactly
two digits long. Any missing elements of the date and time format imply that
the current value be taken from the system time.
Examples of valid date and time values are {19910101 12:00.01} one second past midday on the first day of the year 1991, {17:00} five o'clock in the afternoon today, {01271200} noon on the 27th of January in the current year.
Any one of the identifiers described below. Evaluates
to either integer, long, double, string, or flag, depending on its type. Identifiers of 16-bit size are
converted to type int32
. For flag attributes, the optional ? suffix alters the attribute evaluation method (see below). For
non-flag attributes, the ? has no effect.
A numeric constant, interpreted as a decimal integer unless prefixed by 0 or 0x in which case it is taken as an octal
or hexadecimal integer respectively, or unless it contains a decimal point
or exponent part ({eE}_integer), in
which case it is taken as a decimal floating-point number, a double
. An integer constant has type int32
unless its magnitude
is too large to represent in 32 bits, in which case it has type int64
. An optional suffix of l or L
may be appended to force a type of int64
.
A number may optionally be suffixed by one or two scale characters: number[eptgmkb][wdhms]. The first character multiplies by the number of bytes in one exabyte, petabyte, terabyte, gigabyte, megabyte, kilobyte, or byte. The second character multiplies by the number of seconds in a week, day, hour, minute, or second. If only one character is present and its meaning is ambiguous (for example, m), then its meaning is deduced from the context. The b (byte) scale character serves no function other than in numbers of the form 100bm, where it forces the m to mean minutes, not megabytes.
Note that the expression will probably have to be enclosed in single quotes to stop the shell from interpreting symbols such as & as shell syntax and to preserve string constant quotation marks.
An identifier is either the name of an attribute, as defined in the Solaris Resource Manager configuration file, or a built-in name. Most built-in identifiers represent a field extracted from the user's password map entry; however, there are also some useful, miscellaneous ones. See the srm(5SRM) man page for a list of all standard attributes and their types.
There is no numeric constraint on the uses to which an identifier may be put. Identifiers that represent memory usage and limit attributes evaluate to a number of bytes. Identifiers that are dates and times evaluate to a number of seconds. Identifiers representing accrued memory usage attributes evaluate to a number of byte-seconds.
Flag identifiers evaluate to the flag's full value; if a flag has an immediate value of inherit, then the value is (recursively) evaluated from the parent lnode. If a flag identifier is suffixed with a ? character, then the immediate value of the flag is used instead, so the value inherit is possible.
The built-in identifiers and their types/values are:
string
; login name.
integer
; user UID.
integer
; initial group GID.
string
; encrypted password.
string
; initial (home) directory.
string
; initial shell.
string
; the comment, or gecos field.
string
; a synonym for comment.
string
; the login name of the user's scheduling group parent.
integer
; the current time.
integer
; the depth of the lnode in the scheduling tree; root is 0.
For orphan lnodes, this is the depth within the disjoint tree.
integer
; is non-zero if the lnode is an orphan.
string
; a list of attribute value assignments using the syntax of limadm(1MSRM).
Read-only attributes are omitted from the list. The command:
limreport 'flag.real' - lname preserve
will generate output which, if passed to limadm using the -f option, will completely reconstruct the state of all users' lnodes at the time of execution of the limreport command.
integer
; the UID of the lnode to which limreport
is attached.
string
; the login name corresponding to myuid.
flag
; a constant.
flag
; a constant.
flag
; a constant.
flag
; a constant.
In order to see all identifiers available to you, both built-in and user-defined, invoke limreport with the -? option or limadm with the -a option.
Note that the built-in identifiers sgroupname, preserve, mylname, orphan, and level default to the null string or -1 (for orphan and level) when the selected lnode does not exist. An error message will also be written to standard error.
The format argument is interpreted as the format string of a printf(3C) function. All modifiers following the % metacharacter are permitted except *. If the format argument is empty or contains only a dash (-), then the default format is used. The default format outputs the arguments in their simplest forms (as unsigned integers or floating-point numbers), separated by tab characters and terminated by a newline.
To facilitate the output of dates, which are represented as number of seconds since midnight on the 1st of January, 1970, the modifier %t may be used. This will cause the corresponding numeric integer argument to be interpreted as a time and output as a string in the style of ctime(3C). Modifiers in %t have the same effect as for %s.
To facilitate the output of time intervals, which are represented as a number of seconds, the modifier %i may be used. This will cause the corresponding numeric integer argument to be interpreted as a time interval and output as a string in the form `[Nw] [Nd] [Nh] [Nm] [Ns]'. Modifiers in %i have the same effect as for %s. If a maximum width is specified (a number following a decimal point), then trailing units are truncated and a + appended if the full length would exceed that many characters.
To facilitate the output of flag values, the modifier %v may be used. This will cause the corresponding flag argument to be converted to one of the strings clear, set, group, or inherit, and output as a string. Modifiers in %v have the same effect as for %s.
limreport 'uid >= 1' '%s,%u\n' lname uid
limreport 'flag.real && logins!=0' '%-8.8s %5d %3d %10d\n' lname cpu.myshares process.myusage memory.myusage
limreport \!flag.real - uid
flag.real can be used in expressions to check only existing lnodes. This will eliminate unwanted messages pertaining to lnodes that do not exist.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Architecture | SPARC |
Availability | SUNWsrmb |
ed(1), ctime(3C), printf(3C), liminfo(1SRM), limadm(1MSRM), srm(5SRM)
Solaris Resource Manager 1.3 System Administration Guide
All usage, diagnostic, and error messages are written to standard error.
If any error messages are output, limreport will return a non-zero exit status, indicating the number of such messages.
Invoking limreport with no arguments produces a summary of usage, including a list of all valid identifiers.
Malformed format strings, malformed expressions, and unknown identifiers cause limreport to produce informative error messages and exit. If the number of expression arguments does not match the number of % modifiers in the format string, an error is produced and limreport exits.
If, during operation, limreport is unable to read a user's lnode, then a diagnostic message is written and operation continues with the next user in the password map.
This man page is applicable to SunOS 5.6, SunOS 5.7, and SunOS 5.8.
NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXPRESSIONS | IDENTIFIERS | FORMATS | EXAMPLES | ATTRIBUTES | SEE ALSO | DIAGNOSTICS | NOTES