[ZBX-13276] Empty Graphs in Web with history data in elasticsearch Created: 2017 Dec 29  Updated: 2024 Apr 10  Resolved: 2018 Jan 10

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 3.4.5
Fix Version/s: 3.4.6rc1, 4.0.0alpha2, 4.0 (plan)

Type: Problem report Priority: Major
Reporter: Mikhail Markov Assignee: Vjaceslavs Bogdanovs
Resolution: Fixed Votes: 0
Labels: webmonitoring
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Graph.PNG     PNG File Values.PNG    
Issue Links:
Duplicate
is duplicated by ZBX-13314 Elasticsearch - Graphs not working Closed
Team: Team C
Sprint: Sprint 24, Sprint 25
Story Points: 0.125

 Description   

History data configured to store in Elasticsearch and its updating.
But when i open Latest data -> Any Graph they are empty.

Frontend debug info:

******************** Script profiler ********************
Total time: 0.1038
Total SQL time: 0.035082
Total ElasticSearch time: 0.021028995513916
SQL count: 32 (selects: 20 | executes: 12)
Peak memory usage: 9.5M
Memory limit: 128M

1. item.get [history.php:80]

Parameters:
Array
(
    [itemids] => Array
        (
            [0] => 28286
        )

    [webitems] => 1
    [selectHosts] => Array
        (
            [0] => name
        )

    [output] => Array
        (
            [0] => itemid
            [1] => key_
            [2] => name
            [3] => value_type
            [4] => hostid
            [5] => valuemapid
            [6] => history
            [7] => trends
        )

    [preservekeys] => 1
)
Result:
Array
(
    [28286] => Array
        (
            [itemid] => 28286
            [key_] => system.cpu.switches
            [name] => Context switches per second
            [value_type] => 3
            [hostid] => 10254
            [valuemapid] => 0
            [history] => 1w
            [trends] => 365d
            [hosts] => Array
                (
                    [0] => Array
                        (
                            [hostid] => 10254
                            [name] => kvk-d-itm-run01
                        )

                )

        )

)

2. item.get [CScreenHistory.php:110]

Parameters:
Array
(
    [output] => Array
        (
            [0] => itemid
            [1] => hostid
            [2] => name
            [3] => key_
            [4] => value_type
            [5] => valuemapid
            [6] => history
            [7] => trends
        )

    [selectHosts] => Array
        (
            [0] => name
        )

    [itemids] => Array
        (
            [0] => 28286
        )

    [webitems] => 1
    [preservekeys] => 1
)
Result:
Array
(
    [28286] => Array
        (
            [itemid] => 28286
            [hostid] => 10254
            [name] => Context switches per second
            [key_] => system.cpu.switches
            [value_type] => 3
            [valuemapid] => 0
            [history] => 1w
            [trends] => 365d
            [hosts] => Array
                (
                    [0] => Array
                        (
                            [hostid] => 10254
                            [name] => kvk-d-itm-run01
                        )

                )

        )

)


SQL (0.000353): SET search_path = 'public'
history.php:22 ? require_once() ? ZBase->run() ? ZBase->initDB() ? DBconnect() ? DBexecute() in include/db.inc.php:84

SQL (0.000235): SET bytea_output = escape
history.php:22 ? require_once() ? ZBase->run() ? ZBase->initDB() ? DBconnect() ? DBexecute() in include/db.inc.php:95

SQL (0.005441): SELECT 1 FROM information_schema.tables WHERE table_catalog='zabbix' AND table_schema='public' AND table_name='dbversion'
history.php:22 ? require_once() ? ZBase->run() ? ZBase->initDB() ? DBconnect() ? DbBackend->checkDbVersion() ? PostgresqlDbBackend->checkDbVersionTable() ? DBselect() in include/classes/db/PostgresqlDbBackend.php:41

SQL (0.000501): SELECT dv.mandatory,dv.optional FROM dbversion dv
history.php:22 ? require_once() ? ZBase->run() ? ZBase->initDB() ? DBconnect() ? DbBackend->checkDbVersion() ? DBselect() in include/classes/db/DbBackend.php:46

SQL (0.001057): SELECT NULL FROM config c
history.php:22 ? require_once() ? ZBase->run() ? ZBase->initDB() ? DBconnect() ? DbBackend->checkConfig() ? DBselect() in include/classes/db/DbBackend.php:62

