en	# zabbix\_sender Section: User Commands (1)\ Updated: 2021-06-01\ [Index](#index) [Return to Main Contents](/manpages) ------------------------------------------------------------------------ [ ]{#lbAB}
zh-cn	# zabbix_sender 章节：用户命令 (1)\ 更新日期：2021-06-01\ [索引](#index) [Return to Main Contents](/manpages) ------------------------------------------------------------------------ [ ]{#lbAB}

en	## NAME zabbix\_sender - Zabbix sender utility [ ]{#lbAC}
zh-cn	## 名称 zabbix\_sender - Zabbix发送器实用工具 [ ]{#lbAC}

en	## SYNOPSIS **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] **-s** *host* **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *host*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *host*\] **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *host*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] **-s** *host* **--tls-connect** **cert** **--tls-ca-file** *CA-file* \[**--tls-crl-file** *CRL-file*\] \[**--tls-server-cert-issuer** *cert-issuer*\] \[**--tls-server-cert-subject** *cert-subject*\] **--tls-cert-file** *cert-file* **--tls-key-file** *key-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *host*\] **--tls-connect** **cert** **--tls-ca-file** *CA-file* \[**--tls-crl-file** *CRL-file*\] \[**--tls-server-cert-issuer** *cert-issuer*\] \[**--tls-server-cert-subject** *cert-subject*\] **--tls-cert-file** *cert-file* **--tls-key-file** *key-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *host*\] **--tls-connect** **cert** **--tls-ca-file** *CA-file* \[**--tls-crl-file** *CRL-file*\] \[**--tls-server-cert-issuer** *cert-issuer*\] \[**--tls-server-cert-subject** *cert-subject*\] **--tls-cert-file** *cert-file* **--tls-key-file** *key-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *host*\] **--tls-connect** **cert** **--tls-ca-file** *CA-file* \[**--tls-crl-file** *CRL-file*\] \[**--tls-server-cert-issuer** *cert-issuer*\] \[**--tls-server-cert-subject** *cert-subject*\] **--tls-cert-file** *cert-file* **--tls-key-file** *key-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] **-s** *host* **--tls-connect** **psk** **--tls-psk-identity** *PSK-identity* **--tls-psk-file** *PSK-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *host*\] **--tls-connect** **psk** **--tls-psk-identity** *PSK-identity* **--tls-psk-file** *PSK-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *host*\] **--tls-connect** **psk** **--tls-psk-identity** *PSK-identity* **--tls-psk-file** *PSK-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *host*\] **--tls-connect** **psk** **--tls-psk-identity** *PSK-identity* **--tls-psk-file** *PSK-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender -h**\ **zabbix\_sender -V** [ ]{#lbAD}
zh-cn	## 概要 **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] **-s** *主机* **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *主机*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *主机*\] **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *主机*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] **-s** *主机* **--tls-connect** **cert** **--tls-ca-file** *CA-file* \[**--tls-crl-file** *CRL-file*\] \[**--tls-server-cert-issuer** *cert-issuer*\] \[**--tls-server-cert-subject** *cert-subject*\] **--tls-cert-file** *cert-file* **--tls-key-file** *key-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *主机*\] **--tls-connect** **cert** **--tls-ca-file** *CA-file* \[**--tls-crl-file** *CRL-file*\] \[**--tls-server-cert-issuer** *cert-issuer*\] \[**--tls-server-cert-subject** *cert-subject*\] **--tls-cert-file** *cert-file* **--tls-key-file** *key-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *主机*\] **--tls-connect** **cert** **--tls-ca-file** *CA-file* \[**--tls-crl-file** *CRL-file*\] \[**--tls-server-cert-issuer** *cert-issuer*\] \[**--tls-server-cert-subject** *cert-subject*\] **--tls-cert-file** *cert-file* **--tls-key-file** *key-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *主机*\] **--tls-connect** **cert** **--tls-ca-file** *CA-file* \[**--tls-crl-file** *CRL-file*\] \[**--tls-server-cert-issuer** *cert-issuer*\] \[**--tls-server-cert-subject** *cert-subject*\] **--tls-cert-file** *cert-file* **--tls-key-file** *key-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] **-s** *主机* **--tls-connect** **psk** **--tls-psk-identity** *PSK-identity* **--tls-psk-file** *PSK-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-z** *server* \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *主机*\] **--tls-connect** **psk** **--tls-psk-identity** *PSK-identity* **--tls-psk-file** *PSK-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *主机*\] **--tls-connect** **psk** **--tls-psk-identity** *PSK-identity* **--tls-psk-file** *PSK-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] **-k** *key* **-o** *value*\ **zabbix\_sender** \[**-v**\] **-c** *config-file* \[**-z** *server*\] \[**-p** *port*\] \[**-I** *IP-address*\] \[**-t** *timeout*\] \[**-s** *主机*\] **--tls-connect** **psk** **--tls-psk-identity** *PSK-identity* **--tls-psk-file** *PSK-file* \[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher** *cipher-string*\] \[**-T**\] \[**-N**\] \[**-r**\] \[**-g**\] **-i** *input-file*\ **zabbix\_sender -h**\ **zabbix\_sender -V** [ ]{#lbAD}

