[ZBX-17063] configuration.export can't export/import some templates Created: 2019 Dec 10 Updated: 2019 Dec 19 Resolved: 2019 Dec 19 |
|
| Status: | Closed |
| Project: | ZABBIX BUGS AND ISSUES |
| Component/s: | Frontend (F) |
| Affects Version/s: | 4.4.3 |
| Fix Version/s: | None |
| Type: | Problem report | Priority: | Trivial |
| Reporter: | Evgenii Terechkov | Assignee: | Edgars Melveris |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | activeagent, configuration, export, import, template | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
zabbix-4.2 from official repo updated to 4.4.3 (Centos7). |
||
| Attachments: |
|
| Description |
|
After update 4.2->4.4.3 some of templates cant be handled by configuration.export API call with strange messages about "zabbix active agent" items (see attached streenshot). Also, this zabbix version cant import same templates (dumped on 4.2) from XML files (see attached screenshot and XML file), in 4.4.1 version too. Steps to reproduce:
Result: Expected: |
| Comments |
| Comment by Edgars Melveris [ 2019 Dec 11 ] |
|
Hello Evgenii, |
| Comment by Evgenii Terechkov [ 2019 Dec 11 ] |
|
Just as I state before, I cannot export this template from 4.4, via GUI export nor via API configuration.export (see screenshot with "unexpected constant value 7").
Just by the lucky I have backup XML template, exported from 4.2. I cannot import it in 4.4 (see screenshot with PHP traceback in GUI).
Here is screenshot of graph prototypes (attached 3 screenshots with 12 graph prototypes in total). |
| Comment by Evgenii Terechkov [ 2019 Dec 11 ] |
|
(BTW, I can open for editing any of this 12 graph prototypes without any problems). |
| Comment by Edgars Melveris [ 2019 Dec 11 ] |
|
Can you open one of the graphs and add a screenshot of the configuration also? select gi.graphid,gi.itemid,gi.type,g.graphtype,g.name from graphs_items gi left join items i on gi.itemid=i.itemid left join hosts h on i.hostid=h.hostid left join graphs g on gi.graphid=g.graphid where h.hostid=<HOSTID OF THE TEMPLATE>; |
| Comment by Evgenii Terechkov [ 2019 Dec 11 ] |
|
Sure. I have attached screenshot of one graph prototype.
Here is SQL you have asked: graphid | itemid | type | graphtype | name
---------+--------+------+-----------+--------------------------------------------------------------
21026 | 151378 | 0 | 0 | Redis: "{#INSTANCE}:{#PORT}" - CPU Utilization
21023 | 151398 | 7 | 0 | Redis: "{#INSTANCE}:{#PORT}" - Connected Clients
21024 | 151406 | 0 | 0 | Redis: "{#INSTANCE}:{#PORT}" - Connected Slaves
21028 | 151409 | 0 | 0 | Redis: "{#INSTANCE}:{#PORT}" - Keys: Expired Keys
21022 | 151384 | 7 | 0 | Redis: "{#INSTANCE}:{#PORT}" - Commands Overview
21025 | 151385 | 7 | 0 | Redis: "{#INSTANCE}:{#PORT}" - Connections
21027 | 151391 | 0 | 0 | Redis: "{#INSTANCE}:{#PORT}" - DB Size in Memory vs Disk
21032 | 151421 | 0 | 1 | Redis: "{#INSTANCE}" - {#COMMAND} Calls Overview
21033 | 151422 | 0 | 1 | Redis: "{#INSTANCE}" - {#COMMAND} Latency Overview
21029 | 151393 | 0 | 0 | Redis: "{#INSTANCE}:{#PORT}" - Total Keys vs Keys with Expr.
21029 | 151394 | 0 | 0 | Redis: "{#INSTANCE}:{#PORT}" - Total Keys vs Keys with Expr.
21030 | 151417 | 0 | 0 | Redis: "{#INSTANCE}:{#PORT}" - "{#SLAVE}" Lag Overview
21031 | 151418 | 0 | 0 | Redis: "{#INSTANCE}:{#PORT}" - "{#SLAVE}" Offset Overview
21027 | 151415 | 0 | 0 | Redis: "{#INSTANCE}:{#PORT}" - DB Size in Memory vs Disk
(14 rows)
|
| Comment by Evgenii Terechkov [ 2019 Dec 11 ] |
|
Added one more screenshot (with type=7 from SQL dump above). Seems legal. |
| Comment by dimir [ 2019 Dec 12 ] |
|
Looks like the issue is with this part of XML: <graph_prototypes>
<graph_prototype>
<name>Redis: "{#INSTANCE}:{#PORT}" - Commands Overview</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>0</show_work_period>
<show_triggers>0</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>2</drawtype>
<color>6666FF</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>7</type> <---- this can be only one of (0 - normal, 1 - stacked, 2 - pie, 3 - exploded)
<item>
<host>Redis_discovery</host>
<key>redis.stat.get[total_commands_processed,{#HOST},{#PORT}]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
...
</graph_prototypes>
By the way, item type 7 is "Zabbix agent (active)". So looks like item type gets into graph type field during the export. |
| Comment by Edgars Melveris [ 2019 Dec 12 ] |
|
Actually type in graph items is not the item type, but calculation type, for the item in graph:
And graphtypes can be:
So it should be 0 by default and only in case it's one of the "pie" graphs, it can be 2. 7 is not legal here. Although it's possible to manually insert anything there, as it's integer column. It's possible, that there have been a bug in Zabbix API in some previous version, that could have caused this, but currently the only solution is to manually fix this in the DB. |
| Comment by dimir [ 2019 Dec 12 ] |
|
evg-krsk, could you please describe in detail:
Basically, describe in very detail the whole process of handling this template. |
| Comment by Evgenii Terechkov [ 2019 Dec 12 ] |
So, how can I manually fix DB without data acqusition and visualization breakage (template seems to work fine on production machines)? |
| Comment by Evgenii Terechkov [ 2019 Dec 12 ] |
|
s/frontd/frontend/ |
| Comment by Evgenii Terechkov [ 2019 Dec 19 ] |
|
ping? |
| Comment by Edgars Melveris [ 2019 Dec 19 ] |
|
I listed the possible values in that field in previous comment, you need to manually change it in DB to one of the expected values (probably 0). |