[ZBX-17115] nodata function doesn't work different time for Server and Agent Created: 2019 Dec 23 Updated: 2024 Apr 10 Resolved: 2020 Jan 28 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Documentation (D) |
Affects Version/s: | None |
Fix Version/s: | 5.0 (plan) |
Type: | Documentation task | Priority: | Trivial |
Reporter: | Keita Higa | Assignee: | Martins Valkovskis |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
ZabbixServer 4.0.11 , 4.0.16 |
Team: | |
Sprint: | Sprint 59 (Dec 2019), Sprint 60 (Jan 2020) |
Description |
Case: Steps to reproduce: ItemSample: TriggerSample: SQL: +--------+------------+-----------+--------+----------+------------------------------+------------+-----------+ | itemid | clock | timestamp | source | severity | value | logeventid | ns | +--------+------------+-----------+--------+----------+------------------------------+------------+-----------+ | 28512 | 1577070641 | 0 | | 0 | Sun Dec 22 22:10:41 EST 2019 | 0 | 81929799 | | 28512 | 1577070737 | 0 | | 0 | Sun Dec 22 22:12:16 EST 2019 | 0 | 122892444 | | 28512 | 1577070908 | 0 | | 0 | Sun Dec 22 22:15:07 EST 2019 | 0 | 202081283 | +--------+------------+-----------+--------+----------+------------------------------+------------+-----------+ Logs: 4109:20191222:222550.496 trapper got '{"request":"agent data","session":"eb605b9007bbb9f86a6c7ffe730c049d","data":[{"host":"debug-agent","key":"log[/tmp/sample.log]","value":"Sun Dec 22 22:15:07 EST 2019","lastlogsize":232,"id":5,"clock":1577070908,"ns":202081283}],"clock":1577070908,"ns":202711349}' 4090:20191222:222551.371 query [txnlev:1] [insert into history_log (itemid,clock,ns,timestamp,source,severity,value,logeventid) values (28512,1577070908,202081283,0,'',0,'Sun Dec 22 22:15:07 EST 2019',0);] 4090:20191222:222551.380 In zbx_evaluate_item_functions() funcs_num:1 4090:20191222:222551.380 In evaluate_function() function:'debug-agent:log[/tmp/sample.log].nodata(60)' 4090:20191222:222551.380 In evaluate_NODATA() 4090:20191222:222551.380 In get_function_parameter_int() parameters:'60' Nparam:1 4090:20191222:222551.380 In substitute_simple_macros() data:'60' 4090:20191222:222551.380 get_function_parameter_int() type:sec value:60 4090:20191222:222551.381 End of get_function_parameter_int():SUCCEED 4090:20191222:222551.381 In zbx_vc_get_values() itemid:28512 value_type:2 seconds:60 count:1 sec:1577071551 ns:381038586 4090:20191222:222551.381 End of zbx_vc_get_values():SUCCEED count:0 cached:1 4090:20191222:222551.381 End of evaluate_NODATA():SUCCEED 4090:20191222:222551.381 End of evaluate_function():SUCCEED value:'1' 4090:20191222:222551.381 End of zbx_evaluate_item_functions() For instance: Result: Expected: |
Comments |
Comment by Andrejs Tumilovics [ 2019 Dec 27 ] |
kt_eng06 I'm trying to understand the use case. {Host:log[/tmp/sample.log].nodata(60)}=0 trigger expression, trigger would switch to PROBLEM state just once a new log message appear and go back to OK after 60 seconds. {Host:log[/tmp/sample.log].strlen()}>0 This could be then used for actions. nodata() does not work in your scenario because log[] metrics are active checks, so they are stored in DB with agent's timestamp. But, trigger functions are evaluated on server. If server and agent hosts are not synchronized, time-related trigger functions might work incorrectly. I'm going to close the ticket as "Won't fix" based on time synchronization requirements |
Comment by Glebs Ivanovskis [ 2020 Jan 28 ] |
Something was documented as a result of this ticket, but no one outside Zabbix knows what exactly. |
Comment by Martins Valkovskis [ 2020 Jan 28 ] |
The following text has been added to 4.0, 4.4, 5.0 documentation of nodata():
|
Comment by Glebs Ivanovskis [ 2020 Jan 28 ] |
Thank you, martins-v! Consider also adding time synchronization requirement link. |
Comment by Martins Valkovskis [ 2020 Jan 28 ] |
Thanks, added. |
Comment by Glebs Ivanovskis [ 2020 Jan 28 ] |
Great! |