zpool-set

title: zpool-set(8)

text:
# zpool-set(8)

## NAME
zpool-get — retrieve properties of ZFS storage pools

## SYNOPSIS
zpool

get [-Hp] [-j [--json-int, --json-pool-key-guid]] [-o field[,field]…] all|property[,property]… [pool]…

zpool

get [-Hp] [-j [--json-int]] [-o field[,field]…] all|property[,property]… pool [all-vdevs|vdev]…

zpool

set property=value pool

zpool

set property=value pool vdev

## DESCRIPTION
zpool get [-Hp] [-j [--json-int, --json-pool-key-guid]] [-o field[,field]…] all|property[,property]… [pool]…

Retrieves the given list of properties (or all properties if all is used) for the specified storage pool(s). These properties are displayed with the following fields: name

Name of storage pool.

property

Property name.

value

Property value.

source

Property source, either default or local.

See the zpoolprops(7) manual page for more information on the available pool properties.

-j, --json [--json-int, --json-pool-key-guid]

Display the list of properties in JSON format. Specify --json-int to display the numbers in integer format instead of strings in JSON output. Specify --json-pool-key-guid to set pool GUID as key for pool objects instead of pool name.

-H

Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.

-o field

A comma-separated list of columns to display, defaults to name,property,value,source.

-p

Display numbers in parsable (exact) values.

zpool get [-j [--json-int]] [-Hp] [-o field[,field]…] all|property[,property]… pool [all-vdevs|vdev]…

Retrieves the given list of properties (or all properties if all is used) for the specified vdevs (or all vdevs if all-vdevs is used) in the specified pool. These properties are displayed with the following fields: name

Name of vdev.

property

Property name.

value

Property value.

source

Property source, either default or local.

See the vdevprops(7) manual page for more information on the available pool properties.

-j, --json [--json-int]

Display the list of properties in JSON format. Specify --json-int to display the numbers in integer format instead of strings in JSON output.

-H

Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.

-o field

A comma-separated list of columns to display, defaults to name,property,value,source.

-p

Display numbers in parsable (exact) values.

zpool set property=value pool

Sets the given property on the specified pool. See the zpoolprops(7) manual page for more information on what properties can be set and acceptable values.

zpool set property=value pool vdev

Sets the given property on the specified vdev in the specified pool. See the vdevprops(7) manual page for more information on what properties can be set and acceptable values.

## SEE ALSO
vdevprops(7), zpool-features(7), zpoolprops(7), zpool-list(8)


zpool-split

package: zfs-utils

title: zpool-split(8)

text:
# zpool-split(8)

## NAME
zpool-split — split devices off ZFS storage pool, creating new pool

## SYNOPSIS
zpool

split [-gLlnP] [-o property=value]… [-R root] pool newpool [device]…

## DESCRIPTION
Splits devices off pool creating newpool. All vdevs in pool must be mirrors and the pool must not be in the process of resilvering. At the time of the split, newpool will be a replica of pool. By default, the last device in each mirror is split from pool to create newpool.

The optional device specification causes the specified device(s) to be included in the new pool and, should any devices remain unspecified, the last device in each mirror is used as would be by default.

-g

Display vdev GUIDs instead of the normal device names. These GUIDs can be used in place of device names for the zpool detach/offline/remove/replace commands.

-L

Display real paths for vdevs resolving all symbolic links. This can be used to look up the current block device name regardless of the /dev/disk/ path used to open it.

-l

Indicates that this command will request encryption keys for all encrypted datasets it attempts to mount as it is bringing the new pool online. Note that if any datasets have keylocation=prompt, this command will block waiting for the keys to be entered. Without this flag, encrypted datasets will be left unavailable until the keys are loaded.

-n

Do a dry-run ("No-op") split: do not actually perform it. Print out the expected configuration of newpool.

-P

Display full paths for vdevs instead of only the last component of the path. This can be used in conjunction with the -L flag.

-o property=value

Sets the specified property for newpool. See the zpoolprops(7) manual page for more information on the available pool properties.

-R root

Set altroot for newpool to root and automatically import it.

## SEE ALSO
zpool-import(8), zpool-list(8), zpool-remove(8)

branch: sisyphus


zpool-status

title: zpool-status(8)

text:
# zpool-status(8)

## NAME
zpool-status — show detailed health status for ZFS storage pools

## SYNOPSIS
zpool

status [-DdegiLPpstvx] [-c script1[,script2,…]] [-j|--json [--json-flat-vdevs] [--json-int] [--json-pool-key-guid]] [-T d|u] [--power] [pool] [interval [count]]

## DESCRIPTION
Displays the detailed health status for the given pools. If no pool is specified, then the status of each pool in the system is displayed. For more information on pool and device health, see the Device Failure and Recovery section of zpoolconcepts(7).

If a scrub or resilver is in progress, this command reports the percentage done and the estimated time to completion. Both of these are only approximate, because the amount of data in the pool and the other workloads on the system can change.

-c script1[,script2,…]

Run a script (or scripts) on each vdev and include the output as a new column in the zpool status output. See the -c option of zpool iostat for complete details.

-D

Display a histogram of deduplication statistics, showing the allocated (physically present on disk) and referenced (logically referenced in the pool) block counts and sizes by reference count. If repeated, (-DD), also shows statistics on how much of the DDT is resident in the ARC.

-d

Display the number of Direct I/O read/write checksum verify errors that have occurred on a top-level VDEV. See zfs_vdev_direct_write_verify in zfs(4) for details about the conditions that can cause Direct I/O write checksum verify failures to occur. Direct I/O reads checksum verify errors can also occur if the contents of the buffer are being manipulated after the I/O has been issued and is in flight. In the case of Direct I/O read checksum verify errors, the I/O will be reissued through the ARC.

-e

Only show unhealthy vdevs (not-ONLINE or with errors).

-g

Display vdev GUIDs instead of the normal device names These GUIDs can be used in place of device names for the zpool detach/offline/remove/replace commands.

-i

Display vdev initialization status.

-j, --json [--json-flat-vdevs] [--json-int] [--json-pool-key-guid]

Display the status for ZFS pools in JSON format. Specify --json-flat-vdevs to display vdevs in flat hierarchy instead of nested vdev objects. Specify --json-int to display numbers in integer format instead of strings. Specify --json-pool-key-guid to set pool GUID as key for pool objects instead of pool names.

-L

Display real paths for vdevs resolving all symbolic links. This can be used to look up the current block device name regardless of the /dev/disk/ path used to open it.

-P

Display full paths for vdevs instead of only the last component of the path. This can be used in conjunction with the -L flag.

-p

Display numbers in parsable (exact) values.

--power

Display vdev enclosure slot power status (on or off).

-s

Display the number of leaf vdev slow I/O operations. This is the number of I/O operations that didn't complete in zio_slow_io_ms milliseconds (30000 by default). This does not necessarily mean the I/O operations failed to complete, just took an unreasonably long amount of time. This may indicate a problem with the underlying storage.

-T d|u

Display a time stamp. Specify d for standard date format. See date(1). Specify u for a printed representation of the internal representation of time. See time(1).

-t

Display vdev TRIM status.

-v

Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub. If the head_errlog feature is enabled and files containing errors have been removed then the respective filenames will not be reported in subsequent runs of this command.

-x

Only display status for pools that are exhibiting errors or are otherwise unavailable. Warnings about pools not using the latest on-disk format will not be included.

## EXAMPLES

### Example 1: Adding output columns
Additional columns can be added to the zpool status and zpool iostat output with -c.

