Go to main content

man pages section 8: System Administration Commands

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

kstat2adm (8)

Name

kstat2adm - manage optional kstats

Synopsis

kstat2adm [-h | -?]
kstat2adm [-v] enable id [id ...]
kstat2adm [-v] disable id [id ...]
kstat2adm [-v] default id [id ...]

Description

The kstat2adm command provides the facility to manage optional kstats. Optional kstats are those that are not created automatically, unless explicitly enabled.

The tool enables the user to list the registered optional kstats, and enable or disable such kstats, and to manage the persistence of the enabled state across reboots.

The PRIV_KSTAT_MANAGE privilege and the solaris.smf.manage.kstats authorization is required to change the enabled state of optional kstats.

Options

The following options are supported:

enable id [id ...]

Enables the optional kstats identified by the given id strings

disable id [id ...]

Disables the optional kstats identified by the given id strings

default id [id ...]

Resets the optional kstats identified by the given id strings to their default enabled state, and clear any persistent state for the ids.

–v

Verbose output

–h, –?

Displays a usage message

Exit Status

The following exit values are returned:

0

Successful completion

1

An error occurred

2

User does not have permission to enable or disable optional kstats

Examples

Example 1 List Optional Kstats

The following command lists the optional kstats:

# kstat2adm
IDENTIFIER              DEFAULT   STATE     PSTATE   DESCRIPTION
nfs:v2_op_latency       disabled  disabled  -        NFSv2 server op latency
nfs:v3_op_latency       disabled  disabled  disabled NFSv3 server op latency
nfs:v41_op_latency      disabled  disabled  -        NFSv4.1 server op latency
nfs:v4_op_latency       disabled  enabled   enabled  NFSv4 server op latency

The DEFAULT value indicates the default enabled state for the given optional kstats. The STATE value indicates the current enabled state and the PSTATE value indicates the persistent state which will be set on the optional kstats on the next reboot. The state values which are displayed are the following:

-

State is not set, PSTATE column only

error

An error occurred while setting or querying the state for this optional kstat. Further information may be available in the system log. If the error is indicated in the STATE column, the current enabled state of the optional kstats is indeterminate. If the error is shown in the PSTATE column, it indicates that there is a problem querying the kstat2adm SMF service for the persistent state.

enabled

The optional kstats are enabled

disabled

The optional kstats are disabled

Example 2 Enable Optional Kstats

The following command enables the optional kstats:

# kstat2adm enable nfs:v4_op_latency nfs:v41_op_latency
nfs:v4_op_latency kstats enabled
nfs:v41_op_latency kstats enabled
Example 3 Disable Optional Kstats

The following command disables the optional kstats:

# kstat2adm disable nfs:v4_op_latency nfs:v41_op_latency
nfs:v4_op_latency kstats disabled
nfs:v41_op_latency kstats disabled

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os

See Also

kstat2(8), privileges(7), auths(1)