ZABBIX_SENDER(1)

πŸ“¦
version 7.4.16 Β· 3 versions
, in alpine 3.24, arch rolling, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– NAME πŸ’–

zabbix_sender β€” the Zabbix sender utility πŸŽ€ (it lives in the General Commands Manual, section 1, and honestly? it's iconic)


✨ SYNOPSIS ✨

okay bestie, here's every single way you can call this thing. yes, all of them. no skipping πŸ’…

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] -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] -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] -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] -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] -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] -i input-file
zabbix_sender -h
zabbix_sender -V

🌈 DESCRIPTION 🌈

so zabbix_sender is a command line utility whose whole entire job is sending monitoring data to a Zabbix server or proxy. that's it. that's the vibe. πŸ¦‹

on the Zabbix server side you gotta create an item of type Zabbix trapper with a matching key first β€” like, the item has to already exist and be the trapper type, or this whole thing is giving nothing.

⚠️ also important bestie: incoming values will only be accepted from hosts listed in the Allowed hosts field for that item. no guest list, no entry. 🚫

πŸ‘‘ OPTIONS πŸ‘‘

here we go, all of them, in order, no cap πŸ’…

  • -c, --config config-file β€” use config-file. Zabbix sender reads its server details from the agentd configuration file. by default Zabbix sender does not read any configuration file at all. only these parameters are supported: Hostname, ServerActive, SourceIP, TLSConnect, TLSCAFile, TLSCRLFile, TLSServerCertIssuer, TLSServerCertSubject, TLSCertFile, TLSKeyFile, TLSPSKIdentity and TLSPSKFile. a Hostname defined through the HostnameItem parameter will not be picked up β€” in that case you gotta pass the hostname on the command line (see the -s option). all addresses defined in the agent ServerActive configuration parameter get used for sending data. and if sending a batch of data fails to one address, the following batches are not sent to that address. 🫢
  • -z, --zabbix-server server β€” hostname or IP address of the Zabbix server. if a host is monitored by a proxy, use the proxy hostname or IP address instead. when you use this together with --config, it overrides the ServerActive entries from the agentd configuration file. πŸ’«
  • -p, --port port β€” specify the port number of the Zabbix server trapper running on the server. default is 10051. when used together with --config, it overrides the port entries of the ServerActive parameter from the agentd configuration file. πŸ”₯
  • -I, --source-address IP-address β€” specify the source IP address. when used together with --config, it overrides the SourceIP parameter from the agentd configuration file. πŸŽ€
  • -t, --timeout seconds β€” specify timeout. valid range: 1-300 seconds (default: 60). ⏳
  • -s, --host host β€” specify the host name the item belongs to (as registered in the Zabbix frontend). host IP address and DNS name will not work, so don't even try it bestie. when used together with --config, it overrides the Hostname parameter from the agentd configuration file. 🌸
  • -k, --key key β€” specify the item key to send the value to. πŸ”‘
  • -o, --value value β€” specify the item value. πŸ“₯
  • -i, --input-file input-file β€” load values from the input file. specify - as input-file to read values from standard input. each line of the file contains whitespace-delimited: <hostname> <key> <value>. every value has to be on its own line. every line must contain 3 whitespace delimited entries: <hostname> <key> <value>, where "hostname" is the name of the monitored host as registered in the Zabbix frontend, "key" is the target item key, and "value" is the value to send. specify - as hostname to use the hostname from the agent configuration file or from the --host argument.

an example of a line of an input file:

"Linux DB3" db.connections 43

the value type must be correctly set in the item configuration of the Zabbix frontend. Zabbix sender will send up to 250 values in one connection. the contents of the input file must be in UTF-8 encoding. all values from the input file are sent in sequential order, top-down. entries must be formatted using these 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 a 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 only be used with the --input-file option.

each line of the input file must contain 4 whitespace delimited entries: <hostname> <key> <timestamp> <value>. the timestamp should be specified in Unix timestamp format. if the target item has triggers referencing it, all timestamps must be in an increasing order, otherwise the 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 only be used with the --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. ⚑
  • --tls-connect value β€” how to connect to the server or proxy. values:
    • unencrypted β€” connect without encryption (default)
    • psk β€” connect using TLS and a pre-shared key
    • cert β€” connect using TLS and a certificate
  • --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. overrides the default ciphersuite selection criteria. this option is not available if the 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). overrides 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. πŸŽ€

πŸ’€ EXIT STATUS πŸ’€

the exit status is 0 if the values were sent and all of them were successfully processed by the 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. 🫑


✨ EXAMPLES ✨

Okay bestie, let's see this in action. Here are the exact moves you can pull. πŸ’…


1. Sending a value with agent config

zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -k mysql.queries -o 342.45

Send 342.45 as the value for the mysql.queries item of the monitored host. Use the monitored host and Zabbix server defined in the agent configuration file. πŸŽ€


2. Sending a value with agent config and explicit host

zabbix_sender -c /etc/zabbix/zabbix_agentd.conf -s "Monitored Host" -k mysql.queries -o 342.45

Send 342.45 as the value for the mysql.queries item of the Monitored Host host using the Zabbix server defined in the agent configuration file. ✨


3. Sending values from a file

zabbix_sender -z 192.168.1.113 -i data_values.txt

Send values from the file data_values.txt to the Zabbix server with IP 192.168.1.113. Host names and keys are defined in the file. πŸ“


4. Sending a timestamped value from the command line

echo "- hw.serial.number 1287872261 SQ4321ASDF" | zabbix_sender -c /usr/local/etc/zabbix_agentd.conf -T -i -

Send a timestamped value from the command line to the Zabbix server specified in the agent configuration file. The dash in the input data indicates that the hostname should also be used from the same configuration file. ⏰


5. Sending an empty value

echo '"Zabbix server" trapper.item ""' | zabbix_sender -z 192.168.1.113 -p 10000 -i -

Send an empty value of an item to the Zabbix server with IP address 192.168.1.113 on port 10000 from the command line. Empty values must be indicated by empty double quotes. πŸ«™


6. Sending with TLS certificate

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 the mysql.queries item in the Monitored Host host to the server with IP 192.168.1.113 using TLS with a certificate. πŸ”


7. Sending with TLS PSK

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 the mysql.queries item in the Monitored Host host to the server with IP 192.168.1.113 using TLS with a pre-shared key (PSK). πŸ”‘


πŸ’– SEE ALSO πŸ’–

Like, go read the docs, bestie. πŸ“š

Documentation

zabbix_agentd(8), zabbix_get(1), zabbix_proxy(8), zabbix_server(8), zabbix_js(1), zabbix_agent2(8), zabbix_web_service(8)


And that's the whole vibe! This page is from Zabbix, dated 2022-01-06, and it's the ZABBIX_SENDER(1) manual. Stay iconic, bestie! πŸ’…βœ¨

πŸ“¦ where this page comes from