```
# zpool status -c vendor,model,size
   NAME     STATE  READ WRITE CKSUM vendor  model        size
   tank     ONLINE 0    0     0
   mirror-0 ONLINE 0    0     0
   U1       ONLINE 0    0     0     SEAGATE ST8000NM0075 7.3T
   U10      ONLINE 0    0     0     SEAGATE ST8000NM0075 7.3T
   U11      ONLINE 0    0     0     SEAGATE ST8000NM0075 7.3T
   U12      ONLINE 0    0     0     SEAGATE ST8000NM0075 7.3T
   U13      ONLINE 0    0     0     SEAGATE ST8000NM0075 7.3T
   U14      ONLINE 0    0     0     SEAGATE ST8000NM0075 7.3T

# zpool iostat -vc size
              capacity     operations     bandwidth
pool        alloc   free   read  write   read  write  size
----------  -----  -----  -----  -----  -----  -----  ----
rpool       14.6G  54.9G      4     55   250K  2.69M
  sda1      14.6G  54.9G      4     55   250K  2.69M   70G
----------  -----  -----  -----  -----  -----  -----  ----
```

### Example 2: Display the status output in JSON format
zpool status can output in JSON format if -j is specified. -c can be used to run a script on each VDEV.

```
# zpool status -j -c vendor,model,size | jq
{
  "output_version": {
    "command": "zpool status",
    "vers_major": 0,
    "vers_minor": 1
  },
  "pools": {
    "tank": {
      "name": "tank",
      "state": "ONLINE",
      "guid": "3920273586464696295",
      "txg": "16597",
      "spa_version": "5000",
      "zpl_version": "5",
      "status": "OK",
      "vdevs": {
        "tank": {
          "name": "tank",
          "alloc_space": "62.6G",
          "total_space": "15.0T",
          "def_space": "11.3T",
          "read_errors": "0",
          "write_errors": "0",
          "checksum_errors": "0",
          "vdevs": {
            "raidz1-0": {
              "name": "raidz1-0",
              "vdev_type": "raidz",
              "guid": "763132626387621737",
              "state": "HEALTHY",
              "alloc_space": "62.5G",
              "total_space": "10.9T",
              "def_space": "7.26T",
              "rep_dev_size": "10.9T",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "vdevs": {
                "ca1eb824-c371-491d-ac13-37637e35c683": {
                  "name": "ca1eb824-c371-491d-ac13-37637e35c683",
                  "vdev_type": "disk",
                  "guid": "12841765308123764671",
                  "path": "/dev/disk/by-partuuid/ca1eb824-c371-491d-ac13-37637e35c683",
                  "state": "HEALTHY",
                  "rep_dev_size": "3.64T",
                  "phys_space": "3.64T",
                  "read_errors": "0",
                  "write_errors": "0",
                  "checksum_errors": "0",
                  "vendor": "ATA",
                  "model": "WDC WD40EFZX-68AWUN0",
                  "size": "3.6T"
                },
                "97cd98fb-8fb8-4ac4-bc84-bd8950a7ace7": {
                  "name": "97cd98fb-8fb8-4ac4-bc84-bd8950a7ace7",
                  "vdev_type": "disk",
                  "guid": "1527839927278881561",
                  "path": "/dev/disk/by-partuuid/97cd98fb-8fb8-4ac4-bc84-bd8950a7ace7",
                  "state": "HEALTHY",
                  "rep_dev_size": "3.64T",
                  "phys_space": "3.64T",
                  "read_errors": "0",
                  "write_errors": "0",
                  "checksum_errors": "0",
                  "vendor": "ATA",
                  "model": "WDC WD40EFZX-68AWUN0",
                  "size": "3.6T"
                },
                "e9ddba5f-f948-4734-a472-cb8aa5f0ff65": {
                  "name": "e9ddba5f-f948-4734-a472-cb8aa5f0ff65",
                  "vdev_type": "disk",
                  "guid": "6982750226085199860",
                  "path": "/dev/disk/by-partuuid/e9ddba5f-f948-4734-a472-cb8aa5f0ff65",
                  "state": "HEALTHY",
                  "rep_dev_size": "3.64T",
                  "phys_space": "3.64T",
                  "read_errors": "0",
                  "write_errors": "0",
                  "checksum_errors": "0",
                  "vendor": "ATA",
                  "model": "WDC WD40EFZX-68AWUN0",
                  "size": "3.6T"
                }
              }
            }
          }
        }
      },
      "dedup": {
        "mirror-2": {
          "name": "mirror-2",
          "vdev_type": "mirror",
          "guid": "2227766268377771003",
          "state": "HEALTHY",
          "alloc_space": "89.1M",
          "total_space": "3.62T",
          "def_space": "3.62T",
          "rep_dev_size": "3.62T",
          "read_errors": "0",
          "write_errors": "0",
          "checksum_errors": "0",
          "vdevs": {
            "db017360-d8e9-4163-961b-144ca75293a3": {
              "name": "db017360-d8e9-4163-961b-144ca75293a3",
              "vdev_type": "disk",
              "guid": "17880913061695450307",
              "path": "/dev/disk/by-partuuid/db017360-d8e9-4163-961b-144ca75293a3",
              "state": "HEALTHY",
              "rep_dev_size": "3.63T",
              "phys_space": "3.64T",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "vendor": "ATA",
              "model": "WDC WD40EFZX-68AWUN0",
              "size": "3.6T"
            },
            "952c3baf-b08a-4a8c-b7fa-33a07af5fe6f": {
              "name": "952c3baf-b08a-4a8c-b7fa-33a07af5fe6f",
              "vdev_type": "disk",
              "guid": "10276374011610020557",
              "path": "/dev/disk/by-partuuid/952c3baf-b08a-4a8c-b7fa-33a07af5fe6f",
              "state": "HEALTHY",
              "rep_dev_size": "3.63T",
              "phys_space": "3.64T",
              "read_errors": "0",
              "write_errors": "0",
              "checksum_errors": "0",
              "vendor": "ATA",
              "model": "WDC WD40EFZX-68AWUN0",
              "size": "3.6T"
            }
          }
        }
      },
      "special": {
        "25d418f8-92bd-4327-b59f-7ef5d5f50d81": {
          "name": "25d418f8-92bd-4327-b59f-7ef5d5f50d81",
          "vdev_type": "disk",
          "guid": "3935742873387713123",
          "path": "/dev/disk/by-partuuid/25d418f8-92bd-4327-b59f-7ef5d5f50d81",
          "state": "HEALTHY",
          "alloc_space": "37.4M",
          "total_space": "444G",
          "def_space": "444G",
          "rep_dev_size": "444G",
          "phys_space": "447G",
          "read_errors": "0",
          "write_errors": "0",
          "checksum_errors": "0",
          "vendor": "ATA",
          "model": "Micron_5300_MTFDDAK480TDS",
          "size": "447.1G"
        }
      },
      "error_count": "0"
    }
  }
}
```

## SEE ALSO
zpool-events(8), zpool-history(8), zpool-iostat(8), zpool-list(8), zpool-resilver(8), zpool-scrub(8), zpool-wait(8)


zpool-sync

title: zpool-sync(8)

text:
# zpool-sync(8)

## NAME
zpool-sync — flush data to primary storage of ZFS storage pools

## SYNOPSIS
zpool

sync [pool]…

## DESCRIPTION
This command forces all in-core dirty data to be written to the primary pool storage and not the ZIL. It will also update administrative information including quota reporting. Without arguments, zpool sync will sync all pools on the system. Otherwise, it will sync only the specified pools.

## SEE ALSO
zpoolconcepts(7), zpool-export(8), zpool-iostat(8)


zpool-trim

title: zpool-trim(8)

text:
# zpool-trim(8)

## NAME
zpool-trim — initiate TRIM of free space in ZFS storage pool

## SYNOPSIS
zpool

trim [-dw] [-r rate] [-c|-s] -a|pool [device]…

