logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

zabbix_sender - Zabbix sender utility

Description

zabbix_sender is a command line utility for sending monitoring data to Zabbix server or proxy.  On the
       Zabbix server an item of type Zabbixtrapper should be created with corresponding key.  Note that
       incoming values will only be accepted from hosts specified in Allowedhosts field for this item.

Examples

zabbix_sender-c/etc/zabbix/zabbix_agentd.conf-kmysql.queries-o342.45
              Send 342.45 as the value for mysql.queries item of monitored host. Use monitored host  and  Zabbix
              server defined in agent configuration file.

       zabbix_sender-c/etc/zabbix/zabbix_agentd.conf-s"MonitoredHost"-kmysql.queries-o342.45
              Send 342.45 as the value for mysql.queries item of MonitoredHost host using Zabbix server defined
              in agent configuration file.

       zabbix_sender-z192.168.1.113-idata_values.txt
              Send values from file data_values.txt to Zabbix server with IP 192.168.1.113.  Host names and keys
              are defined in the file.

       echo"-hw.serial.number1287872261SQ4321ASDF"|zabbix_sender-c/etc/zabbix_agentd.conf-T-i-
              Send  a  timestamped  value  from  the  commandline  to  Zabbix  server,  specified  in  the agent
              configuration file.  Dash in the input data indicates that hostname also should be used  from  the
              same configuration file.

       echo'"Zabbixserver"trapper.item""'|zabbix_sender-z192.168.1.113-p10000-i-
              Send  empty value of an item to the Zabbix server with IP address 192.168.1.113 on port 10000 from
              the commandline.  Empty values must be indicated by empty double quotes.

       zabbix_sender-z192.168.1.113-s"MonitoredHost"-kmysql.queries-o342.45--tls-connectcert--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  mysql.queries  item  in  MonitoredHost  host  to  server  with  IP
              192.168.1.113 using TLS with certificate.

       zabbix_sender-z192.168.1.113-s"MonitoredHost"-kmysql.queries-o342.45--tls-connectpsk--tls-psk-identity"PSKIDZabbixagentd"--tls-psk-file/home/zabbix/zabbix_agentd.psk
              Send 342.45 as the value for  mysql.queries  item  in  MonitoredHost  host  to  server  with  IP
              192.168.1.113 using TLS with pre-shared key (PSK).

Exit Status

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

Name

       zabbix_sender - Zabbix sender utility

Options

-c, --configconfig-file
              Use  config-file.   Zabbixsender  reads  server  details from the agentd configuration file.  By
              default  Zabbixsender  does  not  read  any  configuration  file.   Only  parameters   Hostname,
              ServerActive,     SourceIP,     TLSConnect,     TLSCAFile,     TLSCRLFile,    TLSServerCertIssuer,
              TLSServerCertSubject,  TLSCertFile,  TLSKeyFile,  TLSPSKIdentity  and  TLSPSKFile  are  supported.
              Hostname  defined  through HostnameItem parameter will not be picked up, in this case the hostname
              should be specified via command line  (see  -s  option).   All  addresses  defined  in  the  agent
              ServerActive configuration parameter are used for sending data.  If sending of batch data fails to
              one address, the following batches are not sent to this address.

       -z, --zabbix-serverserver
              Hostname  or IP address of Zabbix server.  If a host is monitored by a proxy, proxy hostname or IP
              address should be used instead.  When used  together  with  --config,  overrides  the  entries  of
              ServerActive parameter specified in agentd configuration file.

       -p, --portport
              Specify  port number of Zabbix server trapper running on the server.  Default is 10051.  When used
              together with --config, overrides the port entries of ServerActive parameter specified  in  agentd
              configuration file.

       -I, --source-addressIP-address
              Specify  source  IP  address.   When  used  together  with  --config, overrides SourceIP parameter
              specified in agentd configuration file.

       -t, --timeoutseconds
              Specify timeout. Valid range: 1-300 seconds (default: 60)

       -s, --hosthost
              Specify host name the item belongs to (as registered in Zabbix frontend).  Host IP address and DNS
              name will not work.  When used together with --config, overrides Hostname parameter  specified  in
              agentd configuration file.

       -k, --keykey
              Specify item key to send value to.

       -o, --valuevalue
              Specify item value.

       -i, --input-fileinput-file
              Load  values from input file.  Specify - as <input-file> to read values from standard input.  Each
              line of file contains  whitespace  delimited:  <hostname><key><value>.   Each  value  must  be
              specified  on  its  own  line.   Each line must contain 3 whitespace delimited entries: <hostname><key><value>, where "hostname" is the name of monitored host as registered  in  Zabbix  frontend,
              "key"  is target item key and "value" - the value to send. Specify - as <hostname> to use hostname
              from agent configuration file or from --host argument.

              An example of a line of an input file:

               "LinuxDB3"db.connections43

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

              Each  line  of  the  input  file  must  contain  4  whitespace delimited entries: <hostname><key><timestamp><value>.  Timestamp should be specified in Unix timestamp format.  If target item  has
              triggers  referencing  it,  all  timestamps  must  be  in  an  increasing  order,  otherwise event
              calculation will not be correct.

              An example of a line of the input file:

               "LinuxDB3"db.connections142953360043

              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 be only used with --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:

               "LinuxDB3"db.connections1429533600740256143

              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-connectvalue
              How to connect to 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-fileCA-file
              Full  pathname  of  a  file  containing  the  top-level  CA(s)  certificates  for peer certificate
              verification.

       --tls-crl-fileCRL-file
              Full pathname of a file containing revoked certificates.

       --tls-server-cert-issuercert-issuer
              Allowed server certificate issuer.

       --tls-server-cert-subjectcert-subject
              Allowed server certificate subject.

       --tls-cert-filecert-file
              Full pathname of a file containing the certificate or certificate chain.

       --tls-key-filekey-file
              Full pathname of a file containing the private key.

       --tls-psk-identityPSK-identity
              PSK-identity string.

       --tls-psk-filePSK-file
              Full pathname of a file containing the pre-shared key.

       --tls-cipher13cipher-string
              Cipher string for OpenSSL 1.1.1 or newer for TLS 1.3. Override the default  ciphersuite  selection
              criteria. This option is not available if OpenSSL version is less than 1.1.1.

       --tls-ciphercipher-string
              GnuTLS  priority string (for TLS 1.2 and up) or OpenSSL cipher string (only for TLS 1.2). Override
              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.

