Ad Widget

Collapse

Template Import/Export

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wigmund
    Junior Member
    • Jan 2020
    • 16

    #1

    Template Import/Export

    I've exported my templates to json, all seems good, output nice and concise.
    When I try and import the same json, it fails saying some non mandatory fields (description) are missing? Is this expected or am I doing something wrong?
  • Wigmund
    Junior Member
    • Jan 2020
    • 16

    #2
    I added the description field to the top level templates (if missing), but then the error referred to missing status tag in the Items... this could be a painful process! Why would the export create json which cannot be imported? Does XML output have the same problem or is it more complete or is there a way to force the json to be created with all fields defined?

    Comment

    • Wigmund
      Junior Member
      • Jan 2020
      • 16

      #3
      OK, so exporting a template with no description to XML using the GUI creates valid XML without the description field element (I assume in a similar way to the json formatting). Then I can import the same template (after deleting the existing one) and it imports successfully! What is going on differently here? I think I must be missing something...

      Comment

      • Wigmund
        Junior Member
        • Jan 2020
        • 16

        #4
        My further investigations have led to nothing. Has anyone else experienced this or am I on my own here?

        Comment

        • Atsushi
          Senior Member
          • Aug 2013
          • 2028

          #5
          It is very difficult to advise because the detailed version of Zabbix you are using is not provided.
          For example, are you trying to export and import templates between different versions of Zabbix? File formats may not be completely compatible between different versions.

          Comment

          • Wigmund
            Junior Member
            • Jan 2020
            • 16

            #6
            Sorry, its between the same instance of Zabbix, version 4.4

            Comment

            • Atsushi
              Senior Member
              • Aug 2013
              • 2028

              #7
              4.4 is not a detailed version number. Are you using 4.4.7?
              Various bugs are fixed by minor revisions. If you are not using the latest version, check the release notes to see if it has been fixed by a later minor version upgrade.

              Comment

              • Wigmund
                Junior Member
                • Jan 2020
                • 16

                #8
                4.4 was the version number recorded in the XML export file header, however the detailed version number is 4.4.3.
                I've since checked the import code and ensured that 4.4 is specified as the version (4.4.3 isn't a supported version), this seems to work better as previously it was set to 4.0.
                Will investigate further.

                Comment

                • Wigmund
                  Junior Member
                  • Jan 2020
                  • 16

                  #9
                  Ok, so big improvement so far, thank you, I've managed to import Templates, including Items, Applications and Triggers.
                  The problem now comes with Discovery Rules. If these are imported it throws an error saying it 'cannot find host group xxx for host prototype' (-32500), but the host group already exists within the zabbix instance?
                  I've had a look through the issues and release notes but cannot find anything (apart from ZBX-17464 which seems unrelated).

                  Also, is there a way for the import to continue importing even if individual template imports fail?

                  Comment

                  • Wigmund
                    Junior Member
                    • Jan 2020
                    • 16

                    #10
                    It appears the "group_links" element within the "host_prototypes" section of "discovery_rules" for a template isn't finding the currently available Host Groups (I've checked they are defined as Host Groups).

                    Comment

                    • Wigmund
                      Junior Member
                      • Jan 2020
                      • 16

                      #11
                      Working on getting 4.47/8 installed. Hopefully this will fix the problem?

                      Comment

                      Working...