Zabbix Documentation 2.2

3.04.05.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.24.4Guidelines

User Tools

Site Tools


manpages:zabbix_sender

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

manpages:zabbix_sender [2019/04/04 07:10]
manpages:zabbix_sender [2017/10/25 09:43] (current)
natalja.cernohajeva Added a sentence about acceptance of timestamped values in maintenance period (-T, --with-timestamps section)
Line 1: Line 1:
 +<​HTML><​HEAD><​TITLE>​Man page of ZABBIX_SENDER</​TITLE>​
 +</​HEAD><​BODY>​
 +<​H1>​ZABBIX_SENDER</​H1>​
 +Section: Maintenance Commands (8)<​BR>​Updated:​ 16 October 2015<​BR><​A HREF="#​index">​Index</​A>​
 +<A HREF="/​documentation/​2.2/​manpages">​Return to Main Contents</​A><​HR>​
  
 +
 +
 +<A NAME="​lbAB">&​nbsp;</​A>​
 +<​H2>​NAME</​H2>​
 +
 +zabbix_sender - Zabbix sender utility.
 +<A NAME="​lbAC">&​nbsp;</​A>​
 +<​H2>​SYNOPSIS</​H2>​
 +
 +<​B>​zabbix_sender [-hpzvIV] {-kso | [-T] -i </​B><​I>&​lt;​inputfile&​gt;</​I><​B>​} [-c </​B><​I>&​lt;​config-file&​gt;</​I><​B>​]</​B>​
 +
 +<A NAME="​lbAD">&​nbsp;</​A>​
 +<​H2>​DESCRIPTION</​H2>​
 +
 +<​B>​zabbix_sender</​B>​
 +
 +is a command line utility for sending performance data to a remote Zabbix server. On the Zabbix server an item of type <​B>​Zabbix trapper</​B>​ should be created with corresponding key. Note that incoming values will only be accepted from hosts specified in <​B>​Allowed hosts</​B>​ field for this item.
 +<P>
 +<A NAME="​lbAE">&​nbsp;</​A>​
 +<​H3>​Options</​H3>​
 +
 +<DL COMPACT>
 +<​DT>​-c,​ --config <​I>&​lt;​config-file&​gt;</​I><​DD>​
 +Use <​I>​config-file</​I>​. Zabbix sender reads server details from the agent configuration file. By default Zabbix sender does not read any configuration file.
 +Absolute path should be specified. Only parameters <​B>​Hostname</​B>,​ <​B>​ServerActive</​B>​ and <​B>​SourceIP</​B>​ are supported. First entry from the <​B>​ServerActive</​B>​ parameter is used.
 +<​DT>​-z,​ --zabbix-server <​I>&​lt;​server&​gt;</​I><​DD>​
 +Hostname or IP address of Zabbix server. If a host is monitored by a proxy, proxy hostname or IP address should be used instead.
 +<​DT>​-p,​ --port <​I>&​lt;​port&​gt;</​I><​DD>​
 +Specify port number of server trapper running on the server. Default is 10051.
 +<​DT>​-s,​ --host <​I>&​lt;​host&​gt;</​I><​DD>​
 +Specify agent hostname as registered in Zabbix frontend. Host IP address and DNS name will not work.
 +<​DT>​-I,​ --source-address <​I>&​lt;​IP&​gt;</​I><​DD>​
 +Specify source IP address.
 +<​DT>​-k,​ --key <​I>&​lt;​key&​gt;</​I><​DD>​
 +Specify item key to send value to.
 +<​DT>​-o,​ --value <​I>&​lt;​value&​gt;</​I><​DD>​
 +Specify value.
 +<​DT>​-i,​ --input-file <​I>&​lt;​inputfile&​gt;</​I><​DD>​
 +<P>
 +Load values from input file. Specify <​B>​-</​B>​ as &​lt;​inputfile&​gt;​ to read values from standard input.
 +<P>
 +Each value must be specified on its own line. Each line must contain 3 whitespace delimited entries: <​B>&​lt;​hostname&​gt;​ &​lt;​key&​gt;​ &​lt;​value&​gt;</​B>,​ where &​quot;​hostname&​quot;​ is the name of monitored host as registered in Zabbix frontend, &​quot;​key&​quot;​ is target item key and &​quot;​value&​quot;​ - the value to send. Specify <​B>​-</​B>​ as <​B>&​lt;​hostname&​gt;</​B>​ to use hostname from agent configuration file or from <​B>​--host</​B>​ argument.
 +<P>
 +An example of a line of an input file:
 +<P>
 +<B> &​quot;​Linux DB3&​quot;​ db.connections 43</​B>​
 +<P>
 +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:
 +<P>
 +<DL COMPACT><​DT><​DD>​
 +<DL COMPACT><​DT><​DD>​
 +<DL COMPACT>
 +<​DT>&​bull;<​DD>​
 +Quoted and non-quoted entries are supported.
 +<​DT>&​bull;<​DD>​
 +Double-quote is the quoting character.
 +<​DT>&​bull;<​DD>​
 +Entries with whitespace must be quoted.
 +<​DT>&​bull;<​DD>​
 +Double-quote and backslash characters inside quoted entry must be escaped with a backslash.
 +<​DT>&​bull;<​DD>​
 +Escaping is not supported in non-quoted entries.
 +<​DT>&​bull;<​DD>​
 +Linefeed escape sequences (\n) are supported in quoted strings.
 +<​DT>&​bull;<​DD>​
 +Linefeed escape sequences are trimmed from the end of an entry.
 +</DL>
 +</DL>
 +
 +<P>
 +</DL>
 +
 +<P>
 +<​DT>​-T,​ --with-timestamps<​DD>​
 +<P>
 +This option can be only used with <​B>​--input-file</​B>​ option.
 +<P>
 +Each line of the input file must contain 4 whitespace delimited entries: <​B>&​lt;​hostname&​gt;​ &​lt;​key&​gt;​ &​lt;​timestamp&​gt;​ &​lt;​value&​gt;</​B>​. 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.
 +<P>
 +An example of a line of the input file:
 +<P>
 +<B> &​quot;​Linux DB3&​quot;​ db.connections 1429533600 43</​B>​
 +<P>
 +For more details please see option <​B>​--input-file</​B>​.
 +<P>If a timestamped value is sent for a host that is in a “no data” <A HREF="/​documentation/​2.2/​manual/​maintenance">​maintenance</​A>​ 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.
 +<P>
 +<​DT>​-r,​ --real-time<​DD>​
 +Send values one by one as soon as they are received. This can be used when reading from standard input.
 +<​DT>​-v,​ --verbose<​DD>​
 +Verbose mode, -vv for more details.
 +<​DT>​-h,​ --help<​DD>​
 +Display this help and exit.
 +<​DT>​-V,​ --version<​DD>​
 +Output version information and exit.
 +<P>
 +</DL>
 +<A NAME="​lbAF">&​nbsp;</​A>​
 +<​H2>​EXIT STATUS</​H2>​
 +
 +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.
 +<P>
 +<A NAME="​lbAG">&​nbsp;</​A>​
 +<​H2>​EXAMPLES</​H2>​
 +
 +<​B>​zabbix_sender -c /​etc/​zabbix/​zabbix_agentd.conf -s Monitored Host -k mysql.queries -o 342.45</​B>​
 +
 +<P>
 +Send <​B>​342.45</​B>​ as the value for <​B>​mysql.queries</​B>​ key in <​B>​Monitored Host</​B>​ host using Zabbix server defined in agent daemon configuration file.
 +<P>
 +<​B>​zabbix_sender -z 192.168.1.113 -i data_values.txt</​B>​
 +
 +<P>
 +Send values from file <​B>​data_values.txt</​B>​ to server with IP <​B>​192.168.1.113</​B>​. Host names and keys are defined in the file.
 +<P>
 +<​B>​echo - hw.serial.number 1287872261 SQ4321ASDF | zabbix_sender -c /​usr/​local/​etc/​zabbix_agentd.conf -T -i -</B>
 +
 +<P>
 +Send a timestamped value from the commandline to Zabbix server, specified in the agent daemon configuration file. Dash in the input data indicates that hostname also should be used from the same configuration file.
 +<P>
 +<​B>​echo '​Zabbix server trapper.item ' | zabbix_sender -z 192.168.1.113 -p 10000 -i -</B>
 +
 +<P>
 +Send empty value of an item to the Zabbix server with IP address <​B>​192.168.1.113</​B>​ on port <​B>​10000</​B>​ from the commandline. Empty values must be indicated by double empty double quotes.
 +<P>
 +<A NAME="​lbAH">&​nbsp;</​A>​
 +<​H2>​SEE ALSO</​H2>​
 +
 +<​B><​A HREF="​zabbix_agentd">​zabbix_agentd</​A></​B>​(8),​
 +
 +<​B><​A HREF="​zabbix_get">​zabbix_get</​A></​B>​(8),​
 +
 +<​B><​A HREF="​zabbix_proxy">​zabbix_proxy</​A></​B>​(8),​
 +
 +<​B><​A HREF="​zabbix_server">​zabbix_server</​A></​B>​(8)
 +
 +<A NAME="​lbAI">&​nbsp;</​A>​
 +<​H2>​AUTHOR</​H2>​
 +
 +Alexei Vladishev &​lt;<​A HREF="​mailto:​[email protected]">​[email protected]</​A>&​gt;​
 +<P>
 +
 +<HR>
 +<A NAME="​index">&​nbsp;</​A><​H2>​Index</​H2>​
 +<DL>
 +<​DT><​A HREF="#​lbAB">​NAME</​A><​DD>​
 +<​DT><​A HREF="#​lbAC">​SYNOPSIS</​A><​DD>​
 +<​DT><​A HREF="#​lbAD">​DESCRIPTION</​A><​DD>​
 +<DL>
 +<​DT><​A HREF="#​lbAE">​Options</​A><​DD>​
 +</DL>
 +<​DT><​A HREF="#​lbAF">​EXIT STATUS</​A><​DD>​
 +<​DT><​A HREF="#​lbAG">​EXAMPLES</​A><​DD>​
 +<​DT><​A HREF="#​lbAH">​SEE ALSO</​A><​DD>​
 +<​DT><​A HREF="#​lbAI">​AUTHOR</​A><​DD>​
 +</DL>
 +<HR>
 +This document was created by
 +<A HREF="/​cgi-bin/​man/​man2html">​man2html</​A>,​
 +using the manual pages.<​BR>​
 +Time: 09:44:44 GMT, February 14, 2017
 +</​BODY>​
 +</​HTML>​