章节:用户命令 (1)
更新日期:2021-06-01
索引 Return to Main Contents
zabbix_get - Zabbix get 实用程序
zabbix_get -s 主机-name-or-IP [-p port-number] [-I
IP-address] [-t timeout] -k item-key
zabbix_get -s 主机-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 主机-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
zabbix_get 是一个命令行工具,用于从 Zabbix agent 获取数据。
-s, --host host-name-or-IP 指定 主机名 或 一个主机 的 IP 地址。
-p, --port 端口号 指定在主机上运行的agent的端口号。默认值为10050。
-I, --source-address IP地址 指定源IP地址。
-t, --timeout 秒数 指定超时时间。有效范围:1-30 秒(默认值:30)
-k, --key item-key 指定要检索值的 监控项 的键。
-P, --protocol 值 与 agent 通信时使用的协议。取值:
自动 使用 JSON 协议连接,回退并重试使用明文协议(默认)
JSON 使用JSON协议连接
plaintext 使用明文协议连接,仅发送 监控项 密钥(6.4.x 及更早版本)
--tls-connect 值 如何连接到 agent。值:
unencrypted
不加密连接(默认)
预共享密钥 使用TLS和预共享密钥进行连接
证书 使用TLS和证书进行连接
--tls-ca-file CA证书-file file的完整路径名,其中包含用于Top级别的CA证书 对等证书验证。
--tls-crl-file CRL-file 包含已吊销证书的file完整路径名。
--tls-agent-cert-issuer 证书颁发者 允许的agent证书颁发机构
--tls-agent-cert-subject 证书主题 允许的 agent 证书主题。
--tls-cert-file cert-file 包含证书或证书链的file完整路径名。
--tls-key-file key-file 包含私钥的file的完整路径名。
--tls-psk-identity PSK标识 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)。覆盖默认的密码套件选择标准。
-h,--help 显示此帮助信息并退出。
-V,--version 输出version信息并退出。
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
文档 https://www.zabbix.com/manuals
zabbix_agentd(8), zabbix_proxy(8), zabbix_sender(1), zabbix_server(8), zabbix_js(1), zabbix_agent2(8), zabbix_web_service(8)
本文档创建于:2021年6月11,08:42:29 GMT