SQL (0.00032): BEGIN
history.php:22 ? require_once() ? ZBase->run() ? ZBase->authenticateUser() ? CWebUser::checkAuthentication() ? CFrontendApiWrapper->checkAuthentication() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? DBstart() ? DBexecute() in include/db.inc.php:237

SQL (0.001088): SELECT sessionid,userid,lastaccess FROM sessions WHERE sessionid='3b037b8b4545a8f6d73bc44d8cee1f55' AND status=0
history.php:22 ? require_once() ? ZBase->run() ? ZBase->authenticateUser() ? CWebUser::checkAuthentication() ? CFrontendApiWrapper->checkAuthentication() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CUser->checkAuthentication() ? DB::select() ? DBselect() in include/classes/db/DB.php:918

SQL (0.001073): SELECT userid,alias,name,surname,url,autologin,autologout,lang,refresh,type,theme,attempt_failed,attempt_ip,attempt_clock,rows_per_page FROM users WHERE userid=1
history.php:22 ? require_once() ? ZBase->run() ? ZBase->authenticateUser() ? CWebUser::checkAuthentication() ? CFrontendApiWrapper->checkAuthentication() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CUser->checkAuthentication() ? DB::select() ? DBselect() in include/classes/db/DB.php:918

SQL (0.001092): SELECT g.debug_mode,g.users_status,g.gui_access FROM usrgrp g,users_groups ug WHERE g.usrgrpid=ug.usrgrpid AND ug.userid=1
history.php:22 ? require_once() ? ZBase->run() ? ZBase->authenticateUser() ? CWebUser::checkAuthentication() ? CFrontendApiWrapper->checkAuthentication() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CUser->checkAuthentication() ? CUser->getUserGroupsData() ? DBselect() in include/classes/api/services/CUser.php:1576

SQL (0.000642): UPDATE sessions SET lastaccess='1514546676' WHERE sessionid='3b037b8b4545a8f6d73bc44d8cee1f55'
history.php:22 ? require_once() ? ZBase->run() ? ZBase->authenticateUser() ? CWebUser::checkAuthentication() ? CFrontendApiWrapper->checkAuthentication() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CUser->checkAuthentication() ? DB::update() ? DBexecute() in include/classes/db/DB.php:573

SQL (0.001307): COMMIT
history.php:22 ? require_once() ? ZBase->run() ? ZBase->authenticateUser() ? CWebUser::checkAuthentication() ? CFrontendApiWrapper->checkAuthentication() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? DBend() ? DBcommit() ? DBexecute() in include/db.inc.php:294

SQL (0.000919): SELECT type,value_id,value_int,value_str,idx2 FROM profiles WHERE userid=1 AND idx='web.menu.view.last'
history.php:36 ? require_once() ? zbx_construct_menu() ? CProfile::update() ? CProfile::get() ? DBselect() in include/classes/user/CProfile.php:165

SQL (0.005038): SELECT c.* FROM config c
history.php:36 ? require_once() ? select_config() ? DBselect() in include/profiles.inc.php:33

SQL (0.000598): SELECT type,value_id,value_int,value_str,idx2 FROM profiles WHERE userid=1 AND idx='web.login.attempt.failed'
history.php:36 ? require_once() ? CProfile::get() ? DBselect() in include/classes/user/CProfile.php:165

SQL (0.003011): BEGIN
history.php:80 ? CFrontendApiWrapper->get() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? DBstart() ? DBexecute() in include/db.inc.php:237

SQL (0.00175): SELECT i.itemid,i.key_,i.name,i.value_type,i.hostid,i.valuemapid,i.history,i.trends FROM items i WHERE i.flags IN (0,4) AND i.itemid='28286'
history.php:80 ? CFrontendApiWrapper->get() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CItem->get() ? DBselect() in include/classes/api/services/CItem.php:364

SQL (0.001396): SELECT h.hostid,h.name FROM hosts h WHERE h.flags IN (0,4) AND h.hostid='10254' AND h.status IN (0,1,3)
history.php:80 ? CFrontendApiWrapper->get() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CItem->get() ? CItem->addRelatedObjects() ? CItemGeneral->addRelatedObjects() ? CHost->get() ? DBselect() in include/classes/api/services/CHost.php:429

