manual:appendix:protocols:real_time_export

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:appendix:protocols:real_time_export [2018/03/13 10:50]
martins-v adding details of exported information - events
manual:appendix:protocols:real_time_export [2021/03/26 11:23] (current)
martins-v fixing incorrect numeric float example (ZBX-19162)
Line 1: Line 1:
 ==== 5 Real-time export protocol ==== ==== 5 Real-time export protocol ====
  
-[[:​manual/​appendix/​install/​real_time_export|Real-time exporting]] of trigger events, item values and trends is supported ​in a newline-delimited JSON format. Exporting is done into files, where each line of the export file is a JSON object. ​+This section presents details of the [[:​manual/​appendix/​install/​real_time_export|real-time export]] protocol ​in a newline-delimited JSON format ​for: 
 + 
 +  * [[#​trigger_events|trigger events]] 
 +  * [[#​item_values|item values]] 
 +  * [[#​trends|trends]] 
 + 
 +All files have a .ndjson extension. Each line of the export file is a JSON object. ​
  
 === Trigger events === === Trigger events ===
  
-The following information is exported:+The following information is exported ​for a problem event:
  
 ^Field ​ ^^^Type ​ ^Description ​ ^ ^Field ​ ^^^Type ​ ^Description ​ ^
Line 14: Line 20:
 |//​tags// ​   |||array ​ |List of problem tags (can be empty). ​ | |//​tags// ​   |||array ​ |List of problem tags (can be empty). ​ |
 ^            |-  ||object ​ |   | ^            |-  ||object ​ |   |
-           ^|//​tag// ​  ​|string ​ |Tag name.  | +        ​ |//​tag// ​  ​|string ​ |Tag name.  | 
-           ^|//​value// ​  ​|string ​ |Tag value (can be empty). ​  |+        ​ |//​value// ​  ​|string ​ |Tag value (can be empty). ​  |
 |//​name// ​   |||string ​ |Problem event name.  | |//​name// ​   |||string ​ |Problem event name.  |
 |//​clock// ​  ​|||number ​ |Number of seconds since Epoch to the moment when problem was detected (integer part). ​ | |//​clock// ​  ​|||number ​ |Number of seconds since Epoch to the moment when problem was detected (integer part). ​ |
-|//​ns// ​     |||number ​ |Number of nanoseconds to be added to clock to get a precise problem detection time.  | +|//​ns// ​     |||number ​ |Number of nanoseconds to be added to ''​clock'' ​to get a precise problem detection time.  | 
-|//​eventid//​ |||number ​ |Corresponding ​event ID, needed to correlate problem detection and resolution |+|//​eventid//​ |||number ​ |Problem ​event ID.|
 |//​value// ​  ​|||number ​ |1 (always). ​ | |//​value// ​  ​|||number ​ |1 (always). ​ |
 +
 +The following information is exported for a recovery event:
 +
 +^Field ​ ^Type  ^Description ​ ^
 +|//​clock// ​    ​|number ​ |Number of seconds since Epoch to the moment when problem was resolved (integer part). ​ |
 +|//​ns// ​       |number ​ |Number of nanoseconds to be added to ''​clock''​ to get a precise problem resolution time.  |
 +|//​eventid// ​  ​|number ​ |Recovery event ID.  |
 +|//​p_eventid//​ |number ​ |Problem event ID.  |
 +|//​value// ​    ​|number ​ |0 (always). ​ |
  
 == Examples == == Examples ==
Line 46: Line 61:
 === Item values === === Item values ===
  
-The following information is exported:+The following information is exported ​for a collected item value: 
 + 
 +^Field ​ ^^Type ​ ^Description ​ ^ 
 +|//​host// ​      ​||string ​  ​|Visible host name of the item host.  | 
 +|//​groups// ​    ​||array ​ |List of host groups of the item host; there should be at least one element in array. ​ | 
 +^               ​|- ​ |string ​ |Host group name.  | 
 +|//​applications// ​ ||array ​ |List of the item applications;​ empty if there are none.  | 
 +^               ​|- ​ |string ​ |Application name.   | 
 +|//​itemid// ​    ​||number ​ |Item ID.  | 
 +|//​name// ​      ​||string ​ |Visible item name.  | 
 +|//​clock// ​     ||number ​ |Number of seconds since Epoch to the moment when value was collected (integer part). ​ | 
 +|//​ns// ​        ​||number ​ |Number of nanoseconds to be added to ''​clock''​ to get a precise value collection time.  | 
 +|//​timestamp//​\\ (//Log// only)  ||number ​ |0 if not available. ​ | 
 +|//​source//​\\ (//Log// only)     ​||string ​ |Empty string if not available. ​ | 
 +|//​severity//​\\ (//Log// only)   ​||number ​ |0 if not available. ​ | 
 +|//​eventid//​\\ (//Log// only) ||number ​ |0 if not available. ​ | 
 +|//​value// ​     ||number (for numeric items) or\\ string (for text items) ​ |Collected item value. ​ |
  
 == Examples == == Examples ==
  
-Numeric (unsigned)+Numeric (unsigned) ​value:
  
   {"​host":"​Host B","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​Zabbix Agent","​Availability"​],"​itemid":​3,"​name":"​Agent availability","​clock":​1519304285,"​ns":​123456789,"​value":​1}   {"​host":"​Host B","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​Zabbix Agent","​Availability"​],"​itemid":​3,"​name":"​Agent availability","​clock":​1519304285,"​ns":​123456789,"​value":​1}
  
-Numeric (float)+Numeric (float) ​value:
  
-  {"​host":"​Host B","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​CPU","​Performance"​],"​itemid":​4,"​name":"​CPU Load","​clock":​1519304285,"​ns":​123456789,"​value":​"0.1"}+  {"​host":"​Host B","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​CPU","​Performance"​],"​itemid":​4,"​name":"​CPU Load","​clock":​1519304285,"​ns":​123456789,"​value":​0.1}
  
-Character, text+Character, text value:
  
   {"​host":"​Host B","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​Zabbix Agent","​Installed software versions"​],"​itemid":​2,"​name":"​Agent version","​clock":​1519304285,"​ns":​123456789,"​value":"​3.4.4"​}   {"​host":"​Host B","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​Zabbix Agent","​Installed software versions"​],"​itemid":​2,"​name":"​Agent version","​clock":​1519304285,"​ns":​123456789,"​value":"​3.4.4"​}
  
