[ZBX-14661] Discrepancies in Calculated type output for LLD item prototypes Created: 2018 Jul 29  Updated: 2018 Aug 03  Resolved: 2018 Aug 03

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: None
Fix Version/s: None

Type: Incident report Priority: Minor
Reporter: Oleg Vedeneev Assignee: Unassigned
Resolution: Workaround proposed Votes: 0
Labels: calculateditems, lld, prototype
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File ZBX-14661_item.jpg     JPEG File ZBX-14661_last_value.jpg     XML File zbx_export_templates.xml    

 Description   

Item prototype with Calculated type shows different outputs in Host > Items and Host > Last data.

It appears that "Last value" field in Last data gets updated based on CacheUpdateFrequency parameter in zabbix_server.conf. It's also gets updated after issuing "zabbix_server -c /etc/zabbix/zabbix_server.conf -R config_cache_reload".

At the same time, the Formula field in Monitoring > Hosts > Items follows "Update interval" for that item prototype and gets updated accordingly.

Steps to reproduce:

  1. Create item prototype with update interval of 10s.
  2. Set CacheUpdateFrequency=120
  3. Change item value. You'll see that Formula value would change as expected - in 10sec interval. However, Last value would change only in 120sec interval or if you reload configuration cache manually.

 



 Comments   
Comment by Aleksejs Petrovs [ 2018 Jul 29 ]

Hello Oleg,

Yes, when you configure the things in the Web Front-end - you change those in the database directly. But Zabbix Server daemon reloads the Configuration cache once in a minute(by the default). So your value will be updated with the expected only not earlier than the next configuration cache.

It is not a bug - this is by design, that Front-end and Server daemon are communicating through the database, not directly.

Further reading Zabbix overview & config file for Zabbix Server.

Regards,
Aleksejs!

Comment by Oleg Vedeneev [ 2018 Jul 29 ]

Hi,

Thank you for clarification on configuration cache. However, this does not explain different behaviour for Calculated type and, for instance, Zabbix agent or SNMP agent types. If I create another item with Zabbix agent type it gets updated with expected intervals both on Items page and Last data page.

Let me know if I need to elaborate the issue.

Thanks.

Comment by Aleksejs Petrovs [ 2018 Jul 29 ]

Sorry, could you please create some screenshots and detailed steps on how to reproduce the issue?

Comment by Oleg Vedeneev [ 2018 Jul 29 ]

Hi,

Thanks for looking into it. I created test template zbx_export_templates.xml

UserParameter line:

UserParameter=unixtime.discovery,/etc/zabbix/externalscripts/ZBX-14661.sample

Discovery script:

  1. cat /etc/zabbix/externalscripts/ZBX-14661.sample
    #!/bin/sh
    DATE=`/bin/date +%s`
    echo "{ \"data\":["
    echo "{"
    echo "\"{#ITEM_NAME}\":\"UNIXTIME\","
    echo "\"{#ITEM_VALUE}\":\"$DATE\""
    echo "}"
    echo "]}"

 

Set CacheUpdateFrequency=120 to be able to catch the difference in output.

 

Screenshots attached. You could see on ZBX-14661_last_value that Last check is getting updated each 10 seconds but Last value only with interval set up in CacheUpdateFrequency.

Hope this makes this clear. Let me know if you need more info.

Thanks.

Comment by Glebs Ivanovskis [ 2018 Aug 01 ]

At the same time, the Formula field in Monitoring > Hosts > Items follows "Update interval" for that item prototype and gets updated accordingly.

Actually, it follows Update interval of discovery rule.

In order to see effect of your changes to item prototype configuration in discovered item configuration you need to wait until server/proxy executes LLD rule once again (and proxy sends LLD JSON to server).

In order to see effect of your changes to item prototype configuration in discovered item values you need to wait until server/proxy executes LLD rule once again (and proxy sends LLD JSON to server) plus until server reloads configuration from DB or new configuration gets sent to proxy.

I guess this is where confusion comes from.

Comment by Oleg Vedeneev [ 2018 Aug 01 ]

Hi,

That makes sense now. Thank you for detailed explanation.

Issue may be closed.

Generated at Sat Apr 27 03:04:38 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.