Ad Widget

Collapse

Can't import templates, all fail

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aa777888
    Junior Member
    • Apr 2022
    • 3

    #1

    Can't import templates, all fail

    Brand new to Zabbix, brand new 6.0.3 install on Ubuntu with mysql and Apache.

    Literally the very first thing I do is go find an Edgerouter template here:



    I try to import it and it fails parsing the very first line. I tried a number of other templates, both yaml and xml format, and all fail parsing one line or another.

    Should I just blow the entire installation away and start over with zabbix 5.0? Without Edgemax/Ubiquiti templates I'm immediately dead in the water.

    Click image for larger version

Name:	Capture.jpg
Views:	4855
Size:	78.2 KB
ID:	443946

  • Answer selected by aa777888 at 29-04-2022, 15:41.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    You are probably trying to import something, that is not really a template file... There is no "<!DOCTYPE html>" anywhere in template file...

    Maybe you should try to copy all of this

    into a file and then import it...

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #2
      You are probably trying to import something, that is not really a template file... There is no "<!DOCTYPE html>" anywhere in template file...

      Maybe you should try to copy all of this

      into a file and then import it...

      Comment

      • aa777888
        Junior Member
        • Apr 2022
        • 3

        #3
        Damn, that was a rookie GitHub mistake, wasn't it

        Comment

        • jtnfoley
          Member
          • Mar 2022
          • 76

          #4
          ^this^
          You have to make sure you have downloaded the raw file, not the web page that displays the file on github.
          Try "Copy raw contents" and paste into a text editor, save with an appropriate name and import. This SHOULD ensure that you are importing the yaml/xml rather than an html webpage.

          Click image for larger version

Name:	zabbix_templ_github_copyraw.png
Views:	4705
Size:	9.7 KB
ID:	443980

          Comment

          • Glukas
            Junior Member
            • Nov 2021
            • 17

            #5
            I have same problem and all templates I get from GitHub now are coming without xml tags so even by using this "Copy raw contents" I get this:

            zabbix_export:
            version: '6.0'
            date: '2021-11-21T21:21:08Z'
            groups:
            -
            uuid: 7df96b18c230490a9a0a9e2307226338
            name: Templates
            templates:
            .
            .
            .

            And import fails with this error:
            Details Import failed
            • Cannot read XML: (4) Start tag expected, '<' not found [Line: 1 | Column: 1].
            Tried with two browsers, Chrome and Edge and it is exactly same for both.

            ​Any idea how to download templates properly?

            Thanks in advance!

            Comment

            • Glukas
              Junior Member
              • Nov 2021
              • 17

              #6
              OK, got it, looks like now they getting downloaded as yaml file instead of xml.
              So I either should save raw contents as .yaml or do right click on Raw and choose "Save link as" to get it saved as .yaml automatically.

              Comment

              • cyber
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Dec 2006
                • 4807

                #7
                Yaml is nowadays default...

                Comment

                • Glukas
                  Junior Member
                  • Nov 2021
                  • 17

                  #8
                  It is OK, but it would be nice to have there some notion about it.
                  Since file on save not always offered to be saved in proper format, one should know which format it is expected to be, instead of messing with it around...

                  Comment

                  • cyber
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Dec 2006
                    • 4807

                    #9
                    TBH, git lists this as yaml file, all the extension is present etc... How hard it can be?
                    I am pretty sure going from xml to yaml was mentioned in some versions release notes.. Carrying all the notes from version to version would make that doc a huge one... ​

                    Comment

                    Working...