zonestat [-z zonelist] [-r reslist] [-n namelist] [-T u | d | i] [-R reports] [-q] [-x] [-p [-P lines]] [-S cols] interval [duration [report]]
The zonestat utility reports on the cpu, memory, networking, and resource control utilization of the currently running zones. Each zone's utilization is reported both as a percentage of system resources and the zone's configured limits.
The zonestat utility prints a series of interval reports at the specified interval. It optionally also prints one or more summary reports at a specified interval.
The default output is a summary of cpu, physical, and virtual memory, and networking utilization. The –r option can be used to choose detailed output for specific resources.
When run from within a non-global zone (NGZ), only processor sets visible to the NGZ are reported. The NGZ output includes all of other system resources, such as memory and limits.
For all reported resources, the NGZ's usage is output. Usage of each resource by the system, global zone, and all other zones, is reported as used by [system].
Inside a solaris-kz brand zone, only that zone's usage is visible.
For networking resources, only NGZ's usage is output. NGZs do not have visibility to other zones' networking resources and statistics.
proc_info privilege is required to use the zonestat utility. This privilege is a member of the basic privilege set.
The following options are supported:
Specify a list resource names on which to report. For pset resources, this is the name of the processor set. For physical-memory, locked-memory, and virtual-memory resources, the only names are mem_default and vm_default. For network resources, this is name of a datalink.
Dedicated-cpu processor sets can be specified by their pset name (SUNWtmp_zonename or by just their zonename.
Processor sets created by psrset can be specified by their pool pset name (SUNWlegacy_pset id), or just by their pset id.
In addition to a comma-separated list, multiple –n options can be specified to report on a set of resources.
Print output in stable, machine--parseable format. Individual fields are delimited with a colon (:). The line format is:
If -T is specified each line is prefixed with a timestamp:
The report types are: report-total, report-average, report-high, and interval,
The resource types are: header, footer, summary, physical-memory, virtual-memory, locked-memory, processor-set, processes, lwps, sysv-shared-memory, sysv-shmids, sysv-semids, sysv-msgids, lofi , network.
The header resource is a special resource used to state the beginning of an interval or summary report. All output lines between header resources belong to the same report. Each header has a matching footer.
The remaining fields are resource type specific. See the zonestat utility output for details.
All existing output fields are stable. Future versions might introduce new report and resource types. Future versions might also add additional new fields to the end of existing output n lines.
Running in a global zone, the statistics provided for solaris-kz brand zones are from the host point of view, and may differ within the zone; see solaris-kz(5).
For parseable output, specify lines to output in parseable output. One or more of the following line types can be chosen:
For each interval, and summary report has a header, which prints details such as the interval and count information. After each report, and footer is also printed
The lines describing each resource.
The utilization of each resource by the system. This includes the kernel, and any resource consumption not contributed to a specific zone. When zonestat is run from within a non-global-zone, this value is the aggregate resource consumed by the system and all other zones. system utilization for network resource type is not supported.
The total utilization of each resource.
Lines detailing the per-zone utilization of each resource.
Quiet mode. Only print summary reports (requires the –R option). All interval reports are omitted.
Specify resource types on which to report. The available resources are: physical-memory, virtual-memory, locked-memory, processor-set, processes, lwps, shm-memory , shm-ids, sem-ids, msg-ids, lofi, and network.
A summary of cpu, physical-memory, virtual memory, and network usage.
physical-memory, virtual-memory, and locked-memory.
The default pset only.
processes, lwps, lofi.
shm-memory, shm-ids, sem-ids msg-ids.
All resource types.
By default the summary resource is printed.
In addition to a comma-separated list, multiple -r options can be specified to report on a set of resources types.
The system's cpus can be partitioned into processor sets (psets). By default, all cpus are in a single pset named pset_default.
Memory is not partition-able into sets. The zonestat utility output for these resources shows them as named mem_default and vm_default.
The all resource specifies that all resource types should be reported.
Print a summary report. The supported report types are described below. In addition to a comma-separated list, multiple -R options can be specified for a set of summary reports.
Prints a summary report detailing the following for each resource:
Total cpu used since start of command invocation. The percent used for each zone includes time that a zone was not running. For instance, if a zone used 100% of the cpu while it was running, but the zone was halted for half of the intervals, then the summary report shows the zone used 50% of the cpu time.
Average resource used of all intervals reported since command invocation. This average factors in intervals in which a zone was not running. For example if a zone used on average of 100M of physical memory while it was running, and was only running for half the intervals, then the summary report shows that the zone used 50M of physical memory on average.
Sum of all bytes that are transmitted and received by all datalink utilizing physical bandwidth. The sum is calculated since start of command invocation and is normalized to number of bytes per second. The percentage used is based on total available bandwidth.
Similar to total, but only intervals in which a zone is running are factored in. For example, if a zone was only running for a single interval, and during that interval, the zone used 200M of virtual memory, then it's average virtual-memory is 200M, regardless of the number of intervals reported before the summary report.
Print a summary report detailing the highest usage of each resource and zone during any interval of the zonestat utility invocation.
Sort zones utilizing each resource.
The following sorting columns can be specified:
Sort alpha-numerically by zone name.
Sort by quantity of resource used. For networking resource, this is same as sort by bytes.
This is the default.
Sort by configured cap.
Sort by percent of cap used.
Sort by allocated share.
Sort by percent of share used.
Sort networking by total bytes transmitted and received.
Sort networking by percentage of received bytes over the wire.
Sort networking by percentage of transmitted bytes over the wire.
Sort networking by percentage of bandwidth used.
Sort by cpu usage in the summary, This is the default.
Sort by physical memory usage in the summary.
Sort by virtual memory usage in the summary.
Sort by network usage in the summary.
Sort by network usage in the summary.
Include timestamp of each report. The following formats are supported:
Display an extended view with more detailed information. For example, when used with network resource, the extended view list details of each virtual datalink.
Specify a list of zones on which to report. By default all zones are reported.
In addition to a comma-separated list, multiple -z options can be specified to report on a set of zones. The output includes any resources which have usage by the specified zones.
The following operands are supported:
Specifies the length in seconds to pause between each interval report. An interval of default uses the configured interval of the zones monitoring service. See zonestatd(1M) .
interval is required. An interval of zero is not permitted. interval can be specified as [nh][nm][n s], such as 10s or 1m.
Specifies the number of intervals to report. Defaults to infinity if not specified. The command duration is (interval * duration). A duration of zero is invalid. A value of inf can also be specified to explicitly choose infinity.
Duration can also be specified as [nh][nm][ns]. In this case, duration is interpreted as the duration of execution time. The actual duration is rounded up to the nearest multiple of the interval.
Specify the summary report period. For instance, a report of 4 produces reports every 4 intervals. If the command duration is not a multiple of report, then the last report is of any remaining intervals.
report can also be specified as [nh][nm][ns]. In this case, reports are output at the specified time period, rounded up to the nearest interval. If the command duration is not a multiple of report, then the last report is of any remaining intervals.
Requires –R. If –R is specified and report is not, the report period is the entire command duration, producing the specified reports at the end of execution.
The following list defines the column heading of the command output:
The total amount of memory available on the physical host.
The maximum amount of resource available on the physical host.
The number of cpus allocated to a processor set
Of the cpus allocated to a processor set, the number of cpus which can execute processes.
The minimum and maximum number of cpus which can be allocated to the processor set by the system.
The zone using the resource. In addition to zone names, this column can also contain:
The total quantity of resource used system-wide.
The quantity of resource used by the kernel or in a manner not associated with any particular zone.
When zonestat is used within a non-global zone, [system] designates the aggregate resource used by the system and by all other zones.
For network resources, system usage of network is not available.
The amount of resource used.
The amount of resource used as a percent of the total resource.
The amount of resource used as a percent of the total resource.
The amount of cpu used as a percentage of the total cpu in a processor-set to which the zone is bound. A zone can only have processes bound to multiple processor sets if it is the global zone, or if psrset(1M) psets are used. If multiple binding are found for a zone, it's %PART is the fraction used of all bound psets. For [total] and [system], %PART is the percent used of all cpus on the system.
If a zone is configured to have a cap on the given resource, the cap is displayed in this column.
The amount of resource used as a percent of zone's configured cap.
The number of shares allocated to the zone. For the [total] row, this is the total number of shares allocated to all zones sharing the resource. If a zone is not configured to use shares, and is sharing a resource with other zones that are configured to use shares, this column contains no-fss for the zone.
The fraction of the total shares allocated to the zone. For instance, if 2 zones share a processor set, each with 10 shares, then each zone has a %SHR of 50%.
Of the share allocated to the zone, the fraction of resource 100%. Because shares are only enforced when there is resource contention, it is possible for a zone to have a %SHRU in excess of 100%.
The number of bytes transmitted and received by datalinks or virtual links.
The number of received bytes that consumes physical bandwidth.
The number of transmitted bytes that consumes physical bandwidth.
The percentage of available physical bandwidth used to receive PRBYTE.
The percentage of available physical bandwidth used to transmit POBYTE.
The sum of PRBYTE and POBYTE as a percent of the total available physical bandwidth.
The name of a datalink.
The maximum bandwidth configured on a datalink.
The sum of all transmitted and received bytes as a percentage of configured maximum bandwidth.
The following command shows a summary of cpu and memory utilization every 5 seconds:
# zonestat 5 1 SUMMARY Cpus/Online: 4/4 Physical: 8063M Virtual: 11.8G ---CPU--- --PHYSMEM-- ---VMEM--- ---NET--- ZONE USED %PART USED %USED USED %USED PBYTE %PUSE [total] 0.23 5.76% 3211M 39.8% 4191M 34.6% 350M 18.7% - [system] 0.03 0.83% 2791M 34.6% 3890M 32.1% - - global 0.19 4.86% 324M 4.01% 228M 1.89% 200M 10.7% zoneA 0.00 0.03% 47.9M 0.59% 36.3M 0.30% 100M 5.3% zoneB 0.00 0.02% 48.1M 0.59% 36.4M 0.30% 50M 2.7%Example 2 Using zonestat to Produce Parseable Output
The following command produces parseable output. It prints one line per zone using each pset resource for a 5 second interval:
# zonestat -p -P zones -r psets 5 1Example 3 Using zonestat to Report on the Default pset
The following command reports on the default pset once a second for one minute:
# zonestat -r default-pset 1 1mExample 4 Using zonestat to Report Total and High Utilization
The following command monitors silently at a 10 second interval for 24 hours, producing a total and high report every 1 hour:
# zonestat -q -R total,high 10s 24h 1hExample 5 Using zonestat to Report Datalink Utilization
The following command reports on a datalink named e1000g0 at a 5 second interval for 5 times:
# zonestat -r network -n e1000g0 5 5
The following exit values are returned:
An error occurred.
svc:system/zones_monitoring: default not running or not responding.
See attributes(5) for descriptions of the following attributes:
Command invocation and parseable output is Committed. Human readable output (default output) is Uncommitted.
date(1), prctl(1), pooladm (1M) , poolcfg (1M) , psrset (1M) , rcapadm (1M) , zoneadm (1M) , zonecfg (1M) , zonestatd (1M) , time (2) , timezone (4) , attributes (5) , privileges (5) , resource_controls (5) , solaris-kz (5)
The zonestat utility depends on the zones monitoring service: svc/system/zonestat:default. If the zonestat service is stopped while the zonestat utility is running, the zonestat command invocation quits without printing additional reports. The reports (–R) is printed if zonestat is interrupted (by CTRL/c, SIGINT) before reaching the next report period.