## DESCRIPTION
Initiates an immediate on-demand TRIM operation for all of the free space in a pool. This operation informs the underlying storage devices of all blocks in the pool which are no longer allocated and allows thinly provisioned devices to reclaim the space.

A manual on-demand TRIM operation can be initiated irrespective of the autotrim pool property setting. See the documentation for the autotrim property above for the types of vdev devices which can be trimmed.

-a, --all

Perform TRIM operation on all pools.

-d, --secure

Causes a secure TRIM to be initiated. When performing a secure TRIM, the device guarantees that data stored on the trimmed blocks has been erased. This requires support from the device and is not supported by all SSDs.

-r, --rate rate

Controls the rate at which the TRIM operation progresses. Without this option TRIM is executed as quickly as possible. The rate, expressed in bytes per second, is applied on a per-vdev basis and may be set differently for each leaf vdev.

-c, --cancel

Cancel trimming on the specified devices, or all eligible devices if none are specified. If one or more target devices are invalid or are not currently being trimmed, the command will fail and no cancellation will occur on any device.

-s, --suspend

Suspend trimming on the specified devices, or all eligible devices if none are specified. If one or more target devices are invalid or are not currently being trimmed, the command will fail and no suspension will occur on any device. Trimming can then be resumed by running zpool trim with no flags on the relevant target devices.

-w, --wait

Wait until the devices are done being trimmed before returning.

## PERIODIC TRIM
On machines using systemd, trim timers can be enabled on a per-pool basis. weekly and monthly timer units are provided.

systemctl enable zfs-trim-weekly@rpool.timer --now

systemctl enable zfs-trim-monthly@otherpool.timer --now

## SEE ALSO
systemd.timer(5), zpoolprops(7), zpool-initialize(8), zpool-wait(8)


zpool-upgrade

title: zpool-upgrade(8)

text:
# zpool-upgrade(8)

## NAME
zpool-upgrade — manage version and feature flags of ZFS storage pools

## SYNOPSIS
zpool

upgrade

zpool

upgrade -v

zpool

upgrade [-V version] -a|pool…

## DESCRIPTION
zpool upgrade

Displays pools which do not have all supported features enabled and pools formatted using a legacy ZFS version number. These pools can continue to be used, but some features may not be available. Use zpool upgrade -a to enable all features on all pools (subject to the -o compatibility property).

zpool upgrade -v

Displays legacy ZFS versions supported by this version of ZFS. See zpool-features(7) for a description of features supported by this version of ZFS.

zpool upgrade [-V version] -a|pool…

Enables all supported features on the given pool. If the pool has specified compatibility feature sets using the -o compatibility property, only the features present in all requested compatibility sets will be enabled. If this property is set to legacy then no upgrade will take place.

Once this is done, the pool will no longer be accessible on systems that do not support feature flags. See zpool-features(7) for details on compatibility with systems that support feature flags, but do not support all features enabled on the pool.

-a

Enables all supported features (from specified compatibility sets, if any) on all pools.

-V version

Upgrade to the specified legacy version. If specified, no features will be enabled on the pool. This option can only be used to increase the version number up to the last supported legacy version number.

## EXAMPLES

### Example 1: Upgrading All ZFS Storage Pools to the Current Version
The following command upgrades all ZFS Storage pools to the current version of the software:

```
# zpool upgrade -a
This system is currently running ZFS version 2.
```

## SEE ALSO
zpool-features(7), zpoolconcepts(7), zpoolprops(7), zpool-history(8)


zpool-wait

title: zpool-wait(8)

text:
# zpool-wait(8)

## NAME
zpool-wait — wait for activity to stop in a ZFS storage pool

## SYNOPSIS
zpool

wait [-Hp] [-T u|d] [-t activity[,activity]…] pool [interval]

## DESCRIPTION
Waits until all background activity of the given types has ceased in the given pool. The activity could cease because it has completed, or because it has been paused or canceled by a user, or because the pool has been exported or destroyed. If no activities are specified, the command waits until background activity of every type listed below has ceased. If there is no activity of the given types in progress, the command returns immediately.

These are the possible values for activity, along with what each one waits for:

discard

Checkpoint to be discarded

free

freeing property to become 0

initialize

All initializations to cease

replace

All device replacements to cease

remove

Device removal to cease

resilver

Resilver to cease

scrub

Scrub to cease

trim

Manual trim to cease

raidz_expand

Attaching to a RAID-Z vdev to complete

If an interval is provided, the amount of work remaining, in bytes, for each activity is printed every interval seconds.

-H

Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.

-p

Display numbers in parsable (exact) values.

-T u|d

Display a time stamp. Specify u for a printed representation of the internal representation of time. See time(1). Specify d for standard date format. See date(1).

## SEE ALSO
zpool-checkpoint(8), zpool-initialize(8), zpool-remove(8), zpool-replace(8), zpool-resilver(8), zpool-scrub(8), zpool-status(8), zpool-trim(8)


title: zpool_influxdb(8)

text:
# zpool_influxdb(8)

## NAME
zpool_influxdb — collect ZFS pool statistics in InfluxDB line protocol format

## SYNOPSIS
zpool_influxdb

[-e|--execd] [-n|--no-histogram] [-s|--sum-histogram-buckets] [-t|--tags key=value[,key=value]…] [pool]

## DESCRIPTION
zpool_influxdb produces InfluxDB-line-protocol-compatible metrics from zpools. Like the zpool command, zpool_influxdb reads the current pool status and statistics. Unlike the zpool command which is intended for humans, zpool_influxdb formats the output in the InfluxDB line protocol. The expected use is as a plugin to a metrics collector or aggregator, such as Telegraf.

By default, zpool_influxdb prints pool metrics and status in the InfluxDB line protocol format. All pools are printed, similar to the zpool status command. Providing a pool name restricts the output to the named pool.

## OPTIONS
-e, --execd

Run in daemon mode compatible with Telegraf's execd plugin. In this mode, the pools are sampled every time a newline appears on the standard input.

-n, --no-histogram

Do not print latency and I/O size histograms. This can reduce the total amount of data, but one should consider the value brought by the insights that latency and I/O size distributions provide. The resulting values are suitable for graphing with Grafana's heatmap plugin.

-s, --sum-histogram-buckets

Accumulates bucket values. By default, the values are not accumulated and the raw data appears as shown by zpool iostat. This works well for Grafana's heatmap plugin. Summing the buckets produces output similar to Prometheus histograms.

-t, --tags key=value[,key=value]…

Adds specified tags to the tag set. No sanity checking is performed. See the InfluxDB Line Protocol format documentation for details on escaping special characters used in tags.

-h, --help

Print a usage summary.

## SEE ALSO
zpool-iostat(8), zpool-status(8), InfluxDB, Telegraf, Grafana, Prometheus


zstream

title: zstream(8)

summary: manipulate ZFS send streams

text:
# zstream(8)

## NAME
zstream — manipulate ZFS send streams

## SYNOPSIS
zstream

dump [-Cvd] [file]

zstream

decompress [-v] [object,offset[,type...]]

zstream

redup [-v] file

zstream

token resume_token

zstream

recompress [-l level] algorithm

## DESCRIPTION
The zstream utility manipulates ZFS send streams output by the zfs send command.

zstream dump [-Cvd] [file]

Print information about the specified send stream, including headers and record counts. The send stream may either be in the specified file, or provided on standard input. -C

Suppress the validation of checksums.

-v

Verbose. Print metadata for each record.

-d

Dump data contained in each record. Implies verbose.

The zstreamdump alias is provided for compatibility and is equivalent to running zstream dump.

zstream token resume_token

Dumps zfs resume token information

zstream decompress [-v] [object,offset[,type...]]