en	## DESCRIPTION **zabbix\_sender** is a command line utility for sending monitoring data to Zabbix server or proxy. On the Zabbix server an item of type **Zabbix trapper** should be created with corresponding key. Note that incoming values will only be accepted from hosts specified in **Allowed hosts** field for this item. [ ]{#lbAE}
zh-cn	## 描述 **zabbix_sender** 是一个用于向 Zabbix server 或 proxy 发送监控数据的命令行工具。在 Zabbix server 上需要创建一个类型为 **Zabbix trapper** 的 监控项 并配置对应键值。请注意，传入的值仅会接受该 监控项 的 **Allowed 主机** 字段中指定的 主机。[ ]{#lbAE}

en	## OPTIONS **-c**, **--config** *config-file* Use *config-file*. **Zabbix sender** reads server details from the agentd configuration file. By default **Zabbix sender** does not read any configuration file. Only parameters **Hostname**, **ServerActive**, **SourceIP**, **TLSConnect**, **TLSCAFile**, **TLSCRLFile**, **TLSServerCertIssuer**, **TLSServerCertSubject**, **TLSCertFile**, **TLSKeyFile**, **TLSPSKIdentity** and **TLSPSKFile** are supported. Hostname defined through **HostnameItem** parameter will not be picked up, in this case the hostname should be specified via command line (see -s option). All addresses defined in the agent **ServerActive** configuration parameter are used for sending data. If sending of batch data fails to one address, the following batches are not sent to this address. **-z**, **--zabbix-server** *server* Hostname or IP address of Zabbix server. If a host is monitored by a proxy, proxy hostname or IP address should be used instead. When used together with **--config**, overrides the entries of **ServerActive** parameter specified in agentd configuration file. **-p**, **--port** *port* Specify port number of Zabbix server trapper running on the server. Default is 10051. When used together with **--config**, overrides the port entries of **ServerActive** parameter specified in agentd configuration file. **-I**, **--source-address** *IP-address* Specify source IP address. When used together with **--config**, overrides **SourceIP** parameter specified in agentd configuration file. **-t**, **--timeout** *seconds* Specify timeout. Valid range: 1-300 seconds (default: 60) **-s**, **--host** *host* Specify host name the item belongs to (as registered in Zabbix frontend). Host IP address and DNS name will not work. When used together with **--config**, overrides **Hostname** parameter specified in agentd configuration file. **-k**, **--key** *key* Specify item key to send value to. **-o**, **--value** *value* Specify item value. **-i**, **--input-file** *input-file* Load values from input file. Specify **-** as **<input-file>** to read values from standard input. Each line of file contains whitespace delimited: **<hostname> <key> <value>**. Each value must be specified on its own line. Each line must contain 3 whitespace delimited entries: **<hostname> <key> <value>**, where "hostname" is the name of monitored host as registered in Zabbix frontend, "key" is target item key and "value" - the value to send. Specify **-** as **<hostname>** to use hostname from agent configuration file or from **--host** argument. An example of a line of an input file: **"Linux DB3" db.connections 43** The value type must be correctly set in item configuration of Zabbix frontend. Zabbix sender will send up to 250 values in one connection. [Size limit](/manual/appendix/protocols/header_datalen) for sending values from an input file depends on the size described in Zabbix communication protocol. Contents of the input file must be in the UTF-8 encoding. All values from the input file are sent in a sequential order top-down. Entries must be formatted using the following rules: - Quoted and non-quoted entries are supported. - Double-quote is the quoting character. - Entries with whitespace must be quoted. - Double-quote and backslash characters inside quoted entry must be escaped with a backslash. - Escaping is not supported in non-quoted entries. - Linefeed escape sequences (\\n) are supported in quoted strings. - Linefeed escape sequences are trimmed from the end of an entry. **-T**, **--with-timestamps** This option can be only used with **--input-file** option. Each line of the input file must contain 4 whitespace delimited entries: **<hostname> <key> <timestamp> <value>**. Timestamp should be specified in Unix timestamp format. If target item has triggers referencing it, all timestamps must be in an increasing order, otherwise event calculation will not be correct. An example of a line of the input file: **"Linux DB3" db.connections 1429533600 43** For more details please see option **--input-file**. If a timestamped value is sent for a host that is in a “no data” maintenance type then this value will be dropped; however, it is possible to send a timestamped value in for an expired maintenance period and it will be accepted. **-N**, **--with-ns** This option can be only used with **--with-timestamps** option. Each line of the input file must contain 5 whitespace delimited entries: **<hostname> <key> <timestamp> <ns> <value>**. An example of a line of the input file: **"Linux DB3" db.connections 1429533600 7402561 43** For more details please see option **--input-file**. **-r**, **--real-time** Send values one by one as soon as they are received. This can be used when reading from standard input. **-g**, **--group** Group values by hosts and send to each host in a separate batch. **--tls-connect** *value* How to connect to server or proxy. Values: [ ]{#lbAF}
zh-cn	## 选项 **-c**, **--config** *config-file* 使用 *config-file*。**Zabbix sender** 从该文件中读取服务器详细信息 agentd配置file。默认情况下**Zabbix sender**不会读取 任何配置file. 仅参数**Hostname**, **ListenBacklog**, **ServerActive**, **SourceIP**, **TLSConnect**, **TLSCAFile**, **TLSCRLFile**, **TLSServerCertIssuer**, **TLSServerCertSubject**, **TLSCertFile**, **TLSKeyFile**、**TLSPSKIdentity** 和 **TLSPSKFile** 均受支持。 通过**HostnameItem**参数定义的主机名将不会被识别，在这种情况下，主机名应通过命令行指定（参见-s选项）。 在 agent **ServerActive** 配置参数中定义的所有地址 用于发送数据。如果批量数据发送到某个目标失败 地址，以下批次不会发送到此地址。 **-z**, **--zabbix-server** *server* Zabbix server的主机名或IP地址。如果一个主机由 proxy, proxy 主机名 或 IP 地址应被替代使用。当使用时 与 **--config** 一起使用时，覆盖 **ServerActive** 的条目 在agentd配置中指定的参数file **-p**, **--port** *port* 指定服务器上运行的Zabbix server trapper的端口号。 默认值为10051。当与 **--config** 一起使用时，将覆盖 **ServerActive** 参数在 agentd 中指定的端口条目 配置 file **-I**, **--source-address** *IP地址* 指定源IP地址。当与**--config**一起使用时， 覆盖在agentd配置中指定的**SourceIP**参数file。 **-t**, **--timeout** *秒数* 指定超时时间。有效范围：1-300秒（默认值：60） **-s**, **--host** *主机* 指定 主机名 所属的 监控项（在Zabbix中注册的 前端). 主机IP地址 和 DNS 名称将不起作用. 当使用时 与 **--config** 一起使用时，会覆盖指定的 **Hostname** 参数 在agentd配置中file **-k**, **--key** *key* 指定发送值的监控项键 **-o**, **--value** *value* 指定 监控项 值。 **-i**, **--input-file** *input-file* 从输入file加载值。指定**-**为**<input-file>**以 从标准输入读取值。file的每一行包含空白字符 分隔格式: **<主机名> <键> <值>**. 每个值 必须单独占一行。每行必须包含3个空格 分隔条目格式：**<主机名> <键> <值>**，其中 "hostname" 是被监控主机在Zabbix中注册的名称 前端，"key"是目标监控项键，"value"是要发送的值。 指定 **-** 作为 **<hostname>** 以使用来自 agent 的主机名 配置 file 或来自 **--host** 参数 输入行示例 file: **"Linux DB3" 数据库连接数 43** 在Zabbix前端监控项配置中必须正确设置值类型 Zabbix sender将在一次连接中发送最多250个值. [Size limit](/manual/appendix/protocols/header_datalen) 用于从输入file发送数值 取决于Zabbix通信协议中描述的尺寸 输入file的内容必须采用UTF-8编码格式 输入file的所有值按顺序Top向下发送 条目必须按照以下规则进行格式化: - 支持带引号和不带引号的条目。 - 双引号是引用字符. - 包含空格的条目必须用引号括起来。 - 引号内的双引号和反斜杠字符必须使用反斜杠进行转义。 - 非引用条目不支持转义 - 在带引号的字符串中支持换行符转义序列(\\n). - 行末的换行符转义序列会被自动去除。 **-T**, **--with-timestamps** 此选项只能与**--input-file**选项一起使用。 输入file的每一行必须包含4个以空格分隔的条目: **<主机名> <键值> <时间戳> <数值>**. 时间戳应以Unix时间戳格式指定。如果目标 监控项 存在触发器引用它时，所有时间戳必须按递增顺序排列 顺序，否则事件计算将不正确。 输入行示例 file: **"Linux DB3" 数据库连接数 1429533600 43** 更多详情请参见选项 **--input-file**. 如果为一个主机发送的时间戳值处于“无数据”状态 维护类型时此值将被丢弃；然而，它 可以为已过期的维护期发送带时间戳的值 周期，它将被接受。 **-N**, **--with-ns** 此选项只能与**--with-timestamps**选项一起使用。 输入file的每一行必须包含5个以空格分隔的条目: **<主机名> <键值> <时间戳> <纳秒>** <value>**. 输入行示例 file: **"Linux DB3" db.connections 1429533600 7402561 43** 有关更多详情，请参阅选项 **--input-file**。 **-r**, **--real-time** 逐个发送接收到的值。这可用于 从标准输入读取时。 **-g**, **--group** 按主机分组数值并单独批量发送至每个主机 **--tls-connect** *值* 如何连接到server 或 proxy. 值: [ ]{#lbAF}