SQL (0.000168): COMMIT
history.php:80 ? CFrontendApiWrapper->get() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? DBend() ? DBcommit() ? DBexecute() in include/db.inc.php:294

SQL (0.00095): SELECT p.value_id,p.source FROM profiles p WHERE p.userid=1 AND p.idx='web.favorite.graphids' ORDER BY p.profileid
history.php:109 ? CView->render() ? include() ? get_icon() ? CFavorite::exists() ? CFavorite::get() ? DBselect() in include/classes/user/CFavorite.php:56

SQL (0.000463): SELECT type,value_id,value_int,value_str,idx2 FROM profiles WHERE userid=1 AND idx='web.item.graph.period'
history.php:109 ? CView->render() ? include() ? CScreenBuilder::getScreen() ? CScreenHistory->__construct() ? CScreenBase->__construct() ? calculateTime() ? CProfile::get() ? DBselect() in include/classes/user/CProfile.php:165

SQL (0.000416): SELECT type,value_id,value_int,value_str,idx2 FROM profiles WHERE userid=1 AND idx='web.item.graph.isnow'
history.php:109 ? CView->render() ? include() ? CScreenBuilder::getScreen() ? CScreenHistory->__construct() ? CScreenBase->__construct() ? calculateTime() ? CProfile::get() ? DBselect() in include/classes/user/CProfile.php:165

SQL (0.000389): SELECT type,value_id,value_int,value_str,idx2 FROM profiles WHERE userid=1 AND idx='web.history.filter.state'
history.php:109 ? CView->render() ? include() ? CFilter->__construct() ? CProfile::get() ? DBselect() in include/classes/user/CProfile.php:165

SQL (0.000178): BEGIN
history.php:109 ? CView->render() ? include() ? CScreenHistory->get() ? CFrontendApiWrapper->get() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? DBstart() ? DBexecute() in include/db.inc.php:237

SQL (0.00043): SELECT i.itemid,i.hostid,i.name,i.key_,i.value_type,i.valuemapid,i.history,i.trends FROM items i WHERE i.flags IN (0,4) AND i.itemid='28286'
history.php:109 ? CView->render() ? include() ? CScreenHistory->get() ? CFrontendApiWrapper->get() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CItem->get() ? DBselect() in include/classes/api/services/CItem.php:364

SQL (0.00045): SELECT h.hostid,h.name FROM hosts h WHERE h.flags IN (0,4) AND h.hostid='10254' AND h.status IN (0,1,3)
history.php:109 ? CView->render() ? include() ? CScreenHistory->get() ? CFrontendApiWrapper->get() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CItem->get() ? CItem->addRelatedObjects() ? CItemGeneral->addRelatedObjects() ? CHost->get() ? DBselect() in include/classes/api/services/CHost.php:429

SQL (0.000204): COMMIT
history.php:109 ? CView->render() ? include() ? CScreenHistory->get() ? CFrontendApiWrapper->get() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? DBend() ? DBcommit() ? DBexecute() in include/db.inc.php:294

SQL (0.000689): SELECT type,value_id,value_int,value_str,idx2 FROM profiles WHERE userid=1 AND idx='web.history.timelinefixed'
history.php:109 ? CView->render() ? include() ? CScreenHistory->get() ? CProfile::get() ? DBselect() in include/classes/user/CProfile.php:165

SQL (0.000398): SELECT type,value_id,value_int,value_str,idx2 FROM profiles WHERE userid=1 AND idx='web.item.graph.timelinefixed'
history.php:109 ? CView->render() ? include() ? CScreenBuilder::insertScreenStandardJs() ? CScreenBuilder::insertScreenScrollJs() ? CProfile::get() ? DBselect() in include/classes/user/CProfile.php:165

SQL (0.000413): SELECT type,value_id,value_int,value_str,idx2 FROM profiles WHERE userid=1 AND idx='web.paging.lastpage'
history.php:112 ? require_once() ? CProfile::update() ? CProfile::get() ? DBselect() in include/classes/user/CProfile.php:165

SQL (0.000182): BEGIN
history.php:112 ? require_once() ? DBstart() ? DBexecute() in include/db.inc.php:237