-Log+Log value:
  
-  {"​host":"​Host A","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​Log files","​Critical"​],"​itemid":​1,"​name":"​Messages in log file","​clock":​1519304285,"​ns":​123456789,"​timestamp":​1519304285,"​source":"","​severity":​0,"​logeventid":​0,"​value":"​log file message"​}+  {"​host":"​Host A","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​Log files","​Critical"​],"​itemid":​1,"​name":"​Messages in log file","​clock":​1519304285,"​ns":​123456789,"​timestamp":​1519304285,"​source":"","​severity":​0,"​eventid":​0,"​value":"​log file message"​}
  
 === Trends === === Trends ===
  
-The following information is exported:+The following information is exported ​for a calculated trend value: 
 + 
 +^Field ​ ^^Type ​ ^Description ​ ^ 
 +|//​host// ​      ​||string ​  ​|Visible host name of the item host.  | 
 +|//​groups// ​    ​||array ​ |List of host groups of the item host; there should be at least one element in array. ​ | 
 +^               ​|- ​ |string ​ |Host group name.  | 
 +|//​applications// ​ ||array ​ |List of the item applications;​ empty if there are none.  | 
 +^               ​|- ​ |string ​ |Application name.   | 
 +|//​itemid// ​    ​||number ​ |Item ID.  | 
 +|//​name// ​      ​||string ​ |Visible item name.  | 
 +|//​clock// ​     ||number ​ |Number of seconds since Epoch to the moment when value was collected (integer part). ​ | 
 +|//​count// ​     ||number ​ |Number of values collected for a given hour.  | 
 +|//​min// ​       ||number ​ |Minimum item value for a given hour.  | 
 +|//​avg// ​       ||number ​ |Average item value for a given hour.  | 
 +|//​max// ​       ||number ​ |Maximum item value for a given hour.  |
  
 == Examples == == Examples ==
  
-Numeric (unsigned)+Numeric (unsigned) ​value:
  
   {"​host":"​Host B","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​Zabbix Agent","​Availability"​],"​itemid":​3,"​name":"​Agent availability","​clock":​1519311600,"​count":​60,"​min":​1,"​avg":​1,"​max":​1}   {"​host":"​Host B","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​Zabbix Agent","​Availability"​],"​itemid":​3,"​name":"​Agent availability","​clock":​1519311600,"​count":​60,"​min":​1,"​avg":​1,"​max":​1}
  
-Numeric (float)+Numeric (float) ​value:
  
   {"​host":"​Host B","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​CPU","​Performance"​],"​itemid":​4,"​name":"​CPU Load","​clock":​1519311600,"​count":​60,"​min":​0.01,"​avg":​0.15,"​max":​1.5}   {"​host":"​Host B","​groups":​["​Group X","​Group Y","​Group Z"​],"​applications":​["​CPU","​Performance"​],"​itemid":​4,"​name":"​CPU Load","​clock":​1519311600,"​count":​60,"​min":​0.01,"​avg":​0.15,"​max":​1.5}