Decompress selected records in a ZFS send stream provided on standard input, when the compression type recorded in ZFS metadata may be incorrect. Specify the object number and byte offset of each record that you wish to decompress. Optionally specify the compression type. Valid compression types include off, gzip, lz4, lzjb, zstd, and zle. The default is lz4. Every record for that object beginning at that offset will be decompressed, if possible. It may not be possible, because the record may be corrupted in some but not all of the stream's snapshots. Specifying a compression type of off will change the stream's metadata accordingly, without attempting decompression. This can be useful if the record is already uncompressed but the metadata insists otherwise. The repaired stream will be written to standard output. -v

Verbose. Print summary of decompressed records.

zstream redup [-v] file

Deduplicated send streams can be generated by using the zfs send -D command. The ability to send deduplicated send streams is deprecated. In the future, the ability to receive a deduplicated send stream with zfs receive will be removed. However, deduplicated send streams can still be received by utilizing zstream redup. The zstream redup command is provided a file containing a deduplicated send stream, and outputs an equivalent non-deduplicated send stream on standard output. Therefore, a deduplicated send stream can be received by running:

\# zstream redup DEDUP_STREAM_FILE | zfs receive …

-v

Verbose. Print summary of converted records.

zstream recompress [-l level] algorithm

Recompresses a send stream, provided on standard input, using the provided algorithm and optional level, and writes the modified stream to standard output. All WRITE records in the send stream will be recompressed, unless they fail to result in size reduction compared to being left uncompressed. The provided algorithm can be any valid value to the compress property. Note that encrypted send streams cannot be recompressed. -l level

Specifies compression level. Only needed for algorithms where the level is not implied as part of the name of the algorithm (e.g. gzip-3 does not require it, while zstd does, if a non-default level is desired).

## EXAMPLES
Heal a dataset that was corrupted due to OpenZFS bug #12762. First, determine which records are corrupt. That cannot be done automatically; it requires information beyond ZFS's metadata. If object 128 is corrupted at offset 0 and is compressed using lz4, then run this command:

```
# zfs send -c … | zstream decompress 128,0,lz4 | zfs recv …
```

## SEE ALSO
zfs(8), zfs-receive(8), zfs-send(8), https://github.com/openzfs/zfs/issues/12762


zstreamdump

title: zstreamdump(8)

summary: manipulate ZFS send streams

text:
# zstreamdump(8)

## NAME
zstream — manipulate ZFS send streams

## SYNOPSIS
zstream

dump [-Cvd] [file]

zstream

decompress [-v] [object,offset[,type...]]

zstream

redup [-v] file

zstream

token resume_token

zstream

recompress [-l level] algorithm

## DESCRIPTION
The zstream utility manipulates ZFS send streams output by the zfs send command.

zstream dump [-Cvd] [file]

Print information about the specified send stream, including headers and record counts. The send stream may either be in the specified file, or provided on standard input. -C

Suppress the validation of checksums.

-v

Verbose. Print metadata for each record.

-d

Dump data contained in each record. Implies verbose.

The zstreamdump alias is provided for compatibility and is equivalent to running zstream dump.

zstream token resume_token

Dumps zfs resume token information

zstream decompress [-v] [object,offset[,type...]]

Decompress selected records in a ZFS send stream provided on standard input, when the compression type recorded in ZFS metadata may be incorrect. Specify the object number and byte offset of each record that you wish to decompress. Optionally specify the compression type. Valid compression types include off, gzip, lz4, lzjb, zstd, and zle. The default is lz4. Every record for that object beginning at that offset will be decompressed, if possible. It may not be possible, because the record may be corrupted in some but not all of the stream's snapshots. Specifying a compression type of off will change the stream's metadata accordingly, without attempting decompression. This can be useful if the record is already uncompressed but the metadata insists otherwise. The repaired stream will be written to standard output. -v

Verbose. Print summary of decompressed records.

zstream redup [-v] file

Deduplicated send streams can be generated by using the zfs send -D command. The ability to send deduplicated send streams is deprecated. In the future, the ability to receive a deduplicated send stream with zfs receive will be removed. However, deduplicated send streams can still be received by utilizing zstream redup. The zstream redup command is provided a file containing a deduplicated send stream, and outputs an equivalent non-deduplicated send stream on standard output. Therefore, a deduplicated send stream can be received by running:

\# zstream redup DEDUP_STREAM_FILE | zfs receive …

-v

Verbose. Print summary of converted records.

zstream recompress [-l level] algorithm

Recompresses a send stream, provided on standard input, using the provided algorithm and optional level, and writes the modified stream to standard output. All WRITE records in the send stream will be recompressed, unless they fail to result in size reduction compared to being left uncompressed. The provided algorithm can be any valid value to the compress property. Note that encrypted send streams cannot be recompressed. -l level

Specifies compression level. Only needed for algorithms where the level is not implied as part of the name of the algorithm (e.g. gzip-3 does not require it, while zstd does, if a non-default level is desired).

## EXAMPLES
Heal a dataset that was corrupted due to OpenZFS bug #12762. First, determine which records are corrupt. That cannot be done automatically; it requires information beyond ZFS's metadata. If object 128 is corrupted at offset 0 and is compressed using lz4, then run this command:

```
# zfs send -c … | zstream decompress 128,0,lz4 | zfs recv …
```

## SEE ALSO
zfs(8), zfs-receive(8), zfs-send(8), https://github.com/openzfs/zfs/issues/12762


zed

package: zfs-zed

title: zed(8)

summary: ZFS Event Daemon

text:
# zed(8)

## NAME
ZED — ZFS Event Daemon

## SYNOPSIS
ZED

[-fFhILMvVZ] [-d zedletdir] [-p pidfile] [-P path] [-s statefile] [-j jobs] [-b buflen]

## DESCRIPTION
The ZED (ZFS Event Daemon) monitors events generated by the ZFS kernel module. When a zevent (ZFS Event) is posted, the ZED will run any ZEDLETs (ZFS Event Daemon Linkage for Executable Tasks) that have been enabled for the corresponding zevent class.

## OPTIONS
-h

Display a summary of the command-line options.

-L

Display license information.

-V

Display version information.

-v

Be verbose.

-f

Force the daemon to run if at all possible, disabling security checks and throwing caution to the wind. Not recommended for use in production.

-F

Don't daemonize: remain attached to the controlling terminal, log to the standard I/O streams.

-M

Lock all current and future pages in the virtual memory address space. This may help the daemon remain responsive when the system is under heavy memory pressure.

-I

Request that the daemon idle rather than exit when the kernel modules are not loaded. Processing of events will start, or resume, when the kernel modules are (re)loaded. Under Linux the kernel modules cannot be unloaded while the daemon is running.

-Z

Zero the daemon's state, thereby allowing zevents still within the kernel to be reprocessed.

-d zedletdir

Read the enabled ZEDLETs from the specified directory.

-p pidfile

Write the daemon's process ID to the specified file.

-P path

Custom $PATH for zedlets to use. Normally zedlets run in a locked-down environment, with hardcoded paths to the ZFS commands ($ZFS, $ZPOOL, $ZED, …), and a hard-coded $PATH. This is done for security reasons. However, the ZFS test suite uses a custom PATH for its ZFS commands, and passes it to ZED with -P. In short, -P is only to be used by the ZFS test suite; never use it in production!

-s statefile

Write the daemon's state to the specified file.

-j jobs

Allow at most jobs ZEDLETs to run concurrently, delaying execution of new ones until they finish. Defaults to 16.

-b buflen

Cap kernel event buffer growth to buflen entries. This buffer is grown when the daemon misses an event, but results in unreclaimable memory use in the kernel. A value of 0 removes the cap. Defaults to 1048576.

