Linux command
zabbix_get 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Get CPU load from agent
zabbix_get -s [192.168.1.10] -k "system.cpu.load[all,avg1]"
Get data from specific port
zabbix_get -s [host] -p [10050] -k "[agent.version]"
Get disk free space
zabbix_get -s [host] -k "vfs.fs.size[/,free]"
Get with timeout
zabbix_get -s [host] -t [60] -k "[key]"
Get using TLS PSK
zabbix_get -s [host] --tls-connect psk --tls-psk-identity [id] --tls-psk-file [psk.txt] -k "[key]"
说明
zabbix_get retrieves data from Zabbix agents for testing and troubleshooting. It performs passive checks, querying agents for specific item values using the same protocol as Zabbix server. The tool helps verify agent configuration and connectivity before adding hosts to monitoring. The requesting host must be listed in the agent's Server configuration parameter. Common use cases include testing new item keys, verifying agent responses, and debugging collection issues without accessing the Zabbix frontend.
参数
- -s, --host _host_
- Host name or IP address of Zabbix agent.
- -p, --port _port_
- Port number (default: 10050).
- -k, --key _key_
- Item key to retrieve.
- -I, --source-address _ip_
- Source IP address for connection.
- -t, --timeout _seconds_
- Timeout (1-600, default: 30).
- --tls-connect _mode_
- Connection type: unencrypted, psk, or cert.
- --tls-psk-identity _id_
- PSK identity string.
- --tls-psk-file _file_
- File containing pre-shared key.
- -P, --protocol _value_
- Communication protocol: auto (default, JSON with plaintext fallback), json, or plaintext (for agents 6.4.x and older).
- --tls-ca-file _file_
- Full path to file containing top-level CA certificates for peer certificate verification.
- --tls-cert-file _file_
- Full path to file containing the client certificate.
- --tls-key-file _file_
- Full path to file containing the private key.
- -h, --help
- Display help information.
- -V, --version
- Display version.
FAQ
What is the zabbix_get command used for?
zabbix_get retrieves data from Zabbix agents for testing and troubleshooting. It performs passive checks, querying agents for specific item values using the same protocol as Zabbix server. The tool helps verify agent configuration and connectivity before adding hosts to monitoring. The requesting host must be listed in the agent's Server configuration parameter. Common use cases include testing new item keys, verifying agent responses, and debugging collection issues without accessing the Zabbix frontend.
How do I run a basic zabbix_get example?
Run `zabbix_get -s [192.168.1.10] -k "system.cpu.load[all,avg1]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -s, --host _host_ do in zabbix_get?
Host name or IP address of Zabbix agent.