[ZBXNEXT-2216] Items without history do not have last value and triggers do not work. Created: 2014 Mar 19 Updated: 2017 May 31 Resolved: 2016 Mar 05 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Server (S) |
Affects Version/s: | 2.2.2 |
Fix Version/s: | None |
Type: | Change Request | Priority: | Minor |
Reporter: | Sergey Kuksa | Assignee: | Unassigned |
Resolution: | Duplicate | Votes: | 0 |
Labels: | history, lastvalue, triggers | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() |
||||||||
Issue Links: |
|
Description |
Hello, team. I collect items where I do not need history, only triggers if it changed or too small. For example it can be equipment serial number, system uptime, admin state of interface and so on. This scheme does not work with Zabbix 2.2.x. Thanks, Sergey. |
Comments |
Comment by richlv [ 2014 Mar 19 ] |
same cause as ZBX-7548 zalex_ua Currently it mainly asks to document limitations when history is 0. |
Comment by richlv [ 2014 Mar 19 ] |
although triggers should work... can you please show expression that fails and how exactly does it fail ? |
Comment by Sergey Kuksa [ 2014 Mar 20 ] |
Hello richlv. Thanks for your answer. Please find in the attachment full test log for test host and items. WBR, Sergey. |
Comment by richlv [ 2014 Mar 20 ] |
huh. may i point at https://www.zabbix.org/wiki/Docs/bug_reporting_guidelines ? |
Comment by Sergey Kuksa [ 2014 Mar 20 ] |
Sorry, ok. But, what about feature request. I collect last values from a lot of items (up to millions) from zabbix to our other systems and I understood it would not work good in 2.2.x. Thanks, Sergey |
Comment by richlv [ 2014 Mar 21 ] |
hmm. all you sure that triggers do not work for you ? |
Comment by Sergey Kuksa [ 2014 Mar 22 ] |
Yes. Triger TestIntT {TestHost:TestInt.last()}<10 1. History is 60 days (default). ["name"]=> string(7) "TestInt" ["key_"]=> string(7) "TestInt" ["history"]= string(2) "90" ["lastvalue"]=> string(3) "100" ["description"]=> string(8) "TestIntT" ["value"]=> string(1) "0" zabbix_sender -z 127.0.0.1 -s TestHost -k TestInt -o 1 ["lastvalue"]=> string(1) "1" ["description"]=> string(8) "TestIntT" ["value"]=> string(1) "1" Trigger works. 2. History - 0 days. ["name"]=> string(7) "TestInt" ["key_"]=> string(7) "TestInt" ["history"]=> string(1) "0" ["lastvalue"]=> string(4) "1000" ["description"]=> string(8) "TestIntT" ["value"]=> string(1) "0" zabbix_sender -z 127.0.0.1 -s TestHost -k TestInt -o 1 ["lastvalue"]=> string(4) "1000" ["description"]=> string(8) "TestIntT" ["value"]=> string(1) "0" Trigger does not work, lastvalue does not change. I will check this with clear test instance zabbix last version. |
Comment by Sergey Kuksa [ 2014 Mar 24 ] |
Hello. I did test with Zabbix 2.2.2 clear installation. Please find log and scripts in The test description: =0 I hope this test can help you. Thanks. Sergey. |
Comment by Sergey Kuksa [ 2014 Mar 27 ] |
Hello once again. I guess I fixed my problem with the patch:below. [skuksa@opmon01 zabbix]$ zabbix_sender -z 127.0.0.1 -p 10081 -s TestHost -k TestItem -o 7 info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.000093" sent: 1; skipped: 0; total: 1 [skuksa@opmon01 zabbix]$ sleep 3; ./test1.sh ["itemid"]=> string(5) "23661" ["key_"]=> string(8) "TestItem" ["history"]=> string(1) "0" ["description"]=> string(0) "" ["lastvalue"]=> string(1) "0" ["prevvalue"]=> string(1) "0" ["triggerid"]=> string(5) "13558" ["description"]=> string(10) "TestTriger" ["value"]=> string(1) "0" ["tag"]=> string(1) "7" [skuksa@opmon01 zabbix]$ zabbix_sender -z 127.0.0.1 -p 10081 -s TestHost -k TestItem -o 0 info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.000031" sent: 1; skipped: 0; total: 1 [skuksa@opmon01 zabbix]$ sleep 3; ./test1.sh ["itemid"]=> string(5) "23661" ["key_"]=> string(8) "TestItem" ["history"]=> string(1) "0" ["description"]=> string(0) "" ["lastvalue"]=> string(1) "0" ["prevvalue"]=> string(1) "0" ["triggerid"]=> string(5) "13558" ["description"]=> string(10) "TestTriger" ["value"]=> string(1) "1" ["tag"]=> string(1) "0" WBR, Sergey. --- src/libs/zbxdbcache/dbcache.c.orig 2014-03-27 14:39:52.947717510 +0400 +++ src/libs/zbxdbcache/dbcache.c 2014-03-27 17:27:30.660266338 +0400 @@ -1786,8 +1786,8 @@ if (sql_offset > 16) /* In ORACLE always present begin..end; */ rc = DBexecute("%s", sql); - if (ZBX_DB_OK <= rc && 0 != (daemon_type & ZBX_DAEMON_TYPE_SERVER) && - 0 != h_num + huint_num + hstr_num + htext_num + hlog_num) + if ((ZBX_DB_OK <= rc && 0 != (daemon_type & ZBX_DAEMON_TYPE_SERVER)) || + sql_offset <17 ) { /* the history values were written into database, now add to value cache */ zbx_log_value_t log; @@ -1799,7 +1799,7 @@ for (i = 0; i < history_num; i++) { - if (0 == history[i].keep_history || 0 != history[i].value_null) + if (0 != history[i].value_null) continue; switch (history[i].value_type) |
Comment by Oleksii Zagorskyi [ 2016 Mar 05 ] |
Let's close this one as duplicate of |