## ZEVENTS
A zevent is comprised of a list of nvpairs (name/value pairs). Each zevent contains an EID (Event IDentifier) that uniquely identifies it throughout the lifetime of the loaded ZFS kernel module; this EID is a monotonically increasing integer that resets to 1 each time the kernel module is loaded. Each zevent also contains a class string that identifies the type of event. For brevity, a subclass string is defined that omits the leading components of the class string. Additional nvpairs exist to provide event details.

The kernel maintains a list of recent zevents that can be viewed (along with their associated lists of nvpairs) using the zpool events -v command.

## CONFIGURATION
ZEDLETs to be invoked in response to zevents are located in the enabled-zedlets directory (zedletdir). These can be symlinked or copied from the installed-zedlets directory; symlinks allow for automatic updates from the installed ZEDLETs, whereas copies preserve local modifications. As a security measure, since ownership change is a privileged operation, ZEDLETs must be owned by root. They must have execute permissions for the user, but they must not have write permissions for group or other. Dotfiles are ignored.

ZEDLETs are named after the zevent class for which they should be invoked. In particular, a ZEDLET will be invoked for a given zevent if either its class or subclass string is a prefix of its filename (and is followed by a non-alphabetic character). As a special case, the prefix all matches all zevents. Multiple ZEDLETs may be invoked for a given zevent.

## ZEDLETS
ZEDLETs are executables invoked by the ZED in response to a given zevent. They should be written under the presumption they can be invoked concurrently, and they should use appropriate locking to access any shared resources. The one exception to this are "synchronous zedlets", which are described later in this page. Common variables used by ZEDLETs can be stored in the default rc file which is sourced by scripts; these variables should be prefixed with ZED_.

The zevent nvpairs are passed to ZEDLETs as environment variables. Each nvpair name is converted to an environment variable in the following manner:

- it is prefixed with ZEVENT_,

- it is converted to uppercase, and

- each non-alphanumeric character is converted to an underscore.

Some additional environment variables have been defined to present certain nvpair values in a more convenient form. An incomplete list of zevent environment variables is as follows:

ZEVENT_EID

The Event IDentifier.

ZEVENT_CLASS

The zevent class string.

ZEVENT_SUBCLASS

The zevent subclass string.

ZEVENT_TIME

The time at which the zevent was posted as “seconds nanoseconds” since the Epoch.

ZEVENT_TIME_SECS

The seconds component of ZEVENT_TIME.

ZEVENT_TIME_NSECS

The nanoseconds component of ZEVENT_TIME.

ZEVENT_TIME_STRING

An almost-RFC3339-compliant string for ZEVENT_TIME.

Additionally, the following ZED & ZFS variables are defined:

ZED_PID

The daemon's process ID.

ZED_ZEDLET_DIR

The daemon's current enabled-zedlets directory.

ZFS_ALIAS

The alias (“name-version-release”) string of the ZFS distribution the daemon is part of.

ZFS_VERSION

The ZFS version the daemon is part of.

ZFS_RELEASE

The ZFS release the daemon is part of.

ZEDLETs may need to call other ZFS commands. The installation paths of the following executables are defined as environment variables: ZDB, ZED, ZFS, ZINJECT, and ZPOOL. These variables may be overridden in the rc file.

## Synchronous ZEDLETS
ZED's normal behavior is to spawn off zedlets in parallel and ignore their completion order. This means that ZED can potentially have zedlets for event ID number 2 starting before zedlets for event ID number 1 have finished. Most of the time this is fine, and it actually helps when the system is getting hammered with hundreds of events.

However, there are times when you want your zedlets to be executed in sequence with the event ID. That is where synchronous zedlets come in.

ZED will wait for all previously spawned zedlets to finish before running a synchronous zedlet. Synchronous zedlets are guaranteed to be the only zedlet running. No other zedlets may run in parallel with a synchronous zedlet. Users should be careful to only use synchronous zedlets when needed, since they decrease parallelism.

To make a zedlet synchronous, simply add a "-sync-" immediately following the event name in the zedlet's file name:

EVENT_NAME-sync-ZEDLETNAME.sh

For example, if you wanted a synchronous statechange script:

statechange-sync-myzedlet.sh

## FILES
/etc/zfs/zed.d

The default directory for enabled ZEDLETs.

/etc/zfs/zed.d/zed.rc

The default rc file for common variables used by ZEDLETs.

/usr/libexec/zfs/zed.d

The default directory for installed ZEDLETs.

/var/run/zed.pid

The default file containing the daemon's process ID.

/var/run/zed.state

The default file containing the daemon's state.

## SIGNALS
SIGHUP

Reconfigure the daemon and rescan the directory for enabled ZEDLETs.

SIGTERM, SIGINT

Terminate the daemon.

## SEE ALSO
zfs(8), zpool(8), zpool-events(8)

## NOTES
The ZED requires root privileges.

Do not taunt the ZED.

## BUGS
ZEDLETs are unable to return state/status information to the kernel.

Internationalization support via gettext has not been added.


zmaudit.pl

package: zoneminder

title: zmaudit.pl(8)

text:
# zmaudit.pl(8)

## NAME
zmaudit.pl - ZoneMinder event file system and database consistency checker

## SYNOPSIS

```
 zmaudit.pl [-r,-report|-i,-interactive]
```

## DESCRIPTION
This script checks for consistency between the event filesystem and the database. If events are found in one and not the other they are deleted (optionally). Additionally any monitor event directories that do not correspond to a database monitor are similarly disposed of. However monitors in the database that don't have a directory are left alone as this is valid if they are newly created and have no events yet.

## OPTIONS

```
 -c, --continuous           - Run continuously
 -f, --force                - Run even if pid file exists
 -i, --interactive          - Ask before applying any changes
 -m, --monitor_id           - Only consider the given monitor
 -r, --report               - Just report don't actually do anything
 -s, --storage_id           - Specify a storage area to audit instead of all
 -v, --version              - Print the installed version of ZoneMinder
```


zmc

title: zmc(8)

summary: The ZoneMinder Capture daemon

text:
# zmc(8)

## NAME
zmc - The ZoneMinder Capture daemon

## SYNOPSIS

```
 zmc -d <device_path>
 zmc --device <device_path>
 zmc -f <file_path>
 zmc --file <file_path>
 zmc -m <monitor_id>
 zmc --monitor <monitor_id>
 zmc -h
 zmc --help
 zmc -v
 zmc --version
```

## DESCRIPTION
This binary's job is to sit on a video device and suck frames off it as fast as possible, this should run at more or less constant speed.

## OPTIONS

```
 -d, --device <device_path>         - For local cameras, device to access. e.g /dev/video0 etc
 -f, --file <file_path>           - For local images, jpg file to access.
 -m, --monitor_id             - ID of the monitor to analyse
 -h, --help                 - Display usage information
 -v, --version              - Print the installed version of ZoneMinder
```


zmcamtool.pl

title: zmcamtool.pl(8)

text:
# zmcamtool.pl(8)

## NAME
zmcamtool.pl - ZoneMinder tool to import camera controls and presets

## SYNOPSIS

```
 zmcamtool.pl [--user=<dbuser> --pass=<dbpass>]
              [--import [file.sql] [--overwrite]]
              [--export [name]]
              [--topreset id [--noregex]]
```

## DESCRIPTION
This script provides a way to import new ptz camera controls & camera presets into existing zoneminder systems. This script also provides a way to export ptz camera controls & camera presets from an existing zoneminder system into a sql file, which can then be easily imported to another zoneminder system.

## OPTIONS

```
 --export            - Export all camera controls and presets to STDOUT.
                       Optionally specify a control or preset name.
 --import [file.sql] - Import new camera controls and presets found in
                       zm_create.sql into the ZoneMinder dB.
                       Optionally specify an alternate sql file to read from.
 --overwrite         - Overwrite any existing controls or presets.
                       with the same name as the new controls or presets.
 --topreset id       - Copy a monitor to a Camera Preset given the monitor id.
 --noregex           - Do not try to find and replace fields such as usernames,
                       passwords, IP addresses, etc with generic placeholders
                       when converting a monitor to a preset.
 --help              - Print usage information.
 --user=<dbuser>     - Alternate dB user with privileges to alter dB.
 --pass=<dbpass>     - Password of alternate dB user with privileges to alter dB.
 --version           - Print version.
```