SQL (0.000478): UPDATE profiles SET value_str='history.php', type=3 WHERE userid=1 AND idx='web.paging.lastpage'
history.php:112 ? require_once() ? CProfile::flush() ? CProfile::updateDB() ? DBexecute() in include/classes/user/CProfile.php:341

SQL (0.003453): COMMIT
history.php:112 ? require_once() ? DBend() ? DBcommit() ? DBexecute() in include/db.inc.php:294


ElasticSearch (0.021029): POST http://localhost:9200/uint/values/_search
Request: {"aggs":{"min_clock":{"min":{"field":"clock"}}},"size":0,"query":{"terms":{"itemid":["28286"]}}}
history.php:109 ? CView->render() ? include() ? CScreenHistory->get() ? CHistoryManager->getMinClock() ? CHistoryManager->getMinClockFromElasticSearch() ? CElasticSearchHelper::query() ? CElasticSearchHelper::request() in include/classes/helpers/CElasticSearchHelper.php:170


 Comments   
Comment by Aleksejs Petrovs [ 2017 Dec 29 ]

Hello Mikhail,

To have some proofs - could you please add a screenshot of the items "Last 500 values" + the faulty graph? Which type is configured for the particular item - uint or float?

Regards,
Aleksejs!

Comment by Mikhail Markov [ 2017 Dec 29 ]

Empty Graph attached
Interrupt values are Numeric (float)
Part of Last 500 values:

run01: Interrupts per second
12/29/2017 02:48:03 PM 1514548083 2140
12/29/2017 02:48:02 PM 1514548082 1323
12/29/2017 02:48:01 PM 1514548081 1512
12/29/2017 02:48:00 PM 1514548080 2263
12/29/2017 02:47:59 PM 1514548079 8837
12/29/2017 02:47:58 PM 1514548078 1472
12/29/2017 02:47:57 PM 1514548077 1347
12/29/2017 02:47:56 PM 1514548076 2084
12/29/2017 02:47:55 PM 1514548075 1174
12/29/2017 02:47:54 PM 1514548074 1740
12/29/2017 02:47:53 PM 1514548073 1852
12/29/2017 02:47:52 PM 1514548072 1010
12/29/2017 02:47:51 PM 1514548071 2047
12/29/2017 02:47:50 PM 1514548070 1797
12/29/2017 02:47:49 PM 1514548069 1658
12/29/2017 02:47:48 PM 1514548068 2087
12/29/2017 02:47:47 PM 1514548067 1437
12/29/2017 02:47:46 PM 1514548066 1413
12/29/2017 02:47:45 PM 1514548065 1997
12/29/2017 02:47:44 PM 1514548064 1385
12/29/2017 02:47:43 PM 1514548063 954
12/29/2017 02:47:42 PM 1514548062 2112
12/29/2017 02:47:41 PM 1514548061 1514
Comment by Aleksejs Petrovs [ 2017 Dec 29 ]

Thank you,

Bug confirmed and passed to the DEV team.

Regards,
Aleksejs!

Comment by Dimitri Bellini [ 2018 Jan 15 ]

Hi,
On Zabbix 3.4.6rc1 I still have the Graph bug with Elasticsearch 5.5.1 - (Distro Centos 7.4), on "Value Tab" i could see every values so i supposed is not a configuration problem.

If you need further details please ask me.
Thanks

Comment by Vjaceslavs Bogdanovs [ 2018 Jan 15 ]

dimitri.bellini, could you provide some additional information?
Have you followed the installation guidelines from our documentation (https://www.zabbix.com/documentation/4.0/manual/appendix/install/elastic_search_setup)?
Can you show the mapping configuration by performing GET request to the desired index (for example, if you are having problems with dbl item type, then GET http://<HOST>:9200/dbl)?
Can you show the error message you are getting from Elasticsearch logs?

Comment by Dimitri Bellini [ 2018 Jan 15 ]

Sorry, is my fault!!!! On the final line of the Zabbix Elasticserach documentation there are two very important line:

Mapping is a data structure in Elasticsearch (similar to a table in a database). Mapping for all history data types is available here: database/elasticsearch/elasticsearch.map. To create mapping for text type send the following request to Elasticsearch:

And i have not read so well... Please put more emphasys on that two line because is very important.
Thanks very much

Generated at Thu Apr 25 17:17:24 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.