See Also

       Documentation

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

Zabbix                                             2022-01-06                                   ZABBIX_SENDER(1)

Synopsis

zabbix_sender [-v] -zserver [-pport] [-IIP-address] [-ttimeout] -shost-kkey-ovaluezabbix_sender [-v] -zserver [-pport] [-IIP-address] [-ttimeout] [-shost] [-T] [-N] [-r] -iinput-filezabbix_sender [-v] -cconfig-file [-zserver] [-pport] [-IIP-address] [-ttimeout] [-shost] -kkey-ovaluezabbix_sender [-v] -cconfig-file [-zserver] [-pport] [-IIP-address] [-ttimeout] [-shost] [-T] [-N]
       [-r] -iinput-filezabbix_sender [-v] -zserver [-pport] [-IIP-address] [-ttimeout] -shost--tls-connectcert--tls-ca-fileCA-file [--tls-crl-fileCRL-file] [--tls-server-cert-issuercert-issuer]
       [--tls-server-cert-subjectcert-subject] --tls-cert-filecert-file--tls-key-filekey-file
       [--tls-cipher13cipher-string] [--tls-ciphercipher-string] -kkey-ovaluezabbix_sender [-v] -zserver [-pport] [-IIP-address] [-ttimeout] [-shost] --tls-connectcert--tls-ca-fileCA-file [--tls-crl-fileCRL-file] [--tls-server-cert-issuercert-issuer]
       [--tls-server-cert-subjectcert-subject] --tls-cert-filecert-file--tls-key-filekey-file
       [--tls-cipher13cipher-string] [--tls-ciphercipher-string] [-T] [-N] [-r] -iinput-filezabbix_sender [-v] -cconfig-file [-zserver] [-pport] [-IIP-address] [-ttimeout] [-shost]
       --tls-connectcert--tls-ca-fileCA-file [--tls-crl-fileCRL-file] [--tls-server-cert-issuercert-issuer]
       [--tls-server-cert-subjectcert-subject] --tls-cert-filecert-file--tls-key-filekey-file
       [--tls-cipher13cipher-string] [--tls-ciphercipher-string] -kkey-ovaluezabbix_sender [-v] -cconfig-file [-zserver] [-pport] [-IIP-address] [-ttimeout] [-shost]
       --tls-connectcert--tls-ca-fileCA-file [--tls-crl-fileCRL-file] [--tls-server-cert-issuercert-issuer]
       [--tls-server-cert-subjectcert-subject] --tls-cert-filecert-file--tls-key-filekey-file
       [--tls-cipher13cipher-string] [--tls-ciphercipher-string] [-T] [-N] [-r] -iinput-filezabbix_sender [-v] -zserver [-pport] [-IIP-address] [-ttimeout] -shost--tls-connectpsk--tls-psk-identityPSK-identity--tls-psk-filePSK-file [--tls-cipher13cipher-string] [--tls-ciphercipher-string] -kkey-ovaluezabbix_sender [-v] -zserver [-pport] [-IIP-address] [-ttimeout] [-shost] --tls-connectpsk--tls-psk-identityPSK-identity--tls-psk-filePSK-file [--tls-cipher13cipher-string] [--tls-ciphercipher-string] [-T] [-N] [-r] -iinput-filezabbix_sender [-v] -cconfig-file [-zserver] [-pport] [-IIP-address] [-ttimeout] [-shost]
       --tls-connectpsk--tls-psk-identityPSK-identity--tls-psk-filePSK-file [--tls-cipher13cipher-string]
       [--tls-ciphercipher-string] -kkey-ovaluezabbix_sender [-v] -cconfig-file [-zserver] [-pport] [-IIP-address] [-ttimeout] [-shost]
       --tls-connectpsk--tls-psk-identityPSK-identity--tls-psk-filePSK-file [--tls-cipher13cipher-string]
       [--tls-ciphercipher-string] [-T] [-N] [-r] -iinput-filezabbix_sender-hzabbix_sender-V

See Also