zmcontrol.pl

title: zmcontrol.pl(8)

summary: ZoneMinder control script

text:
# zmcontrol.pl(8)

## NAME
zmcontrol.pl - ZoneMinder control script

## SYNOPSIS

```
 zmcontrol.pl --id {monitor_id} [--command={command}] [various options]
 zmcontrol.pl --protocol {module} --address {addr} [--device {dev}] --command {cmd}
```

## DESCRIPTION
ZoneMinder camera control script. Operates in two modes:

Monitor mode (--id): Connects to the control daemon for the given monitor, or starts the daemon if run without --command. Requires a running ZoneMinder instance with database access.

Direct protocol mode (--protocol): Loads a ZoneMinder::Control module directly and executes a single command without requiring database access or a running ZoneMinder instance. Useful for testing control modules.

## OPTIONS

```
 --id [ monitor_id ] - Monitor ID (monitor mode)
 --protocol [ name ] - Control module name, e.g. ONVIF (direct mode)
 --address [ addr ]  - ControlAddress, e.g. user:pass@host:port (direct mode)
 --device [ dev ]    - ControlDevice / profile token (direct mode)
 --command [ cmd ]   - Command to execute (e.g. moveConUp, get_config)
 --autostop          -
 --xcoord [ arg ]    - X-coord
 --ycoord [ arg ]    - Y-coord
 --speed [ arg ]     - Speed
 --step [ arg ]      -
 --panspeed [ arg ]  -
 --panstep [ arg ]   -
 --tiltspeed [ arg ] -
 --tiltstep [ arg ]  -
 --preset [ arg ]    -
```

## EXAMPLES

```
 # Direct protocol testing (no database needed)
 zmcontrol.pl --protocol ONVIF --address admin:pass@192.168.1.100 --command get_config
 # With profile token
 zmcontrol.pl --protocol ONVIF --address admin:pass@cam:8080 --device prof0 --command get_config
 # Send command to running monitor daemon
 zmcontrol.pl --id 1 --command moveConUp
```


zmdc.pl

title: zmdc.pl(8)

summary: ZoneMinder Daemon Control script

text:
# zmdc.pl(8)

## NAME
zmdc.pl - ZoneMinder Daemon Control script

## SYNOPSIS
zmdc.pl {command} [daemon [options]]

## DESCRIPTION
This script is the gateway for controlling the various ZoneMinder daemons. All starting, stopping and restarting goes through here. On the first invocation it starts up a server which subsequently records what's running and what's not. Other invocations just connect to the server and pass instructions to it.

## OPTIONS
{command} - One of 'startup|shutdown|status|check|logrot' or 'start|stop|restart|reload|version'. [daemon [options]] - Daemon name and options, required for second group of commands


zmeventtool.pl

title: zmeventtool.pl(8)

text:
# zmeventtool.pl(8)

## NAME
zmeventtool.pl - ZoneMinder tool to perform various actions on events

## SYNOPSIS

```
 zmeventtool.pl [--user=<dbuser> --pass=<dbpass>] command [list of event ids]
```

## DESCRIPTION
This script performs various actions on an event. It is primarily meant to be run from a filter but could be run manually.

## OPTIONS

```
 close               - Update event record after a crash
 deletejpegs         - Deletes all jpegs from the event directory
 deleteanalysisjpegs - Deletes the analysis jpegs from the event directory
 --help              - Print usage information.
 --user=<dbuser>     - Alternate dB user with privileges to alter dB.
 --pass=<dbpass>     - Password of alternate dB user with privileges to alter dB.
 --version           - Print version.
```


zmfilter.pl

title: zmfilter.pl(8)

text:
# zmfilter.pl(8)

## NAME
zmfilter.pl - ZoneMinder tool to select events and perform actions on them

## SYNOPSIS
zmfilter.pl [-f <filter name>,--filter=<filter name>] [--filter_id=<filter id>] [--daemon] | -v, --version

## DESCRIPTION
This script performs a specified database query to select recorded events and performs specified actions on them such as email reporting, deleting, moving, etc. If the --daemon option is given it will remain resident, repeating the query and applying actions. This is normally managed by zmdc.pl however it can be used manually as well.

## OPTIONS

```
  -f{filter name}, --filter={filter name}  - The name of a specific filter to run
  --filter_id={filter id}                  - The id of a specific filter to run
  --daemon                                 - Causes zmfilter.pl to stay running endlessly repeating the filter(s).
  -v, --version                            - Print ZoneMinder version
```


zmonvif-probe.pl

title: zmonvif-probe.pl(8)

summary: ZoneMinder ONVIF probing tool

text:
# zmonvif-probe.pl(8)

## NAME
zmonvif-probe.pl - ZoneMinder ONVIF probing tool

## SYNOPSIS

```
 zmonfig-probe.pl [-v] probe <soap version>
                  [-v] <command> <device URI> <soap version> <user> <password>\n";
  Commands are:
    probe     - scan for devices on the local network and list them
    profiles  - print the device's supported stream configurations
    metadata  - print some of the device's configuration settings
    move      - move the device (only ptz cameras)
    events    - check if the device supports ONVIF events
    other     - Any command supported by the ONVIF Media element.
  Common parameters:
    -v        - increase verbosity
  Device access parameters (for all commands but 'probe'):
    device URL    - the ONVIF Device service URL
    soap version  - SOAP version (1.1 or 1.2)
    user          - username of a user with access to the device
    password      - password for the user
```

## OPTIONS

```
 -c, --continuous           - Run continuously
 -f, --force                - Run even if pid file exists
 -i, --interactive          - Ask before applying any changes
 -m, --monitor_id           - Only consider the given monitor
 -r, --report               - Just report don't actually do anything
 -s, --storage_id           - Specify a storage area to audit instead of all
 -v, --version              - Print the installed version of ZoneMinder
```


zmonvif-trigger.pl

title: zmonvif-trigger.pl(8)

summary: ZoneMinder ONVIF trigger daemon

text:
# zmonvif-trigger.pl(8)

## NAME
zmonvif-trigger.pl - ZoneMinder ONVIF trigger daemon

## SYNOPSIS

```
 zmonfig-trigger.pl [-v] [-s] [-l=]
```

## OPTIONS

```
    local-addr    - local address to bind to
    script|s=s   - script to run
    verbose|v=s  - increase verbosity
```


zmpkg.pl

title: zmpkg.pl(8)

summary: ZoneMinder Package Control Script

text:
# zmpkg.pl(8)

## NAME
zmpkg.pl - ZoneMinder Package Control Script

## SYNOPSIS
zmpkg.pl {start|stop|restart|status|logrot|state|version}

## DESCRIPTION

```
  This script is used to start and stop the ZoneMinder package primarily to
allow command line control for automatic restart on reboot (see zm script)
```


zmrecover.pl

title: zmrecover.pl(8)

text:
# zmrecover.pl(8)

## NAME
zmrecover.pl - ZoneMinder event file system and database recovery checker

## SYNOPSIS

```
 zmrecover.pl [-r,-report|-i,-interactive]
```

## DESCRIPTION
This script checks for consistency between the event filesystem and the database. If events are found in one and not the other they are deleted (optionally). Additionally any monitor event directories that do not correspond to a database monitor are similarly disposed of. However monitors in the database that don't have a directory are left alone as this is valid if they are newly created and have no events yet.

## OPTIONS

```
 -i, --interactive          - Ask before applying any changes
 -m, --monitor_id           - Only consider the given monitor
 -r, --report               - Just report don't actually do anything
 -s, --storage_id           - Specify a storage area to recover instead of all
 -v, --version              - Print the installed version of ZoneMinder
```

## COPYRIGHT
ZoneMinder Recover Script Copyright (C) 2018 ZoneMinder LLC

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


zmstats.pl

title: zmstats.pl(8)

summary: ZoneMinder Stats Updating Script

text:
# zmstats.pl(8)

## NAME
zmstats.pl - ZoneMinder Stats Updating Script

## SYNOPSIS
zmstats.pl

## DESCRIPTION
This does background updating various stats in the db like event counts, diskspace, etc.


zmsystemctl.pl

title: zmsystemctl.pl(8)

summary: ZoneMinder systemctl wrapper

text:
# zmsystemctl.pl(8)

## NAME
zmsystemctl.pl - ZoneMinder systemctl wrapper

## SYNOPSIS

```
 zmsystemctl.pl {start|stop|restart|version}
```

## DESCRIPTION
This script allows an unpriveledged user to start, stop, or restart the zoneminder service on a system running systemd. It does this by redirecting commands through pkexec, which checks the available polkit policy files. The default policy file grants the system web account user permission. This can be changed or expanded by modifying the policy file. See man polkit for details.

## SEE ALSO
polkit(8), pkexec(1)


zmtelemetry.pl

title: zmtelemetry.pl(8)

text:
# zmtelemetry.pl(8)

## NAME
zmtelemetry.pl - Send usage information to the ZoneMinder development team

## SYNOPSIS

```
 zmtelemetry.pl [--force] [--help] [--show] [--interval=seconds] [--version]
```

## DESCRIPTION
This script collects usage information of the local system and sends it to the ZoneMinder development team. This data will be used to determine things like who and where our customers are, how big their systems are, the underlying hardware and operating system, etc. This is being done for the sole purpoase of creating a better product for our target audience. This script is intended to be completely transparent to the end user, and can be disabled from the web console under Options.

## OPTIONS

```
 --force        Force the script to upload it's data instead of waiting
                for the defined interval since last upload.
 --help         Display usage information
 --show         Displays telemetry data that is sent to zoneminder
 --interval     Override the default configured interval since last upload.
                The value should be given in seconds, but can be an expression
                such as 24*60*60.
 --version      Output the version of ZoneMinder.
```


zmtrack.pl

title: zmtrack.pl(8)

text:
# zmtrack.pl(8)

## NAME
zmtrack.pl - ZoneMinder Experimental PTZ Tracking Script

## SYNOPSIS

```
 zmtrack.pl -m <monitor>
 zmtrack.pl --monitor=<monitor>
```

## OPTIONS

```
 -m<monitor>, --monitor=<monitor>   - Id of the monitor to track
```

## DESCRIPTION
This script is used to trigger and cancel alarms from external sources using an arbitrary text based format.


zmtrigger.pl

title: zmtrigger.pl(8)

summary: ZoneMinder External Trigger Script

text:
# zmtrigger.pl(8)

## NAME
zmtrigger.pl - ZoneMinder External Trigger Script

## DESCRIPTION
This script is used to trigger and cancel alarms from external connections using an arbitrary text based format.

This script offers generic solution to external triggering of alarms. It can handle external connections via either internet socket, unix socket or file/device interfaces. You can either use it 'as is' if you can interface with the existing format, or override connections and channels to customise it to your needs.

If enabled by the OPT_TRIGGERS option, Zoneminder service start zmtrigger.pl which listens for control messages on TCP port 6802.

## TRIGGER MESSAGE FORMAT
id|action|score|cause|text|showtext

id

```
  is the id number or name of the ZM monitor.

```

action

```
  Valid actions are 'on', 'off', 'cancel' or 'show' where
  'on' forces an alarm condition on;
  'off' forces an alarm condition off;
  'cancel' negates the previous 'on' or 'off';
  'show' updates the auxiliary text represented by the %Q
  placeholder, which can optionally be added to the affected monitor's
  timestamp label format.

  Ordinarily you would use 'on' and 'cancel', 'off' would tend to be
  used to suppress motion based events. Additionally 'on' and 'off' can
  take an additional time offset, e.g. on+20 which automatically
  cancel's the previous action after that number of seconds.

```

score

```
  is the score given to the alarm, usually to indicate it's
  importance. For 'on' triggers it should be non-zero, otherwise it should
  be zero.

```

cause

```
  is a 32 char max string indicating the reason for, or source of
  the alarm e.g. 'Relay 1 open'. This is saved in the 'Cause' field of the
  event. Ignored for 'off' or 'cancel' messages.

```

text

```
  is a 256 char max additional info field, which is saved in the
  'Description' field of an event. Ignored for 'off' or 'cancel' messages.

```

showtext

```
  is up to 32 characters of text that can be displayed in the
  timestamp that is added to images. The 'show' action is designed to
  update this text without affecting alarms but the text is updated, if
  present, for any of the actions. This is designed to allow external input
  to appear on the images captured, for instance temperature or personnel
  identity etc.

```

```
  Note that multiple messages can be sent at once and should be LF or CRLF
  delimited. This script is not necessarily intended to be a solution in
  itself, but is intended to be used as 'glue' to help ZoneMinder interface
  with other systems. It will almost certainly require some customisation
  before you can make any use of it. If all you want to do is generate alarms
  from external sources then using the ZoneMinder::SharedMem perl module is
  likely to be easier.
```

## EXAMPLES

```
  3|on+10|1|motion|text|showtext
```

Triggers 'alarm' on camera #3 for 10 seconds with score=1, cause='motion'.


zmu

title: zmu(8)

summary: The ZoneMinder Utility

text:
# zmu(8)

## NAME
zmc - The ZoneMinder Utility

## SYNOPSIS

```
 zmu -d device_path [-v] [function] [-U<username> -P<password>]
 zmu --device device_path [-v] [function] [-U<username> -P<password>]
 zmu -m monitor_id [-v] [function] [-U<username> -P<password>]
 zmu --monitor monitor_id [-v] [function] [-U<username> -P<password>]
```

## DESCRIPTION
This binary is a handy command line interface to several useful functions. It's not really meant to be used by anyone except the web page (there's only limited 'help' in it so far) but can be if necessary, especially for debugging video problems.

## OPTIONS
General options:

-v, --verbose - Produce more verbose output

-l, --list - List the current status of active (or all with -v) monitors

-h, --help - Display usage information

-v, --version - Print the installed version of ZoneMinder

Options for use with devices:

-d, --device [device_path] - Get the current video device settings for [device_path] or all devices

-V, --version <V4L version> - Set the Video 4 Linux API version to use for the query, use 1 or 2

-q, --query - Query the current settings for the device

Options for use with monitors:

-m, --monitor <monitor_id> - Specify which monitor to address, default 1 if absent

-q, --query - Query the current settings for the monitor

-s, --state - Output the current monitor state, 0 = unknown, 1 = idle, 2 = prealarm,

3 = alarm, 4 = alert, 5 = tape

-B, --brightness [value] - Output the current brightness, set to value if given

-C, --contrast [value] - Output the current contrast, set to value if given

-H, --hue [value] - Output the current hue, set to value if given

-O, --colour [value] - Output the current colour, set to value if given

-i, --image [image_index] - Write captured image to disk as <monitor_name>.jpg, last image captured

or specified ring buffer index if given.

-S, --scale <scale_%%ge> - With --image specify any scaling (in %%) to be applied to the image

-t, --timestamp [image_index] - Output captured image timestamp, last image captured or specified

ring buffer index if given

-R, --read_index - Output ring buffer read index

-W, --write_index - Output ring buffer write index

-e, --event - Output last event index

