--- old/usr/src/man/man1/Makefile	Wed Apr  3 12:36:04 2019
+++ new/usr/src/man/man1/Makefile	Wed Apr  3 12:36:04 2019
@@ -13,6 +13,7 @@
 # Copyright 2011, Richard Lowe
 # Copyright 2018 Nexenta Systems, Inc.
 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 
 include		$(SRC)/Makefile.master
@@ -419,7 +420,8 @@
 		yppasswd.1			\
 		ypwhich.1			\
 		zlogin.1			\
-		zonename.1
+		zonename.1			\
+		zonestat.1
 
 MANLINKS=	batch.1		\
 		bg.1		\
--- /dev/null	Wed Apr  3 12:36:04 2019
+++ new/usr/src/man/man1/zonestat.1	Wed Apr  3 12:36:04 2019
@@ -0,0 +1,484 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source.  A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\" Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+.\" Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+.\"
+.Dd April 04, 2019
+.Dt zonestat 1
+.Os
+.Sh NAME
+.Nm zonestat
+.Nd report active zone statistics.
+.Sh SYNOPSIS
+.Nm
+.Op Fl z Ar zonelist
+.Op Fl r Ar reslist
+.Op Fl n Ar namelist
+.Op Fl T Ar u Ns | Ns Ar d Ns | Ns Ar i
+.Op Fl R Ar reports
+.Op Fl q
+.Op Fl p Oo Fl P Ar lines Oc
+.Op Fl S Ar cols
+.Ar interval
+.Oo Ar duration
+.Oo Ar report
+.Oc Oc
+.Sh DESCRIPTION
+The
+.Nm
+utility reports on the cpu, memory, 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.
+.Pp
+The
+.Nm
+utility prints a series of interval reports at the specified interval.
+It optionally also prints one or more summary reports at a specified interval.
+.Pp
+The default output is a summary of cpu, physical, and virtual memory
+utilization.
+The -r option can be used to choose detailed output for specific resources.
+.Pp
+The following options are supported:
+.Bl -tag -width Ds
+.It Fl z Ar zonename Ns Oo Ar ,zonename Oc
+Specify a list of zones on which to report.
+By default all zones are reported.
+In addition to a comma-separated list, multiple
+.Fl z
+options can be specified to report on a set of zones.
+The output will include any resources which have usage by the specified zone(s).
+.It Fl r Ar resource Ns Oo Ar ,resource Oc
+Specify resource types on which to report.
+The available resources are:
+.Bd -ragged -offset indent
+.Em physical-memory ,
+.Em virtual-memory ,
+.Em locked-memory ,
+.Em processor-sets ,
+.Em processes ,
+.Em lwps ,
+.Em shm-memory ,
+.Em shm-ids ,
+.Em sem-ids ,
+.Em msg-ids ,
+.Em lofi
+.Ed
+.Pp
+The following nicknames can also be specified as resource names:
+.Bl -tag -width indent
+.It Em summary
+A summary of cpu, physical-memory, and virtual memory usage.
+.It Em memory
+physical-memory, virtual-memory, and locked memory.
+.It Em psets
+processor-sets
+.It Em default-pset
+The default pset only.
+.It Em limits
+processes, lwps, lofi
+.It Em sysv
+shm-memory, shm-ids, sem-ids msg-ids
+.It Em all
+all resource types.
+.El
+.Pp
+By default the summary resource is printed.
+.Pp
+In addition to a comma-separated list, multiple
+.Fl r
+options can be specified to report on a set of resources types.
+.Pp
+The system's cpus can be partitioned into processor sets
+(psets)  By default, all cpus are in a single pset named
+.Em pset_default .
+.Pp
+Memory is not partition-able into sets.
+The zonestat utility output for these resources will show them as named
+.Em mem_default
+and
+.Em vm_default .
+.Pp
+The
+.Em all
+resource specifies that all resource types should be reported.
+.It Fl n Ar name Ns Oo Ar ,name Oc
+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
+.Em mem_default
+and
+.Em vm_default .
+.Pp
+Dedicated-cpu processor sets can be specified by their pset
+name, or by just their zonename.
+.Pp
+Processor sets created by psrset can be specified by their pool
+pset name, or just by their psetid.
+.Pp
+In addition to a comma-separated list, multiple
+.Fl n
+options can be specified to report on a set of resources.
+.It Fl T Ar u Ns | Ns Ar d Ns | Ns Ar i
+Include timestamp of each report.
+The following formats are supported:
+.Bl -tag -width indent
+.It u
+A printed representation of the internal representation of time;
+see
+.Xr time 2 .
+This is also known as unix time.
+.It d
+Standard date format; see
+.Xr date 1 .
+This option is not valid with
+.Fl p .
+.It i
+Time formatted as the ISO 8601 compliant format:
+.D1     YYYYMMDDThhmmssZ
+.El
+.It Fl R Ar report Ns Oo Ar ,report Oc
+Print a summary report.
+The supported report types are described below.
+In addition to a comma-separated list, multiple
+.Fl R
+options may be specified for a set of summary reports.
+.Bl -tag -width indent
+.It total
+Prints a summary report detailing the following for each resource:
+.Bl -tag -width indent
+.It psets
+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 will show the
+zone used 50% of the cpu time.
+.It memory, limits, sysv
+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
+will show that the zone used 50M of physical memory on average.
+.El
+.It average
+Similar to
+.Em 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 its average
+virtual-memory will be 200M, regardless of the number of intervals reported
+before the summary report.
+.It high
+Print a summary report detailing the highest usage of each resource and zone
+during any interval of the zonestat utility invocation.
+.El
+.It Fl S Ar col Ns Oo Ar ,col Oc
+Sort zones utilizing each resource.
+The following sorting columns can be specified.
+.Bl -tag -width indent
+.It name
+Sort alphanumerically by zone name.
+.It used
+Sort by quantity of resource used.
+.It cap
+Sort by configured cap.
+.It pcap
+Sort by percent of cap used.
+.It shr
+Sort by allocated share.
+.It pshru
+Sort by percent of share used.
+.El
+.Pp
+By default, output is sorted by quantity of resource used.
+.It Fl q
+Only print summary reports (requires
+.Fl R ) .
+All interval reports are omitted.
+.It Fl p
+Print output in stable, machine-parsable format.
+Individual fields will be delimited with :.
+The line format is:
+.Pp
+.D1    <report type>:<resource>:<field>[:<field>]*
+.Pp
+If
+.Fl T
+is specified each line is prefixed with a timestamp:
+.Pp
+.D1    <timestamp>:<report type>:<resource>:<field>[:<field>]*
+.Pp
+The report types are:
+.Bd -ragged -offset indent
+.Em report-total ,
+.Em report-average ,
+.Em report-high ,
+.Em interval
+.Ed
+.Pp
+The resource types are:
+.Bd -ragged -offset indent
+.Em header ,
+.Em footer ,
+.Em summary ,
+.Em physical-memory ,
+.Em virtual-memory ,
+.Em locked-memory ,
+.Em processor-set ,
+.Em processes ,
+.Em lwps ,
+.Em sysv-shared-memory ,
+.Em sysv-shmids ,
+.Em sysv-semids ,
+.Em sysv-msgids ,
+.Em lofi
+.Ed
+.Pp
+The
+.Em 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.
+.Pp
+The remaining fields are resource type specific.
+See the zonestat utility output for details.
+.Pp
+All existing output fields are stable.
+Future versions may introduce new report and resource types.
+Future versions may also add additional new fields to the end of existing
+output lines.
+.It Fl P Ar line Ns Oo Ar ,line Oc
+For parsable output, specify lines to output in parsable output.
+One or more of the following line types can be chosen:
+.Bl -tag -width indent
+.It resource
+The lines describing each resource.
+.It total
+The total utilization of each resource.
+.It system
+The utilization of each resource by the system.
+This includes the kernel, and any resource consumption not contributable to a
+specific zone.
+When zonestat is run from within a non-global-zone, this value will be the
+aggregate resource consumed by the system and all other zones.
+.It zones
+Lines detailing the per-zone utilization of each resource.
+.It header, footer
+Each interval and summary report has a header, which prints details such
+as the interval and count information.
+After each report, any footer is also printed
+.El
+.El
+.Ss OPERANDS
+.Bl -tag -width indent
+.It interval
+Specifies the length in seconds to pause between each interval report.
+An interval of
+.Em default
+will use the configured interval of the zones
+monitoring service (see
+.Xr zonestatd 1m .)
+.Pp
+Interval is required.
+An interval of zero is not permitted.
+The interval can be specified as [nh][nm][ns], such as 10s or 1m.
+.It duration
+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
+.Em inf
+can also be specified to explicitly choose infinity.
+.Pp
+Duration can also be specified as [nh][nm][ns].
+In this case, duration will be interpreted as the duration of execution time.
+The actual duration will be rounded up to the nearest multiple of the interval.
+.It report
+Specify the summary report period.
+For instance, a report of 4 would produce reports every 4 intervals.
+If the command duration is not a multiple of report, then the last report will
+be of any remaining intervals.
+.Pp
+Report can also be specified as [nh][nm][ns].
+In this case, reports will be 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 will
+be of any remaining intervals.
+.Pp
+Requires
+.Fl R .
+If
+.Fl R
+is specified and report is not, the report period will be the entire command
+duration, producing the specified reports at the end of execution.
+.El
+.Ss OUTPUT
+The following list defines the column heading of the command output:
+.Bl -tag -width indent
+.It SYSTEM-MEMORY
+The total amount of memory available on the physical host.
+.It SYSTEM-LIMIT
+The maximum amount of resource available on the physical host.
+.It CPUS
+The number of cpus allocated to a processor set.
+.It ONLINE
+Of the cpus allocated to a processor set, the number of cpus
+which can execute processes.
+.It MIN/MAX
+The minimum and maximum number of cpus which may be allocated
+to the processor set by the system.
+.It ZONE
+The zone using the resource.
+In addition to zone names, this column may also contain:
+.Bl -tag -width indent
+.It [total]
+The total quantity of resource used system-wide.
+.It [system]
+The quantity of resource used by the kernel or in a manner not associated with
+any particular zone.
+.Pp
+When zonestat is used within a non-global zone, [system] designates the
+aggregate resource used by the system and by all other zones.
+.El
+.It USED
+The amount of resource used.
+.It PCT
+The amount of resource used as a percent of the total resource.
+.It %PART
+The amount of cpu uses 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, its %PART will be the fraction used
+of all bound psets.
+For [total] and [system], %PART is the percent used of all cpus on the system.
+.It CAP
+If a zone is configured to have a cap on the given resource, the cap will be
+displayed in this column.
+.It %CAP
+The amount of resource used as a percent of zone's configured cap.
+.It SHRS
+The number of shares allocated to the zone.
+For the [total] row, this will be the total number of shares allocated to all
+zones sharing the resource.
+.Pp
+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 will contain
+.Em no-fss
+for the zone.
+.It %SHR
+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 will have a %SHR of 50%.
+.It %SHRU
+Of the share allocated to the zone, the fraction of resource
+used.
+Zones using all of their share will have a %SHRU of 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%.
+.El
+.Sh IMPLEMENTATION NOTES
+The zonestat utility depends on the zones monitoring service:
+.Pp
+.D1 svc/system/zonestat:default
+.Pp
+If the zonestat service is stopped while the zonestat utility is running, the
+zonestat command invocation will quit without printing additional reports.
+.Pp
+The reports will be printed if zonestat is interrupted (by ctrl-c, SIGINT)
+before reaching the next report period.
+.Sh EXIT STATUS
+.Ex -std
+.Bl -tag -width indent
+.It 0
+Successful completion.
+.It 1
+An error occurred.
+.It 2
+Invalid usage.
+.It 3
+svc:system/zones_monitoring:default not running or not responding.
+.El
+.Sh EXAMPLES
+Example 1:  Summary of cpu and memory utilization every 5 seconds.
+.Bd -literal
+       # zonestat 5 1
+       SUMMARY
+		-----CPU------------- ----PHYSICAL--- ----VIRTUAL----
+	   ZONE USED %PART %CAP %SHRU USED  PCT  %CAP  USED  PCT %CAP
+	[total] 9.74   30%    -     - 7140M  21%    - 10.6G  22%    -
+       [system] 0.28  0.8%    -     - 6535M  19%    - 10.4G  21%    -
+	 global 9.10   28%    -     -  272M 0.8%    -  366M 0.7%    -
+	  zoneA 0.32  1.0%    -     -  256M 0.7%    -  265M 0.5%    -
+	  zoneB 0.00  0.0%    -     - 77.6M 0.2%    - 71.1M 0.1%    -
+.Ed
+.Pp
+Example 2:  Using parsable output, fetching only zone usages.
+.Pp
+The following command will produce parsable output, printing one
+line per zone using each pset resource for a 5 second interval.
+.Bd -literal
+
+       # zonestat -p -P zones -r psets 5 1
+
+.Ed
+.Pp
+Example 3:  Report on the default pset.
+.Pp
+The following command will report on the default pset once a second
+for one minute.
+.Bd -literal
+
+       # zonestat -r default-pset 1 1m
+
+.Ed
+.Pp
+Example 4:  Report total and high utilization.
+.Pp
+The following command monitors silently at a 10 second interval
+for 24 hours, producing a total and high report every 1 hour.
+.Bd -literal
+
+       # zonestat -q -R total,high 10s 24h 1h
+
+.Ed
+.Sh INTERFACE STABILITY
+Command invocation and parsable output is Committed.
+Human readable output (default output) is uncommitted.
+.Sh SECURITY
+When run from within a non-global zone (NGZ), only processor sets
+visible to the NGZ are reported.
+The NGZ output will include all of other system resources, such as memory and
+limits.
+.Pp
+For all reported resources, the NGZ's usage will be output.
+Usage of each resource by the system, global zone, and all other
+zones, will be reported as used by
+.Em system .
+.Sh SEE ALSO
+.Xr date 1 ,
+.Xr pooladm 1m ,
+.Xr poolcfg 1m ,
+.Xr prctl 1m ,
+.Xr rcapadm 1m ,
+.Xr zoneadm 1m ,
+.Xr zonecfg 1m ,
+.Xr zonestatd 1m ,
+.Xr libzonestat 3lib ,
+.Xr timezone 4 ,
+.Xr privileges 5 ,
+.Xr resource_controls 5 ,
+.Xr zones 5
--- old/usr/src/man/man1m/Makefile	Wed Apr  3 12:36:05 2019
+++ new/usr/src/man/man1m/Makefile	Wed Apr  3 12:36:05 2019
@@ -17,6 +17,7 @@
 # Copyright 2016 Toomas Soome <tsoome@me.com>
 # Copyright 2018 Nexenta Systems, Inc.
 # Copyright (c) 2017, Chris Fraire <cfraire@me.com>.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 
 include		$(SRC)//Makefile.master