en	### **unencrypted** connect without encryption (default) ```{=html} <!-- --> ``` **psk** connect using TLS and a pre-shared key ```{=html} <!-- --> ``` **cert** connect using TLS and a certificate ```{=html} <!-- --> ``` **--tls-ca-file** *CA-file* Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification. **--tls-crl-file** *CRL-file* Full pathname of a file containing revoked certificates. **--tls-server-cert-issuer** *cert-issuer* Allowed server certificate issuer. **--tls-server-cert-subject** *cert-subject* Allowed server certificate subject. **--tls-cert-file** *cert-file* Full pathname of a file containing the certificate or certificate chain. **--tls-key-file** *key-file* Full pathname of a file containing the private key. **--tls-psk-identity** *PSK-identity* PSK-identity string. **--tls-psk-file** *PSK-file* Full pathname of a file containing the pre-shared key. **--tls-cipher13** *cipher-string* Cipher string for OpenSSL 1.1.1 or newer for TLS 1.3. Override the default ciphersuite selection criteria. This option is not available if OpenSSL version is less than 1.1.1. **--tls-cipher** *cipher-string* GnuTLS priority string (for TLS 1.2 and up) or OpenSSL cipher string (only for TLS 1.2). Override the default ciphersuite selection criteria. **-v**, **--verbose** Verbose mode, **-vv** for more details. **-h**, **--help** Display this help and exit. **-V**, **--version** Output version information and exit. [ ]{#lbAG}
zh-cn	### **未加密** 不使用加密连接（默认） ```{=html} <!-- --> ``` **psk** 使用TLS和预共享密钥连接 ```{=html} <!-- --> ``` **cert** 使用TLS和证书连接 ```{=html} <!-- --> ``` **--tls-ca-file** *CA-file* 包含对等证书验证的Top级CA证书的file完整路径名 **--tls-crl-file** *CRL-file* 包含已吊销证书的file完整路径名 **--tls-server-cert-issuer** *cert-issuer* 允许的服务器证书颁发者 **--tls-server-cert-subject** *cert-subject* 允许的服务器证书主题 **--tls-cert-file** *cert-file* 包含证书或证书链的file完整路径名 **--tls-key-file** *key-file* 包含私钥的file完整路径名 **--tls-psk-identity** *PSK-identity* PSK身份string **--tls-psk-file** *PSK-file* 包含预共享密钥的file完整路径名 **--tls-cipher13** *cipher-string* OpenSSL 1.1.1或更高版本中TLS 1.3的密码string。覆盖默认的密码套件选择标准。如果OpenSSL version低于1.1.1，则此选项不可用。 **--tls-cipher** *cipher-string* GnuTLS优先级string（适用于TLS 1.2及以上版本）或OpenSSL密码string（仅适用于TLS 1.2）。覆盖默认的密码套件选择标准。 **-v**, **--verbose** 详细模式，**-vv**获取更多细节 **-h**, **--help** 显示此帮助信息并退出 **-V**, **--version** 输出version信息并退出 [ ]{#lbAG}

en	## EXIT STATUS The exit status is 0 if the values were sent and all of them were successfully processed by server. If data was sent, but processing of at least one of the values failed, the exit status is 2. If data sending failed, the exit status is 1. [ ]{#lbAH}
zh-cn	## 退出状态 如果数值成功发送且服务器全部处理成功，则退出状态为0。若数据已发送但至少有一个数值处理失败，则退出状态为2。若数据发送失败，则退出状态为1。 [ ]{#lbAH}

en	## EXAMPLES **zabbix\_sender -c /etc/zabbix/zabbix\_agentd.conf -k mysql.queries -o 342.45**\ Send **342.45** as the value for **mysql.queries** item of monitored host. Use monitored host and Zabbix server defined in agent configuration file. **zabbix\_sender -c /etc/zabbix/zabbix\_agentd.conf -s "Monitored Host" -k mysql.queries -o 342.45**\ Send **342.45** as the value for **mysql.queries** item of **Monitored Host** host using Zabbix server defined in agent configuration file. \ **zabbix\_sender -z 192.168.1.113 -i data\_values.txt** \ Send values from file **data\_values.txt** to Zabbix server with IP **192.168.1.113**. Host names and keys are defined in the file. \ **echo "- hw.serial.number 1287872261 SQ4321ASDF" | zabbix\_sender -c /usr/local/etc/zabbix\_agentd.conf -T -i -**\ Send a timestamped value from the commandline to Zabbix server, specified in the agent configuration file. Dash in the input data indicates that hostname also should be used from the same configuration file. \ **echo '"Zabbix server" trapper.item ""' | zabbix\_sender -z 192.168.1.113 -p 10000 -i -**\ Send empty value of an item to the Zabbix server with IP address **192.168.1.113** on port **10000** from the commandline. Empty values must be indicated by empty double quotes. **zabbix\_sender -z 192.168.1.113 -s "Monitored Host" -k mysql.queries -o 342.45 --tls-connect cert --tls-ca-file /home/zabbix/zabbix\_ca\_file --tls-cert-file /home/zabbix/zabbix\_agentd.crt --tls-key-file /home/zabbix/zabbix\_agentd.key**\ Send **342.45** as the value for **mysql.queries** item in **Monitored Host** host to server with IP **192.168.1.113** using TLS with certificate. **zabbix\_sender -z 192.168.1.113 -s "Monitored Host" -k mysql.queries -o 342.45 --tls-connect psk --tls-psk-identity "PSK ID Zabbix agentd" --tls-psk-file /home/zabbix/zabbix\_agentd.psk**\ Send **342.45** as the value for **mysql.queries** item in **Monitored Host** host to server with IP **192.168.1.113** using TLS with pre-shared key (PSK). [ ]{#lbAI}
zh-cn	## 示例 **zabbix\_sender -c /etc/zabbix/zabbix\_agentd.conf -k mysql.queries -o 342.45**\ 将**342.45**作为**mysql.queries** 监控项的值发送到被监控主机. 使用在agent配置file中定义的被监控主机和Zabbix server. **zabbix\_sender -c /etc/zabbix/zabbix\_agentd.conf -s "Monitored 主机" -k mysql.queries -o 342.45**\ 将**342.45**作为**mysql.queries** 监控项的值发送到**Monitored 主机** 主机, 使用在agent配置file中定义的Zabbix server. \ **zabbix\_sender -z 192.168.1.113 -i data\_values.txt** \ 将file **data\_values.txt**中的值发送到IP为**192.168.1.113**的Zabbix server. 主机名称和键值在file中定义. \ **echo "- hw.serial.number 1287872261 SQ4321ASDF" | zabbix\_sender -c /usr/local/etc/zabbix\_agentd.conf -T -i -**\ 从命令行发送带时间戳的值到Zabbix server, 该服务器在agent配置file中指定. 输入数据中的短横线表示主机名也应从同一配置file中获取. \ **echo '"Zabbix server" trapper.监控项 ""' | zabbix\_sender -z 192.168.1.113 -p 10000 -i -**\ 从命令行发送监控项的空值到IP地址为**192.168.1.113**, 端口为**10000**的Zabbix server. 空值必须用空双引号表示. **zabbix\_sender -z 192.168.1.113 -s "Monitored 主机" -k mysql.queries -o 342.45 --tls-connect cert --tls-ca-file /home/zabbix/zabbix\_ca\_file --tls-cert-file /home/zabbix/zabbix\_agentd.crt --tls-key-file /home/zabbix/zabbix\_agentd.key**\ 使用证书通过TLS将**342.45**作为**mysql.queries** 监控项的值发送到IP为**192.168.1.113**的服务器上的**Monitored 主机** 主机. **zabbix\_sender -z 192.168.1.113 -s "Monitored 主机" -k mysql.queries -o 342.45 --tls-connect psk --tls-psk-identity "PSK ID Zabbix agentd" --tls-psk-file /home/zabbix/zabbix\_agentd.psk**\ 使用预共享密钥(PSK)通过TLS将**342.45**作为**mysql.queries** 监控项的值发送到IP为**192.168.1.113**的服务器上的**Monitored 主机** 主机. [ ]{#lbAI}

en	## SEE ALSO Documentation <https://www.zabbix.com/manuals> **[zabbix\_agentd](zabbix_agentd)**(8), **[zabbix\_get](zabbix_get)**(1), **[zabbix\_proxy](zabbix_proxy)**(8), **[zabbix\_server](zabbix_server)**(8), **[zabbix\_js](zabbix_js)**(1), **[zabbix\_agent2](zabbix_agent2)**(8), **[zabbix\_web\_service](zabbix_web_service)**(8) [ ]{#lbAJ}
zh-cn	## 另请参阅 文档 <https://www.zabbix.com/manuals> **[zabbix\_agentd](zabbix_agentd)**(8), **[zabbix\_get](zabbix_get)**(1), **[zabbix\_proxy](zabbix_proxy)**(8), **[zabbix\_server](zabbix_server)**(8), **[zabbix\_js](zabbix_js)**(1), **[zabbix\_agent2](zabbix_agent2)**(8), **[zabbix\_web\_service](zabbix_web_service)**(8) [ ]{#lbAJ}

en	## Index [NAME](#lbAB) [SYNOPSIS](#lbAC) [DESCRIPTION](#lbAD) [OPTIONS](#lbAE) [](#lbAF) [EXIT STATUS](#lbAG) [EXAMPLES](#lbAH) [SEE ALSO](#lbAI) [AUTHOR](#lbAJ) ------------------------------------------------------------------------ This document was created on: 08:42:39 GMT, June 11, 2021
zh-cn	## 索引 [名称](#lbAB) [概述](#lbAC) [描述](#lbAD) [选项](#lbAE) [](#lbAF) [退出状态](#lbAG) [示例](#lbAH) [参见](#lbAI) [作者](#lbAJ) ------------------------------------------------------------------------ 本文档创建于: 2021年6月11日 GMT时间 08:42:39