Zabbix Documentation 2.2

3.04.04.45.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


manual:concepts:sender

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:concepts:sender [2015/09/30 14:54]
dimir [With value timestamps] add note on timestamp adjustment from trapper page
manual:concepts:sender [2017/09/14 07:35] (current)
martins-v trapper item is required to send in data with zabbix_sender
Line 6: Line 6:
  
 The utility is usually used in long running user scripts for periodical sending of availability and performance data. The utility is usually used in long running user scripts for periodical sending of availability and performance data.
 +
 +For sending results directly to Zabbix server or proxy, a [[:​manual/​config/​items/​itemtypes/​trapper|trapper item]] type must be configured.
  
 === Sending one value === === Sending one value ===
Line 16: Line 18:
  
   * z - Zabbix server host (IP address can be used as well)   * z - Zabbix server host (IP address can be used as well)
-  * s - monitored host name (as registered in Zabbix frontend)+  * s - technical name of monitored host (as registered in Zabbix frontend)
   * k - item key   * k - item key
   * o - value to send   * o - value to send
Line 22: Line 24:
 <note important>​If objects have whitespaces,​ these objects must be quoted using double quotes.</​note>​ <note important>​If objects have whitespaces,​ these objects must be quoted using double quotes.</​note>​
  
-See [[manpages:​zabbix_sender|Zabbix ​sender manpage]] ​for more information.+<note important>​Zabbix ​trapper process does not expand macros used in the item key in attempt to check corresponding item key existence ​for targeted host.</​note>​
  
-Zabbix sender ​accepts strings in UTF-8 encoding (for both UNIX-like systems and Windows).+See the [[manpages:​zabbix_sender|Zabbix sender ​manpage]] ​for more information.
  
 Zabbix sender on Windows can be run similarly: Zabbix sender on Windows can be run similarly:
Line 34: Line 36:
 === Sending many values === === Sending many values ===
  
-It is possible to specify an input file containing the values to be sent to Zabbix server. See option ​//<​nowiki>​--input-file</​nowiki>//​ in [[manpages:​zabbix_sender|Zabbix sender manpage]] on how to properly format the file.+It is possible to specify an input file containing the values to be sent to Zabbix server. 
 + 
 +See the //<​nowiki>​--input-file</​nowiki>// ​option ​in [[manpages:​zabbix_sender|Zabbix sender manpage]] on how to properly format the file.
  
 == Without value timestamps == == Without value timestamps ==
Line 44: Line 48:
   "​Zabbix server"​ db.status 0   "​Zabbix server"​ db.status 0
   "​Zabbix server"​ db.error "Linux DB3 down"   "​Zabbix server"​ db.error "Linux DB3 down"
- 
-Zabbix sender will batch the values specified in the input file at 250 values in one go (all values will be processed), for example: 
- 
-  # zabbix_sender -z 127.0.0.1 -i /​tmp/​trapper.txt ​ 
-  Info from server: "​Processed 250 Failed 0 Total 250 Seconds spent 0.002668"​ 
-  Info from server: "​Processed 50 Failed 0 Total 50 Seconds spent 0.000540"​ 
-  sent: 300; skipped: 0; total: 300 
- 
-All entries from an input file are sent in a sequential order top-down. ​ 
  
 == With value timestamps == == With value timestamps ==
Line 66: Line 61:
  
 <note important>​ <note important>​
-The timestamps specified in the input file will be adjusted to match server time. For instance, if the timestamp specified is "​10:​30:​50",​ the current time on ''​zabbix_sender''​'s machine is "​10:​40:​03",​ and the current time on Zabbix server'​s machine is "​10:​40:​05",​ then the item's value will be stored in the database with a timestamp of "​10:​30:​52"​.+The timestamps specified in the input file will be adjusted to match server time. For instance, if the timestamp specified is "​10:​30:​50",​ the current time on Zabbix sender's machine is "​10:​40:​03",​ and the current time on Zabbix server'​s machine is "​10:​40:​05",​ then the item's value will be stored in the database with a timestamp of "​10:​30:​52"​.
  
 Similarly, if a value is first sent to Zabbix proxy, which later sends it to Zabbix server, the timestamp will be first adjusted to match Zabbix proxy time, and then it will be adjusted to match Zabbix server time. Similarly, if a value is first sent to Zabbix proxy, which later sends it to Zabbix server, the timestamp will be first adjusted to match Zabbix proxy time, and then it will be adjusted to match Zabbix server time.
 </​note>​ </​note>​
 +
 +Zabbix sender accepts strings in UTF-8 encoding (for both UNIX-like systems and Windows) without byte order mark (BOM) first in the file.
 +
 == Quoting in the input file == == Quoting in the input file ==
  
Line 88: Line 86:
 |"​\nstatus:​\nfailed"​|\\ status:\\ failed| | |"​\nstatus:​\nfailed"​|\\ status:\\ failed| |
 |"​\n\n"​| | | |"​\n\n"​| | |
 +
 +== Example of the output ==
 +
 +Here is an example of sending 300 values from the input file:
 +
 +  # zabbix_sender -z 127.0.0.1 -i /​tmp/​trapper.txt ​
 +  Info from server: "​Processed 250 Failed 0 Total 250 Seconds spent 0.002668"​
 +  Info from server: "​Processed 50 Failed 0 Total 50 Seconds spent 0.000540"​
 +  sent: 300; skipped: 0; total: 300
  
 <​note>​Zabbix sender will terminate if invalid (not following //​parameter=value//​ notation) parameter entry is present in specified configuration file.</​note>​ <​note>​Zabbix sender will terminate if invalid (not following //​parameter=value//​ notation) parameter entry is present in specified configuration file.</​note>​