Details

      Description

      When exporting template, configured value mapping should also be exported. There may be custom mappings configured.

      When importing, rules should provide option to update/add missing value mappings from xml exported template.

      Specification

        Issue Links

          Activity

          Hide
          richlv added a comment -

          it shouldn't be limited to templates - host import/export might benefit as well.
          but primarily the xml import/export of valuemaps themselves must appear

          Show
          richlv added a comment - it shouldn't be limited to templates - host import/export might benefit as well. but primarily the xml import/export of valuemaps themselves must appear
          Hide
          richlv added a comment -

          ZBXNEXT-1424 asks for valuemap api

          Show
          richlv added a comment - ZBXNEXT-1424 asks for valuemap api
          Hide
          Raymond Kuiper added a comment -

          I was shocked to see that this wasn't included in 2.2 (at least not in the value mapping admin screen). I just spend a lot of time typing in all the HTTP response codes, would have been handy to make an export for future use...

          Show
          Raymond Kuiper added a comment - I was shocked to see that this wasn't included in 2.2 (at least not in the value mapping admin screen). I just spend a lot of time typing in all the HTTP response codes, would have been handy to make an export for future use...
          Hide
          Raymond Kuiper added a comment -

          If you are interested in this feature, ZBXNEXT-2063 might be interesting too.

          Show
          Raymond Kuiper added a comment - If you are interested in this feature, ZBXNEXT-2063 might be interesting too.
          Hide
          sergio cricca added a comment -

          it would be useful to have import/export feature (like that in hosts/templates configuration) into administration/Value mapping page, as well as exporting/importing when working with templates.

          same thing could be usefull with "regular expressions".. no way to export/import them.

          Show
          sergio cricca added a comment - it would be useful to have import/export feature (like that in hosts/templates configuration) into administration/Value mapping page, as well as exporting/importing when working with templates. same thing could be usefull with "regular expressions".. no way to export/import them.
          Hide
          Marc added a comment -

          ZBXNEXT-2313 asks for "export/import "regular expressions" feature [...]"

          Show
          Marc added a comment - ZBXNEXT-2313 asks for "export/import "regular expressions" feature [...]"
          Hide
          Filipe Paternot added a comment -

          Both features (ZBXNEXT-1679 and ZBXNEXT-2313) are very needed to create the possibility of exchanging templates between zabbix instances.
          This would mean that we could share complete templates (with value maps and regexps) to the community and so on! This is true open source

          Show
          Filipe Paternot added a comment - Both features ( ZBXNEXT-1679 and ZBXNEXT-2313 ) are very needed to create the possibility of exchanging templates between zabbix instances. This would mean that we could share complete templates (with value maps and regexps) to the community and so on! This is true open source
          Hide
          Joris Willems added a comment - - edited

          Still an issue. Import-export feature is not working if it isn't finished. Is zabbix really ready for production if the core functionalities advertised on the website are not working?

          http://www.zabbix.com/template_import_export.php

          Show
          Joris Willems added a comment - - edited Still an issue. Import-export feature is not working if it isn't finished. Is zabbix really ready for production if the core functionalities advertised on the website are not working? http://www.zabbix.com/template_import_export.php
          Hide
          Otheus added a comment -

          I wouldn't say this is critical, but it is an error that Zabbix reports as an error the lack of an existing map during import. A patch to produce a warning and not error would be sufficient to alleviate the problems for the short-term.

          Show
          Otheus added a comment - I wouldn't say this is critical, but it is an error that Zabbix reports as an error the lack of an existing map during import. A patch to produce a warning and not error would be sufficient to alleviate the problems for the short-term.
          Hide
          Ivo Kurzemnieks added a comment - - edited

          (1) Translation strings added:

          • Value maps deleted
          • Cannot delete value maps
          • Value mappings
          • Value mappings for value maps will be updated!
          • Delete selected value maps?

          Alexander Vladishev CLOSED

          Ivo Kurzemnieks Added translation string:

          • Used in items

          Alexander Vladishev CLOSED

          Show
          Ivo Kurzemnieks added a comment - - edited (1) Translation strings added: Value maps deleted Cannot delete value maps Value mappings Value mappings for value maps will be updated! Delete selected value maps? Alexander Vladishev CLOSED Ivo Kurzemnieks Added translation string: Used in items Alexander Vladishev CLOSED
          Hide
          Ivo Kurzemnieks added a comment -

          RESOLVED in svn://svn.zabbix.com/branches/dev/ZBXNEXT-1679

          Show
          Ivo Kurzemnieks added a comment - RESOLVED in svn://svn.zabbix.com/branches/dev/ZBXNEXT-1679
          Hide
          Alexander Vladishev added a comment - - edited

          (2) valuemap.massdelete must be renamed to valuemap.delete

          Ivo Kurzemnieks RESOLVED in r56475

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (2) valuemap.massdelete must be renamed to valuemap.delete Ivo Kurzemnieks RESOLVED in r56475 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (3) valuemap.delete also must be used instead of the delete parameter; delete should be removed

          Ivo Kurzemnieks RESOLVED in r56475

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (3) valuemap.delete also must be used instead of the delete parameter; delete should be removed Ivo Kurzemnieks RESOLVED in r56475 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (5) "Undefined index" if $config['search_limit'] has small value

          Undefined index: valuemapid [adm.valuemapping.php:214 → CView->render() → include() in include/views/administration.general.valuemapping.list.php:56]
          Undefined index: valuemapid [adm.valuemapping.php:214 → CView->render() → include() in include/views/administration.general.valuemapping.list.php:56]
          Undefined index: name [adm.valuemapping.php:214 → CView->render() → include() in include/views/administration.general.valuemapping.list.php:57]
          Undefined index: valuemapid [adm.valuemapping.php:214 → CView->render() → include() in include/views/administration.general.valuemapping.list.php:57]
          

          Ivo Kurzemnieks RESOLVED in r56499

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (5) "Undefined index" if $config ['search_limit'] has small value Undefined index: valuemapid [adm.valuemapping.php:214 → CView->render() → include() in include/views/administration.general.valuemapping.list.php:56] Undefined index: valuemapid [adm.valuemapping.php:214 → CView->render() → include() in include/views/administration.general.valuemapping.list.php:56] Undefined index: name [adm.valuemapping.php:214 → CView->render() → include() in include/views/administration.general.valuemapping.list.php:57] Undefined index: valuemapid [adm.valuemapping.php:214 → CView->render() → include() in include/views/administration.general.valuemapping.list.php:57] Ivo Kurzemnieks RESOLVED in r56499 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (6) overlayDialog sould be extended to support action on ESC and [x] button click. It must reset check box.

          Ivo Kurzemnieks RESOLVED in r56480

          Alexander Vladishev

          • fixed order of the buttons
          • added "cancel" flag in all calls of the overlayDialog()
          • code improvements

          RESOLVED in r56491

          Ivo Kurzemnieks I completely disagree with button order. Feels wrong. Usually the dialogue button order depends on OS UI. Some systems use OK as first button and then Cancel. Also JIRA has first Save button and then Cancel button. Now the order of buttons is built in and Cancel is first button and then OK button. But as discussed, sadly it will not be changed for now.

          CLOSED

          Show
          Alexander Vladishev added a comment - - edited (6) overlayDialog sould be extended to support action on ESC and [x] button click. It must reset check box. Ivo Kurzemnieks RESOLVED in r56480 Alexander Vladishev fixed order of the buttons added "cancel" flag in all calls of the overlayDialog() code improvements RESOLVED in r56491 Ivo Kurzemnieks I completely disagree with button order. Feels wrong. Usually the dialogue button order depends on OS UI. Some systems use OK as first button and then Cancel . Also JIRA has first Save button and then Cancel button. Now the order of buttons is built in and Cancel is first button and then OK button. But as discussed, sadly it will not be changed for now. CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (7) This code does not work properly. It is not associative array.

          frontends/php/include/classes/export/CConfigurationExport.php:451

          $valuemapids = zbx_objectValues($items, 'valuemapid');
          
          foreach ($valuemapids as $valuemapid) {
              if ($valuemapid == 0) {
                  unset($valuemapids[$valuemapid]);
              }
          }
          
          $valuemapids = array_combine($valuemapids, $valuemapids);
          

          and

          frontends/php/include/classes/export/CConfigurationExport.php:589

          // Gather value maps. Value map IDs that are zeroes, should be skipped
          $valuemapids = zbx_objectValues($prototypes, 'valuemapid');           
               
          foreach ($valuemapids as $valuemapid) {
              if ($valuemapid == 0) {                           
                  unset($valuemapids[$valuemapid]);            
              }                                                             
          }                               
                                 
          $valuemapids = array_combine($valuemapids, $valuemapids);
          

          Ivo Kurzemnieks RESOLVED in r56484

          Alexander Vladishev Take a look at my changes in r56493.

          Ivo Kurzemnieks Good solution. Thanks!
          CLOSED

          Show
          Alexander Vladishev added a comment - - edited (7) This code does not work properly. It is not associative array. frontends/php/include/classes/export/CConfigurationExport.php:451 $valuemapids = zbx_objectValues($items, 'valuemapid'); foreach ($valuemapids as $valuemapid) { if ($valuemapid == 0) { unset($valuemapids[$valuemapid]); } } $valuemapids = array_combine($valuemapids, $valuemapids); and frontends/php/include/classes/export/CConfigurationExport.php:589 // Gather value maps. Value map IDs that are zeroes, should be skipped $valuemapids = zbx_objectValues($prototypes, 'valuemapid'); foreach ($valuemapids as $valuemapid) { if ($valuemapid == 0) { unset($valuemapids[$valuemapid]); } } $valuemapids = array_combine($valuemapids, $valuemapids); Ivo Kurzemnieks RESOLVED in r56484 Alexander Vladishev Take a look at my changes in r56493. Ivo Kurzemnieks Good solution. Thanks! CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (8) Unused code

          frontends/php/include/classes/export/CConfigurationExport.php:467
          frontends/php/include/classes/export/CConfigurationExport.php:606

          $valuemaps = $this->data['valueMaps'];

          Ivo Kurzemnieks RESOLVED in r56486

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (8) Unused code frontends/php/include/classes/export/CConfigurationExport.php:467 frontends/php/include/classes/export/CConfigurationExport.php:606 $valuemaps = $ this ->data['valueMaps']; Ivo Kurzemnieks RESOLVED in r56486 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (9) + operator must be used here because it works faster.

          frontends/php/include/classes/export/CConfigurationExport.php:484

          $this->data['valueMaps'] = zbx_array_merge($this->data['valueMaps'], $valuemaps);

          Ivo Kurzemnieks RESOLVED in r56488, r56489

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (9) + operator must be used here because it works faster. frontends/php/include/classes/export/CConfigurationExport.php:484 $ this ->data['valueMaps'] = zbx_array_merge($ this ->data['valueMaps'], $valuemaps); Ivo Kurzemnieks RESOLVED in r56488, r56489 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (10) This code must be located in beginning of the function (before processing of value maps).

          frontends/php/include/classes/export/CConfigurationExport.php:494

          // Remove items linked to discovered applications.
          foreach ($item['applications'] as $application) {
              if ($application['flags'] == ZBX_FLAG_DISCOVERY_CREATED) {
                  unset($items[$idx]);
                  continue 2;
              }
          }
          

          Ivo Kurzemnieks RESOLVED in r56490

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (10) This code must be located in beginning of the function (before processing of value maps). frontends/php/include/classes/export/CConfigurationExport.php:494 // Remove items linked to discovered applications. foreach ($item['applications'] as $application) { if ($application['flags'] == ZBX_FLAG_DISCOVERY_CREATED) { unset($items[$idx]); continue 2; } } Ivo Kurzemnieks RESOLVED in r56490 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (11) "Update existing" must be unchecked by default when importing value maps. Specification must be updated accordingly.

          Ivo Kurzemnieks Specification updated and RESOLVED in r56502

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (11) "Update existing" must be unchecked by default when importing value maps. Specification must be updated accordingly. Ivo Kurzemnieks Specification updated and RESOLVED in r56502 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (12) <mappings> tag must be REQUIRED

          Ivo Kurzemnieks RESOLVED in r56503

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (12) <mappings> tag must be REQUIRED Ivo Kurzemnieks RESOLVED in r56503 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (13) Permissions check must be removed in:

          frontends/php/include/classes/export/CConfigurationExport.php:183
          frontends/php/include/classes/import/CConfigurationImport.php:603

          Ivo Kurzemnieks Specification updated and RESOLVED in r56504

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (13) Permissions check must be removed in: frontends/php/include/classes/export/CConfigurationExport.php:183 frontends/php/include/classes/import/CConfigurationImport.php:603 Ivo Kurzemnieks Specification updated and RESOLVED in r56504 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (14) Take a look at my changes in r56445, r56468 and r56477.

          Ivo Kurzemnieks Thanks! Good improvements.
          CLOSED

          Show
          Alexander Vladishev added a comment - - edited (14) Take a look at my changes in r56445, r56468 and r56477. Ivo Kurzemnieks Thanks! Good improvements. CLOSED
          Hide
          richlv added a comment - - edited

          (15) when this is done, all official templates that reference value maps should be updated to include those value maps

          Alexander Vladishev It about Zabbix Templates/Official Templates page? There are no 3.0 templates.

          <richlv> yes, in that page 3.0 templates should be added - but only the ones that reference value maps

          Alexander Vladishev may be after release of 3.0.0?

          <richlv> after 3.0.0 final would be a bit too late - but after beta1 is out could be a good time

          Alexander Vladishev Ok, it can be closed now.

          CLOSED

          Show
          richlv added a comment - - edited (15) when this is done, all official templates that reference value maps should be updated to include those value maps Alexander Vladishev It about Zabbix Templates/Official Templates page? There are no 3.0 templates. < richlv > yes, in that page 3.0 templates should be added - but only the ones that reference value maps Alexander Vladishev may be after release of 3.0.0? < richlv > after 3.0.0 final would be a bit too late - but after beta1 is out could be a good time Alexander Vladishev Ok, it can be closed now. CLOSED
          Hide
          richlv added a comment - - edited

          (16) documentation

          Ivo Kurzemnieks Also should be good to look at:

          And don't forget:

          Ivo Kurzemnieks Docs updated:
          https://www.zabbix.com/documentation/3.0/manual/api/reference/configuration/import
          https://www.zabbix.com/documentation/3.0/manual/api/reference/configuration/export
          https://www.zabbix.com/documentation/3.0/manual/xml_export_import/hosts
          https://www.zabbix.com/documentation/3.0/manual/xml_export_import#what_can_be_exportedimported

          <richlv> thanks. the new column, "used in items", does not seem to be mentioned in the whatsnew

          Martins Valkovskis Added to https://www.zabbix.com/documentation/3.0/manual/introduction/whatsnew300#exporting_and_importing_value_maps

          Official documentation seems to be updated. RESOLVED

          Aleksandrs Saveljevs The XML in the example at https://www.zabbix.com/documentation/3.0/manual/api/reference/configuration/import and https://www.zabbix.com/documentation/3.0/manual/api/reference/configuration/export seems suspicious:

          "source": "<?xml version="1.0" encoding="UTF-8"?><!--?xml version=\"1.0\" encoding=\"UTF-8\"?--><zabbix_export>...
          
          "result": "<!--?xml version=\"1.0\" encoding=\"UTF-8\"?-->\n<zabbix_export>...
          

          Also, the following Zabbix.org pages seems to have not been updated as per richlv's suggestion: https://zabbix.org/wiki/Zabbix_Templates/Official_Templates and https://zabbix.org/wiki/Zabbix_Templates/SQLs_for_Official_Templates . REOPENED.

          Ivo Kurzemnieks import/export examples RESOLVED

          Aleksandrs Saveljevs On the import page, the double quotes in XML are not properly quoted for JSON:

          "source": "<?xml version="1.0" encoding="UTF-8"?><zabbix_export>...
          

          REOPENED

          Ivo Kurzemnieks Indeed. Sorry. RESOLVED

          Martins Valkovskis Updated as well:

          Please review. RESOLVED

          Aleksandrs Saveljevs Looks good. CLOSED.

          Show
          richlv added a comment - - edited (16) documentation whatsnew value mapping page https://www.zabbix.com/documentation/3.0/manual/vm_monitoring#ready-to-use_templates - note should be updated to mention possibility to import value maps from xml administration -> general - probably enough to change "create value maps" to "manage value maps" the first note in the official template page value map sql page to note that 3.0+ supports xml import and link to whatsnew section or value mapping page Ivo Kurzemnieks Also should be good to look at: Add value maps as importable/exportable objects Update example Modal windows and button order And don't forget: API documentation: export API documentation: import Ivo Kurzemnieks Docs updated: https://www.zabbix.com/documentation/3.0/manual/api/reference/configuration/import https://www.zabbix.com/documentation/3.0/manual/api/reference/configuration/export https://www.zabbix.com/documentation/3.0/manual/xml_export_import/hosts https://www.zabbix.com/documentation/3.0/manual/xml_export_import#what_can_be_exportedimported < richlv > thanks. the new column, "used in items", does not seem to be mentioned in the whatsnew Martins Valkovskis Added to https://www.zabbix.com/documentation/3.0/manual/introduction/whatsnew300#exporting_and_importing_value_maps Official documentation seems to be updated. RESOLVED Aleksandrs Saveljevs The XML in the example at https://www.zabbix.com/documentation/3.0/manual/api/reference/configuration/import and https://www.zabbix.com/documentation/3.0/manual/api/reference/configuration/export seems suspicious: "source": "<?xml version="1.0" encoding="UTF-8"?><!--?xml version=\"1.0\" encoding=\"UTF-8\"?--><zabbix_export>... "result": "<!--?xml version=\"1.0\" encoding=\"UTF-8\"?-->\n<zabbix_export>... Also, the following Zabbix.org pages seems to have not been updated as per richlv 's suggestion: https://zabbix.org/wiki/Zabbix_Templates/Official_Templates and https://zabbix.org/wiki/Zabbix_Templates/SQLs_for_Official_Templates . REOPENED. Ivo Kurzemnieks import/export examples RESOLVED Aleksandrs Saveljevs On the import page, the double quotes in XML are not properly quoted for JSON: "source": "<?xml version="1.0" encoding="UTF-8"?><zabbix_export>... REOPENED Ivo Kurzemnieks Indeed. Sorry. RESOLVED Martins Valkovskis Updated as well: https://zabbix.org/wiki/Zabbix_Templates/Official_Templates (updated note at the top) https://zabbix.org/wiki/Zabbix_Templates/SQLs_for_Official_Templates (added note below the first sql script) Please review. RESOLVED Aleksandrs Saveljevs Looks good. CLOSED.
          Hide
          Alexander Vladishev added a comment - - edited

          (17) Default selection of the "Create new" value maps in the Host and Template import forms must be discussed

          Alexander Vladishev Already discussed with richlv. "Create new" rule must be selected by default. Specification is updated accordingly.

          Ivo Kurzemnieks RESOLVED in r56512

          Alexander Vladishev CLOSED

          Show
          Alexander Vladishev added a comment - - edited (17) Default selection of the "Create new" value maps in the Host and Template import forms must be discussed Alexander Vladishev Already discussed with richlv . "Create new" rule must be selected by default. Specification is updated accordingly. Ivo Kurzemnieks RESOLVED in r56512 Alexander Vladishev CLOSED
          Hide
          Alexander Vladishev added a comment - - edited

          (18) "USED IN ITEMS" column must be added to display using value mappings in items and item prototypes. Column name should be accepted by Martins Valkovskis. Specification must be updated.

          Ivo Kurzemnieks Specification updated and RESOLVED in r56529

          Martins Valkovskis "Used in items" sounds good to me.

          Alexander Vladishev Take a look at my changes in r56553.

          Ivo Kurzemnieks Thanks! Good performance improvement.
          CLOSED

          Show
          Alexander Vladishev added a comment - - edited (18) "USED IN ITEMS" column must be added to display using value mappings in items and item prototypes. Column name should be accepted by Martins Valkovskis . Specification must be updated. Ivo Kurzemnieks Specification updated and RESOLVED in r56529 Martins Valkovskis "Used in items" sounds good to me. Alexander Vladishev Take a look at my changes in r56553. Ivo Kurzemnieks Thanks! Good performance improvement. CLOSED
          Hide
          Ivo Kurzemnieks added a comment -

          Implemented in pre-3.0.0alpha4 (trunk) r56556

          Show
          Ivo Kurzemnieks added a comment - Implemented in pre-3.0.0alpha4 (trunk) r56556
          Hide
          richlv added a comment - - edited

          (19) string changes in the spec seem to be missing the latest changes, would be nice to update

          Ivo Kurzemnieks RESOLVED

          <richlv> thank you, CLOSED

          Show
          richlv added a comment - - edited (19) string changes in the spec seem to be missing the latest changes, would be nice to update Ivo Kurzemnieks RESOLVED < richlv > thank you, CLOSED

            People

            • Assignee:
              Unassigned
              Reporter:
              Michal Ingeli
            • Votes:
              39 Vote for this issue
              Watchers:
              26 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: