[comment]: # translation:outdated

[comment]: # ({e238b87e-dabb0bd5})

# zabbix\_get

部分：用户命令 (1)\
更新： 2021-06-01\
[Index](#index) [Return to Main Contents](/documentation/6.0/manpages)

------------------------------------------------------------------------

[ ]{#lbAB}

[comment]: # ({/e238b87e-dabb0bd5})

[comment]: # ({0ba1ce53-0ba1ce53})

## 名字

zabbix\_get - Zabbix get 实用程序 [ ]{#lbAC}

[comment]: # ({/0ba1ce53-0ba1ce53})

[comment]: # ({60e7e93b-60e7e93b})

## 概要


**zabbix\_get -s** *host-name-or-IP* \[**-p** *port-number*\] \[**-I**
*IP-address*\] \[**-t** *timeout*\] **-k** *item-key*\
**zabbix\_get -s** *host-name-or-IP* \[**-p** *port-number*\] \[**-I**
*IP-address*\] \[**-t** *timeout*\] **--tls-connect** **cert**
**--tls-ca-file** *CA-file* \[**--tls-crl-file** *CRL-file*\]
\[**--tls-agent-cert-issuer** *cert-issuer*\]
\[**--tls-agent-cert-subject** *cert-subject*\] **--tls-cert-file**
*cert-file* **--tls-key-file** *key-file* \[**--tls-cipher13**
*cipher-string*\] \[**--tls-cipher** *cipher-string*\] **-k**
*item-key*\
**zabbix\_get -s** *host-name-or-IP* \[**-p** *port-number*\] \[**-I**
*IP-address*\] \[**-t** *timeout*\] **--tls-connect** **psk**
**--tls-psk-identity** *PSK-identity* **--tls-psk-file** *PSK-file*
\[**--tls-cipher13** *cipher-string*\] \[**--tls-cipher**
*cipher-string*\] **-k** *item-key*\
**zabbix\_get -h**\
**zabbix\_get -V** [ ]{#lbAD}

[comment]: # ({/60e7e93b-60e7e93b})

[comment]: # ({da08bc1a-da08bc1a})

## 描述

**zabbix\_get** 是一个命令行实用程序，用于从zabbix agent获取数据。 [ ]{#lbAE}

[comment]: # ({/da08bc1a-da08bc1a})

[comment]: # ({4ab1a759-4ab1a759})

## 选项

**-s**, **--host** *host-name-or-IP*  
指定主机的主机名或IP地址。

**-p**, **--port** *port-number*  
指定主机上运行的agent的端口号。默认值为10050。

**-I**, **--source-address** *IP-address*  
指定源IP地址。

**-t**, **--timeout** *seconds*  
指定超时。有效范围：1-30秒（默认值：30）

**-k**, **--key** *item-key*  
指定要为其检索值的项的key。

**--tls-connect** *value*  
如何连接到agent。值

[ ]{#lbAF}

[comment]: # ({/4ab1a759-4ab1a759})

[comment]: # ({465bc4c8-465bc4c8})

### 

  
**unencrypted**  
无加密连接（默认）

```{=html}
<!-- -->
```
  
**psk**  
使用TLS和预共享密钥进行连接

```{=html}
<!-- -->
```
  
**cert**  
使用TLS和证书进行连接

```{=html}
<!-- -->
```
**--tls-ca-file** *CA-file*  
包含用于对等证书验证的顶级CA证书的文件的完整路径名。

**--tls-crl-file** *CRL-file*  
包含已吊销证书的文件的完整路径名。

**--tls-agent-cert-issuer** *cert-issuer*  
允许的agent证书颁发者。

**--tls-agent-cert-subject** *cert-subject*  
允许的agent证书主题。

**--tls-cert-file** *cert-file*  
包含证书或证书链的文件的完整路径名。

**--tls-key-file** *key-file*  
包含私钥的文件的完整路径名。

**--tls-psk-identity** *PSK-identity*  
PSK标识字符串。

**--tls-psk-file** *PSK-file*  
包含预共享密钥的文件的完整路径名。

**--tls-cipher13** *cipher-string*  
OpenSSL 1.1.1或更新版本TLS 1.3的密码字符串。覆盖默认的密码套件选择条件。如果OpenSSL版本低于1.1.1，则此选项不可用。

**--tls-cipher** *cipher-string*  
GnuTLS优先级字符串（适用于TLS 1.2及以上版本）或OpenSSL密码字符串（仅适用于TLS 1.2）。覆盖默认的密码套件选择条件。

**-h**, **--help**  
显示本帮助信息然后退出。

**-V**, **--version**  
输出版本信息然后退出

[ ]{#lbAG}

[comment]: # ({/465bc4c8-465bc4c8})

[comment]: # ({c5e4d00b-c5e4d00b})

## 示例

**zabbix\_get -s 127.0.0.1 -p 10050 -k "system.cpu.load\[all,avg1\]"**\
**zabbix\_get -s 127.0.0.1 -p 10050 -k "system.cpu.load\[all,avg1\]"
--tls-connect cert --tls-ca-file /home/zabbix/zabbix\_ca\_file
--tls-agent-cert-issuer "CN=Signing CA,OU=IT operations,O=Example
Corp,DC=example,DC=com" --tls-agent-cert-subject "CN=server1,OU=IT
operations,O=Example Corp,DC=example,DC=com" --tls-cert-file
/home/zabbix/zabbix\_get.crt --tls-key-file
/home/zabbix/zabbix\_get.key\
zabbix\_get -s 127.0.0.1 -p 10050 -k "system.cpu.load\[all,avg1\]"
--tls-connect psk --tls-psk-identity "PSK ID Zabbix agentd"
--tls-psk-file /home/zabbix/zabbix\_agentd.psk** [ ]{#lbAH}

[comment]: # ({/c5e4d00b-c5e4d00b})

[comment]: # ({0ed7cca7-0ed7cca7})

## 另请参见

文档 <https://www.zabbix.com/manuals>

**[zabbix\_agentd](zabbix_agentd)**(8),
**[zabbix\_proxy](zabbix_proxy)**(8),
**[zabbix\_sender](zabbix_sender)**(1),
**[zabbix\_server](zabbix_server)**(8), **[zabbix\_js](zabbix_js)**(1),
**[zabbix\_agent2](zabbix_agent2)**(8),
**[zabbix\_web\_service](zabbix_web_service)**(8) [ ]{#lbAI}

[comment]: # ({/0ed7cca7-0ed7cca7})

[comment]: # ({3359cf74-aaed5529})

## 作者

Alexei Vladishev <[[\[email protected\]]{.__cf_email__
cfemail="254449405d655f4447474c5d0b464a48"}](/cdn-cgi/l/email-protection#eb8a878e93ab918a89898293c5888486)>

------------------------------------------------------------------------

[ ]{#index}

[comment]: # ({/3359cf74-aaed5529})

[comment]: # ({d77ae6f4-bdb17437})

## 索引

[NAME](#lbAB)

[SYNOPSIS](#lbAC)

[DESCRIPTION](#lbAD)

[OPTIONS](#lbAE)

[](#lbAF)

  

[EXAMPLES](#lbAG)

[SEE ALSO](#lbAH)

[AUTHOR](#lbAI)

------------------------------------------------------------------------

该文档是由[man2html](/cgi-bin/man/man2html)使用手册页创建的。
时间： 08:42:29 GMT, 6月 11, 2021

[comment]: # ({/d77ae6f4-bdb17437})