-f, --fps - Output last Frames Per Second captured reading

-z, --zones - Write last captured image overlaid with zones to <monitor_name>-Zones.jpg

-a, --alarm - Force alarm in monitor, this will trigger recording until cancelled with -c

-n, --noalarm - Force no alarms in monitor, this will prevent alarms until cancelled with -c

-c, --cancel - Cancel a forced alarm/noalarm in monitor, required after being enabled with -a or -n

-L, --reload - Signal monitor to reload settings

-E, --enable - Enable detection, wake monitor up

-D, --disable - Disable detection, put monitor to sleep

-u, --suspend - Suspend detection, useful to prevent bogus alarms when panning etc

-r, --resume - Resume detection after a suspend

-U, --username <username> - When running in authenticated mode the username and

-P, --password <password> - password combination of the given user

-A, --auth <authentication> - Pass authentication hash string instead of user details

-x, --xtrigger - Output the current monitor trigger state, 0 = not triggered, 1 = triggered


zmupdate.pl

title: zmupdate.pl(8)

summary: check and upgrade ZoneMinder database

text:
# zmupdate.pl(8)

## NAME
zmupdate.pl - check and upgrade ZoneMinder database

## SYNOPSIS
zmupdate.pl -c,--check | -f,--freshen | -v<version>,--version=<version> [-u <dbuser> -p <dbpass>]

## DESCRIPTION
This script checks what the most recent release of ZoneMinder is at the the moment by downloading https://update.zoneminder.com/version.txt. It can also apply and configure upgrades etc, including on the fly upgrades.

## OPTIONS

```
 -c, --check                       - Check for updated versions of ZoneMinder.
                                     If not interactive zmupdate.pl will stay running, checking every hour.
                                     If interactive will try once, print out result and quit.
 -f, --freshen                     - Freshen the configuration in the database. Equivalent of old zmconfig.pl -noi
 --migrate-events                  - Update database structures as per USE_DEEP_STORAGE setting.
 -v <version>, --version=<version> - Force upgrade to the current version from <version>
 -u <dbuser>, --user=<dbuser>      - Alternate DB user with privileges to alter DB
 -p <dbpass>, --pass=<dbpass>      - Password of alternate DB user with privileges to alter DB
 -s, --super                       - Use system maintenance account on debian based systems instead of unprivileged account
 -d <dir>, --dir=<dir>             - Directory containing update files if not in default build location
 -interactive                      - interact with the user
 -nointeractive                    - do not interact with the user
```


zmvideo.pl

title: zmvideo.pl(8)

summary: ZoneMinder Video Creation Script

text:
# zmvideo.pl(8)

## NAME
zmvideo.pl - ZoneMinder Video Creation Script

## SYNOPSIS

```
 zmvideo.pl [ -e <event_id>,--event=<event_id> | --filter_name=<filter name> | --filter_id=<filter id> ]
            [--concat=filename]
            [--format <format>]
            [--rate=<rate>]
            [--scale=<scale>]
            [--fps=<fps>]
            [--size=<size>]
            [--overwrite]
```

## DESCRIPTION
This script is used to create MPEG videos of events for the web pages or as email attachments.


zmwatch.pl

title: zmwatch.pl(8)

summary: ZoneMinder WatchDog Script

text:
# zmwatch.pl(8)

## NAME
zmwatch.pl - ZoneMinder WatchDog Script

## SYNOPSIS
zmwatch.pl

## DESCRIPTION
This does some basic setup for ZoneMinder to run and then periodically checks the fps output of the active daemons to check they haven't locked up. If they have then they are killed and restarted


title: zmx10.pl(8)

summary: ZoneMinder X10 Control Script

text:
# zmx10.pl(8)

## NAME
zmx10.pl - ZoneMinder X10 Control Script

## SYNOPSIS

```
 zmx10.pl -c <command>,--command=<command> [-u <unit code>,--unit-code=<unit code>]
```

## DESCRIPTION
This script controls the monitoring of the X10 interface and the consequent management of the ZM daemons based on the receipt of X10 signals.

## OPTIONS

```
 -c <command>, --command=<command>       - Command to issue, one of 'on','off','dim','bright','start', 'status','shutdown'
 -u <unit code>, --unit-code=<unit code> - Unit code to act on required for all commands
                                           except 'status' (optional) and 'shutdown'
 -v, --verison                           - Pirnts the currently installed version of ZoneMinder
```


zram-generator

package: zram-generator

title: zram-generator(8)

text:
# zram-generator(8)

## NAME
zram-generator - Systemd unit generator for zram swap devices

## SYNOPSIS
/usr/lib/systemd/system-generators/zram-generator TARGET_DIR [2RGET_DIR 3RGET_DIR]

/usr/lib/systemd/system-generators/zram-generator --setup-device DEVICE

/usr/lib/systemd/system-generators/zram-generator --reset-device DEVICE

## DESCRIPTION
zram-generator is a generator that creates systemd units to format and use compressed RAM devices, either as swap or a file system.

The generator will be invoked by systemd early at boot. The generator will then:

1.

read configuration files from {/etc,/lib}/systemd/zram-generator.conf[.d] (see zram-generator.conf(5) for details);

2.

generate systemd.swap(5) and/or systemd.mount(5) units into TARGET_DIR and connect them to swap.target or local-fs.target as appropriate;

3.

ensure the zram module is loaded and create the requested devices.

The generator does nothing if run inside a container (as determined by systemd-detect-virt(8) --container).

The generator also understands the kernel command-line option systemd.zram. See zram-generator.conf(5) for details.

Setting the ZRAM_GENERATOR_ROOT environment variable makes the generator run in test mode, in which case containerisation is ignored and step 3 is skipped.

For the ramifications of ZRAM_GENERATOR_ROOT on config handling, see zram-generator.conf(5).

Generated dev-zramN.swap units depend on systemd-zram-setup@zramN.service, which will:

1.

read configuration files from {/etc,/lib}/systemd/zram-generator.conf[.d] (see zram-generator.conf(5) for details);

2.

set the desired compression algorithm, if any; if the current kernel doesn´t understand the specified algorithm, a warning is issued, but execution continues;

3.

set the desired blockdev size and format it as swap with systemd-makefs(8).

Generated path-to-mount-point.mount units depend on systemd-zram-setup@zramN.service. The effect is similar to what happens for swap units, but of course they are formatted with a file system.

When the unit is stopped, the zram device is reset, freeing memory and allowing the device to be reused.

zram-generator implements systemd.generator(7).

### Applying config changes
This generator is invoked in early boot, and the devices it configures will be created very early too, so the easiest way to apply config changes is to simply reboot the machine.

Nevertheless, sometimes it may be useful to add new devices or apply config changes at runtime. Applying new configuration means restarting the units, and that in turn means recreating the zram devices. This means that file systems are temporarily unmounted and their contents lost, and pages are moved out of the compressed swap device into other memory. If this is acceptable, systemctl restart systemd-zram-setup@zramN or systemctl restart systemd-zram-setup@* may be used to recreate a specific device or all configured devices. (If the device didn´t exist, restart will create it.) If the way the device is used (e.g. the mount point or file system type) is changed, systemctl daemon-reload needs to be called first to recreate systemd units. If a device or mount point is removed from configuration, the unit should be stopped before calling daemon-reload. Otherwise, systemd will not know how to stop the unit properly.

## REPORTING BUGS
https://github.com/systemd/zram-generator/issues

## SEE ALSO
zram-generator.conf(5), systemd.generator(7), systemd.swap(5)

https://github.com/systemd/zram-generator

Linux documentation of zram: https://kernel.org/doc/html/latest/admin-guide/blockdev/zram.html

and the zram sysfs ABI: https://kernel.org/doc/Documentation/ABI/testing/sysfs-block-zram