@@ -534,6 +535,7 @@
 		zoneadm.1m		\
 		zoneadmd.1m		\
 		zonecfg.1m		\
+		zonestatd.1m		\
 		zpool.1m		\
 		zstreamdump.1m		\
 		ztest.1m
--- /dev/null	Wed Apr  3 12:36:05 2019
+++ new/usr/src/man/man1m/zonestatd.1m	Wed Apr  3 12:36:05 2019
@@ -0,0 +1,89 @@
+.\"
+.\" This file and its contents are supplied under the terms of the
+.\" Common Development and Distribution License ("CDDL"), version 1.0.
+.\" You may only use this file in accordance with the terms of version
+.\" 1.0 of the CDDL.
+.\"
+.\" A full copy of the text of the CDDL should have accompanied this
+.\" source.  A copy of the CDDL is also available via the Internet at
+.\" http://www.illumos.org/license/CDDL.
+.\"
+.\" Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+.\" Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+.\"
+.Dd April 04, 2019
+.Dt zonestatd 1M
+.Os
+.Sh NAME
+.Nm zonestatd
+.Nd zones monitoring daemon
+.Sh SYNOPSIS
+.Nm /usr/lib/zones/zonestatd
+.Sh DESCRIPTION
+.Nm
+is a system daemon that is started during system boot.
+It monitors the utilization of system resources by zones, as well
+as zone and system configuration information such as psrset psets,
+pool psets, and resource control settings.
+.Pp
+This daemon is started automatically by the zone management
+software and should not be invoked directly.
+It does not constitute a programming interface, but is classified as a
+private interface.
+.Sh IMPLEMENTATION NOTES
+The zonestat service is managed by the service management
+facility,
+.Xr smf 5 ,
+under the service identifier:
+.Pp
+.D1 svc:/system/zones-monitoring:default
+.Pp
+Administrative actions on this service, such as enabling, disabling, or
+requesting restart, can be performed using svcadm(1M).
+The service's status can be queried using the
+.Xr svcs 1
+command.
+.Pp
+The zonestat service has the following SMF configuration property:
+.Bd -ragged -offset indent
+config/sample_interval
+.Pp
+This property sets the
+.Nm
+sample interval.
+This is the interval used by the zones monitoring daemon,
+.Nm
+to sample resource utilization.
+This is also the interval used to determine configuration changes such as
+processor set changes, resource control changes, and zone state changes.
+.Pp
+The default interval is 5 seconds.
+.Ed
+.Pp
+The zonestat service makes use of extended accounting facility.
+If not already enabled, it enables the tracking of process accounting
+resources, and configures a process accounting file.
+The zonestat service will roll the process accounting log at its configured
+interval.
+.Pp
+If extended process accounting is enabled externally, the zonestat
+service will use the process accounting log as configured.
+It will not roll the accounting log, but will operate correctly if
+the accounting log is rolled externally.
+.Sh INTERFACE STABILITY
+.Sy Private
+.Sh SECURITY
+The zonestat service in the global zone must be online for the zonestat
+service in each non-global zone (NGZ) to function properly.
+The zonestat service in each NGZ does not directly read system configuration
+and utilization data, but rather reads from the zonestat service on the
+global zone.
+.Sh SEE ALSO
+.Xr zonestat 1 ,
+.Xr acctadm 1m ,
+.Xr pooladm 1m ,
+.Xr poolcfg 1m ,
+.Xr prctl 1m ,
+.Xr rcapadm 1m ,
+.Xr smf 5 ,
+.Xr zones 5
--- old/usr/src/pkg/manifests/system-zones.mf	Wed Apr  3 12:36:05 2019
+++ new/usr/src/pkg/manifests/system-zones.mf	Wed Apr  3 12:36:05 2019
@@ -21,6 +21,7 @@
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
 #
 
 set name=pkg.fmri value=pkg:/system/zones@$(PKGVERS)
@@ -96,9 +97,11 @@
 file path=usr/share/lib/xml/dtd/zone_platform.dtd.1 mode=0644
 file path=usr/share/lib/xml/dtd/zonecfg.dtd.1
 file path=usr/share/man/man1/zlogin.1
+file path=usr/share/man/man1/zonestat.1
 file path=usr/share/man/man1m/zoneadm.1m
 file path=usr/share/man/man1m/zoneadmd.1m
 file path=usr/share/man/man1m/zonecfg.1m
+file path=usr/share/man/man1m/zonestatd.1m
 file path=usr/share/man/man5/brands.5
 file path=usr/share/man/man5/zones.5
 file path=usr/share/man/man7d/zcons.7d
