Go to main content

手册页部分 1:用户命令

退出打印视图

更新时间: 2022年7月27日 星期三
 
 

sstore(1)

名称

sstore - 统计信息存储管理实用程序

用法概要

/usr/bin/sstore [-?]

/usr/bin/sstore help [subcommand]

/usr/bin/sstore capture [-aH]
	 [statid ... | -f ssid_file |
	 [interval [count]]

/usr/bin/sstore export [-F format] [-aH]
	 [[[-t start-time] [-e end-time] [-i step]] |
	 [[-t start-time] [-i step] [-p relative-pts]]]
	 [statid ... | -f ssid_file]

/usr/bin/sstore list [-F format] [-aH]
	 [[[-t start-time] [-e end-time]] |
	 [[-t start-time] [-p relative-pts]]]
	 [statid ... | -f ssid_file]

/usr/bin/sstore info [-F format] [-a]
	 [[[-t start-time] [-e end-time]] |
	 [[-t start-time] [-p relative-pts]]]
	 [statid ... | -f ssid_file]

描述

sstore 命令能够捕获、导出和显示统计信息系统信息库中包含的统计信息和事件信息。

选项

支持以下选项:

-?

显示用法消息。

Common Sub-Command Options

除非另有说明,否则所有子命令均支持以下选项:

–F format

指定备用输出格式。The value of format can be tsv (Tab Separated Values), csv (Comma Separated Values), or json (JavaScript Object Notation, formatted for readability).对于 csv 格式化输出,查询必须包括时间范围(请参见 –t 选项)和粒度或步进(秒)。

CSV 输出格式在 sstore.csv(5) 手册页中进行了介绍。JSON 输出格式在 sstore.json(5) 手册页中介绍。

–a

Makes wildcards match all entries (unstable and unbrowsable identifiers are hidden by default).The subcommand info, if specified without wildcard will list a detailed information of each identifier in the sstore.However, the subcommands export and capture strictly expect a wildcard or an SSID with this option.Refer to examples for more details on the various subcommands.

–H

在输出中省略标题。

–f ssid_file

包含标识符列表(每行一个标识符)的文件或 JSON(JavaScript 对象表示法)格式的文件,该格式与 sstore export 命令提供的格式相同。如果指定此选项,则不能直接指定标识符。

–t start-time

%Y-%m-%dT%H:%M:%S 格式指定开始时间戳。有关更多信息,请参见 strftime(3C) 手册页。可以使用关键字 now 指定当前时间。除非另有说明,否则未指定时此选项缺省为 epoch

可以通过两种方式指定时间范围:

形式 1:-t start-time -e end-time -i step

如果指定了 –t 但未指定 –p,则始终认为是第一种形式。如果采用此形式,则返回的数据由开始和结束时间限定,并且最小粒度为 step

形式 2:-t start-time -p relative-pts

第二种形式在达到最大 relative-pts 数据点时返回,并且不保证粒度。可以指定正值或负值,分别表示返回的点在 start-time 之后或之前。

Form 3: -t start-time -i step -p relative-pts

Form 3 returns at maximum relative-pts data points with granularity of step seconds.You can specify a positive or negative value for relative-pts, which signifies whether the points returned come after or before start-time respectively.

–e end-time

指定结束时间戳(有关格式的信息,请参见 –t)。指定了 –t 但未指定 –p 时,如果未指定此选项,则此选项缺省为 now

–i step

Specifies the interval between timestamps.The step shall be specified as [n] [ns] [nm] [nh] [nd] [nw], where n is the time duration and s, m, h, d and w corresponds to seconds, minutes, hours, days and weeks respectively.For example, 10 or 10s will be 10 seconds, 5h will be 5 hours, 2d will be 2 days and 3w will be interpreted as 3 weeks.For all non-zero specifications of step, the corresponding time interval is taken and the data is interpolated such that the timestamps between points are exactly step apart.

如果 step 为零或未指定,则返回的数据所带时间戳来自 sstored 初始抽样且未经修改。缺省情况下,sstored 尝试每秒抽样统计信息一次,但有时可能会失败,具体取决于系统的装入情况。请参见 sstored(8) 手册页。

–p relative-pts

指定要返回的最大数据点数。此值必须为非零值。可以指定可选的 start-time。如果未指定 start-time,则开始时间缺省为 now

操作数

statid

统计信息存储标识符 (statistics store identifier, SSID)。要指定多个标识符,应使用空格分隔标识符,或使用通配符或拼接,如使用 Oracle Solaris 11.4 分析中所述。

子命令

支持以下子命令:

sstore help subcommand

此命令显示指定 sstore 子命令或所有 sstore 子命令的用法。

要显示特定子命令的用法,请使用 sstore help 命令并将该特定子命令作为操作数。

如果使用不带任何操作数的 sstore help 命令,则显示所有 sstore 子命令的用法。

sstore capture [–aH] [statid ...| –f ssid_file] [interval [count]]

此子命令捕获并输出给定标识符的统计信息和事件信息,直到进程终止。

如果指定 interval,则每隔 interval 秒输出一次结果,直到按 Ctrl-C 终止进程。

如果您指定了 count,则在输出结果 count 次后进程终止。


注 - 要显示可用资源、统计信息、事件及其标识符,请使用 sstore list 命令。
sstore export [–F format] [–aH] [[[–t start-time] [–e end-time] [–i step]] | [[–t start-time] [–i step] [–p relative-pts]]] [statid ... | –f ssid_file]

此子命令输出给定时间范围内给定标识符的历史统计信息和事件信息。

必须至少指定一个属标识符。时间范围是可选的。如果您不指定时间范围,则输出给定标识符的所有数据。

sstore list [–F format] [–aH] [[[–t start-time] [–e end-time] | [[–t start-time] [–p relative-pts]]] [statid ...| –f ssid_file]

此子命令输出匹配标识符的列表。

如果未指定 –t,则假定 now 是开始时间值,sstore list 命令将输出当前可用的标识符列表。

如果您指定了 –t,则还输出 activity 的范围,它指明可以捕获标识符的时间。因此,–t 选项还可用于查看系统上的资源在过去何时可用。

sstore info [–F format] [–a] [[[–t start-time] [–e end-time] | [[–t start-time] [–p relative-pts]]] [statid ...| –f ssid_file]

此子命令显示有关给定标识符的信息。

时间范围指定行为与 sstore list 命令对应的行为相同。

示例

有关 //:op//:fmt 的示例,请参见 ssid-op(7) 手册页。

示例 1 每五秒记录统计信息两次

此示例记录 CPU 整数管道使用情况(在具有两个导线束的内核区域中),每五秒显示当前 stat 值两次。

$ sstore capture '//:class.cpu//:res.id/*//:stat.integer-pipe-usage' 5 2
TIME                VALUE IDENTIFIER
2014-10-08T14:42:06 104501725 //:class.cpu//:res.id/0//:stat.integer-pipe-usage
2014-10-08T14:42:06 110927532 //:class.cpu//:res.id/1//:stat.integer-pipe-usage
2014-10-08T14:42:11 123515733 //:class.cpu//:res.id/0//:stat.integer-pipe-usage
示例 2 在先前捕获后导出统计信息值

此示例在先前启用捕获八秒后导出数据链路 net0 的历史统计信息。

$ sstore export '//:class.link/phys//:res.name/net0//:stat.//:s.[out-bytes,in-bytes]'
TIME                VALUE IDENTIFIER
2014-10-08T15:13:46 1073914647 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:47 1073915035 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:48 1073915713 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:49 1073916959 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:50 1073917089 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:51 1073920729 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:52 1073922289 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:53 1073923069 //:class.link/phys//:res.name/net0//:stat.out-bytes
2014-10-08T15:13:47 4226366841 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:48 4226367123 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:49 4226367773 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:50 4226368179 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:51 4226372059 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:52 4226373961 //:class.link/phys//:res.name/net0//:stat.in-bytes
2014-10-08T15:13:53 4226375257 //:class.link/phys//:res.name/net0//:stat.in-bytes
示例 3 Export Statistic Values of previously captured data with 10 second step
$ sstore export -i 10s -t now -e 25 '//:class.link/phys//:res.name/net0//:stat.//:s.[out-bytes,in-bytes]'
TIME                VALUE IDENTIFIER
2020-06-16T11:19:43 150973526.0 //:class.link/phys//:res.name/net0//:stat.out-bytes
2020-06-16T11:19:53 150977726.0 //:class.link/phys//:res.name/net0//:stat.out-bytes
2020-06-16T11:20:03 150981926.0 //:class.link/phys//:res.name/net0//:stat.out-bytes
2020-06-16T11:19:43 46361608.0 //:class.link/phys//:res.name/net0//:stat.in-bytes
2020-06-16T11:19:53 46362448.0 //:class.link/phys//:res.name/net0//:stat.in-bytes
2020-06-16T11:20:03 46363662.0 //:class.link/phys//:res.name/net0//:stat.in-bytes
示例 4 Export Statistic Values of previously captured data with 1 minute step
$ sstore export -i 1m -t now -e 180 '//:class.link/phys//:res.name/net0//:stat.//:s.[out-bytes,in-bytes]'
TIME                VALUE IDENTIFIER
2020-06-16T11:21:23 150987526.0 //:class.link/phys//:res.name/net0//:stat.out-bytes
2020-06-16T11:22:23 150998000.0 //:class.link/phys//:res.name/net0//:stat.out-bytes
2020-06-16T11:23:23 151023386.0 //:class.link/phys//:res.name/net0//:stat.out-bytes
2020-06-16T11:24:23 151051466.0 //:class.link/phys//:res.name/net0//:stat.out-bytes
2020-06-16T11:21:23 46369071.0 //:class.link/phys//:res.name/net0//:stat.in-bytes
2020-06-16T11:22:23 46373059.0 //:class.link/phys//:res.name/net0//:stat.in-bytes
2020-06-16T11:23:23 46379147.0 //:class.link/phys//:res.name/net0//:stat.in-bytes
2020-06-16T11:24:23 46391989.0 //:class.link/phys//:res.name/net0//:stat.in-bytes
示例 5 Export Statistic Values of previously captured data of previous 3 data points relative to now with 5 seconds step
$ sstore export -i 5 -p -3 -t now '//:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle'
TIME                VALUE IDENTIFIER
2021-05-10T09:44:01 932648728114295 //:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle
2021-05-10T09:44:06 932653671291909 //:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle
2021-05-10T09:44:11 932658595839475 //:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle 
示例 6 Export Statistic Values of previously captured data of next 3 data points relative to given start-time with 5 seconds step
$ sstore export -i 5 -p 3 -t 2021-05-10T09:35:10 '//:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle'
TIME                VALUE IDENTIFIER
2021-05-10T09:35:10 932126235430593 //:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle
2021-05-10T09:35:15 932131178062798 //:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle
2021-05-10T09:35:20 932136105248117 //:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle
示例 7 Export Statistic Values of previously captured data of previous 3 data points relative to given start-time with 5 seconds step
$ sstore export -i 5 -p -3 -t 2021-05-10T09:35:10 '//:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle'
TIME                VALUE IDENTIFIER
2021-05-10T09:34:59 932115382756757 //:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle
2021-05-10T09:35:04 932120312981016 //:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle
2021-05-10T09:35:09 932125248546632 //:class.kstat//:res.system/cpu/0/sys//:stat.cpu_nsec_idle
示例 8 Export Statistic Values by matching wildcards

This example exports historical statistics for the Filesystems displaying all the stats which wildcard matches.

$ sstore export -a '//:class.fs//:*'
TIME                VALUE IDENTIFIER
...
2020-06-03T10:04:27 7097594.0 //:class.fs//:stat.access-ops
2020-06-03T10:04:28 7097846.0 //:class.fs//:stat.access-ops
...
2020-06-03T10:04:41 471072.0 //:class.fs//:stat.addmap-ops
2020-06-03T10:04:42 471072.0 //:class.fs//:stat.addmap-ops
...
2020-06-03T10:04:41 0.0 //:class.fs//:stat.async-cancel-ops
2020-06-03T10:04:42 0.0 //:class.fs//:stat.async-cancel-ops
...
示例 9 列出可用的 CPU 统计信息和事件
$ sstore list '//:class.cpu//:res.id/0//://:s.[stat,event].*'
IDENTIFIER            
//:class.cpu//:res.id/0//:stat.usage
//:class.cpu//:res.id/0//:stat.integer-pipe-usage
//:class.cpu//:res.id/0//:stat.interrupt-count
//:class.cpu//:res.id/0//:stat.interrupt-time
//:class.cpu//:res.id/0//:stat.xcalls
//:class.cpu//:res.id/0//:event.adm-action
//:class.cpu//:res.id/0//:event.alert
//:class.cpu//:res.id/0//:event.fault
示例 10 显示有关网络统计信息的信息
$ sstore info //:class.link/phys//:res.name/net0//:stat.ifspeed
 Identifier: //:class.link/phys//:res.name/net0//:stat.ifspeed
description: maximum received or transmitted bytes/s
  copyright: Copyright (c) 2014, 2022, Oracle and/or its affiliates.
  stability: stable
   max-rate: //:stat.ifspeed
 multiplier: 8
      units: bytes
    $schema: //:stat
       type: rate
         id: //:class.link/phys//:stat.ifspeed
示例 11 显示有关网络和 CPU 资源的信息
$ sstore info //:class.link/phys//:res.name/net0 //:class.cpu//:res.id/0   
 Identifier: //:class.link/phys//:res.name/net0
  stability: stable
description: data link instance

 Identifier: //:class.cpu//:res.id/0
  stability: stable
description: cpu instance
示例 12 Display Information on all the indentifiers that are currently available in sstore.
$ sstore info -a
...
Identifier: //:class.zpool
   $schema: //:class
 copyright: Copyright (c) 2015, 2022, Oracle and/or its affiliates.
   description: ZFS pool statistics
    id: zpool
	instance-metadata: {'description': 'ZFS pool', 'stability': 'stable'}
    namespaces: {'name-type': 'string', 'resource-name': 'name'}
     stability: stable
    stat-names: //:stat.size
    stat-names: //:stat.capacity
    stat-names: //:stat.health
    stat-names: //:stat.guid
    stat-names: //:stat.version
    stat-names: //:stat.available
    stat-names: //:stat.allocated
...
Identifier: //:class.app/solaris/audit/class
   $schema: //:class
 copyright: Copyright (c) 2016, 2022, Oracle and/or its affiliates.
   description: Solaris Audit class statistics
    id: app/solaris/audit/class
    namespaces: {'name-type': 'string', 'resource-name': 'name'}
    sau_read_sensitive_auth: solaris.sstore.audit.read
    stability: stable
    stat-names: //:stat.pass
    stat-names: //:stat.fail
...

退出状态

将返回以下退出值:

0

Command succeeded.

1

出现错误。

2

指定的命令行选项无效。

3

请求了多项操作,但只有一部分操作成功。

99

出现意外错误。

属性

有关下列属性的说明,请参见 attributes(7)

属性类型
属性值
可用性
system/sstore
接口稳定性
Uncommitted(未确定)

另请参见

libsstore(3LIB), ssid-metadata(7), ssid-op(7), sstoreadm(1), sstored(8)

使用 Oracle Solaris 11.4 分析