Skip to content


 Zabbix
 Grafana
 Prometheus
 Threejs and TypeScript
 SocketIO and TypeScript
 Blender Topological Earth
 Sweet Home 3D
 Design Patterns Python
 Design Patterns TypeScript
   
 Course Coupon Codes
Three.js and TypeScript
Kindle Edition
$9.99 $14.99 Paperback 
$29.99 $34.99




Design Patterns in TypeScript
Kindle Edition
$9.99 $14.99 Paperback
$19.99 $24.99




Design Patterns in Python
Kindle Edition
$9.99 $14.99 Paperback
$19.99 $24.99




Using the Zabbix Get Command

Video Lecture

Using the 'Zabbix Get' Command Using the 'Zabbix Get' Command Using the Zabbix Get Command

Description

zabbix_get is a command line utility for getting data from Zabbix agents.

To install on ubuntu,

sudo apt install zabbix-get

For help use

zabbix_get -h

Try

zabbix_get -s <host-name-or-IP> -p 10050 -k agent.ping
zabbix_get -s <host-name-or-IP> -p 10050 -k agent.version
zabbix_get -s <host-name-or-IP> -p 10050 -k agent.hostname
zabbix_get -s <host-name-or-IP> -p 10050 -k system.cpu.load[all,avg1]

Note

zabbix_get executes like a passive check, so the hostname of the server running the command also needs to be listed in the Server parameter in the configuration file for the host being queried.

Also,

If you are using psk encryption you will need to also enter the psk information, or add unencrypted to the options for TLSAccept in the agents configuration file on the host being queried.

Usage

zabbix_get -s host-name-or-IP [-p port-number] [-I IP-address] -k item-key
zabbix_get -s host-name-or-IP [-p port-number] [-I IP-address]
                --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]
                --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

Example Python Script

1
2
import subprocess
subprocess.call(["zabbix_get", "-s", "<host-name-or-IP>", "-p", "10050", "-k", "agent.version"])

Troubleshooting

If you get the error, "Check access restrictions in Zabbix agent configuration" then. Zabbix_get executes like a passive check, so the server running the command also needs to be listed in the Server parameter in the configuration file for the host being queried.

If your agent accepts psk encryption, the ensure you also send the psk parameters in your zabbix-get command. Or add the option unencrypted to the TLSAccept parameter in the configuration file for the host being queried.

It is not necessary to set enableRemoteCommands=1 or modify the DenyKey or AllowKey parameters.

Zabbix Get