Ad Widget

Collapse

Importing Map XMLs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elfrancesco
    Junior Member
    • Feb 2011
    • 4

    #1

    Importing Map XMLs

    Hi,

    I am trying to generate a Map for about 50 remote Sites with only one Host in it.
    I made a "sample Map" that i exported to XML to be able to generate the 50 other maps.

    My problem is about the selementid tag wich seems to be auto incremented by zabbix at the map creation.
    I could of course increment myself this number in each generated maps or choose a high number wich will certainly never be used by zabbix but i am not sure what might be the proper solution to not interfere with zabbix's way of working.

    Thanks by advance of any help.

    Cheers,
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    i have a suspicion that selementids are only used for map link reference and must not have any connection to the selementids in the actual db where xml is imported. please let me know whether that matches your observations
    Zabbix 3.0 Network Monitoring book

    Comment

    • elfrancesco
      Junior Member
      • Feb 2011
      • 4

      #3
      Originally posted by richlv
      i have a suspicion that selementids are only used for map link reference and must not have any connection to the selementids in the actual db where xml is imported. please let me know whether that matches your observations
      Hi,
      Thanks for your answer.
      After looking into zabbix source, i have noticed that it doesn't matter what selementids are during the import phase.
      Zabbix use the selementsid in the import xml to keep the interconnection of elements. But it generates new selementids.
      It looks into the table ids where it keeps track of the next available id for every tables.

      So you can even not mention the selementid tag in your import if you don't need any connection between your elements.

      Cheers,

      Comment

      • jalfrey
        Junior Member
        • Mar 2012
        • 28

        #4
        importing maps with links on them

        I am able to import maps with hosts on them by removing the seliementid field from the xml. If I leave it in and set it to random values I get one error per host I attempt to import.

        I see the link notation is as follows
        <links>
        <link>
        <selementid1>18</selementid1>
        <selementid2>17</selementid2>
        <drawtype>0</drawtype>
        <color>00CC00</color>
        <linktriggers/>
        </link>
        </links>

        Since the link notation requires the selemetid to exist and the importer won't import by ID how do I you define linkes in the importable file?

        Comment

        • jalfrey
          Junior Member
          • Mar 2012
          • 28

          #5
          after some reading on the web I was able to find the main zabbix doc on this:
          http://www.zabbix.com/documentation/..._export_import

          It says that you can set the selementid to anything as long as it's unique during import. I tried that and I'm getting some other errors. I also discovered a bug. If you create a couple of elements link them and export them you will get something that looks like this:

          <links>
          <link>
          <selementid1>18</selementid1>
          <selementid2>17</selementid2>
          <drawtype>0</drawtype>
          <color>00CC00</color>
          <linktriggers/>
          </link>
          </links>

          As you can see there is a close <linktriggers/> but no opening tag for that one. So based on the documentation linked above.

          <link>
          <selementid1>100100000000399</selementid1>
          <selementid2>100100000000402</selementid2>
          <drawtype>0</drawtype>
          <color>00AA00</color>
          <linktriggers>
          </linktriggers>
          </link>

          you need an opening tag. But there is no value defined between the tags so in theory you should just leave them out.

          Still getting the following errors on import

          Undefined index: images [include/export.inc.php:573]
          Invalid argument supplied for foreach() [include/export.inc.php:576]
          Map [VPN endpoints radial linked] skipped - user rule

          Comment

          • jalfrey
            Junior Member
            • Mar 2012
            • 28

            #6
            ok I found my mistake. I had a </selements> at the end of my links section which was making a mess. The <linktriggers/> works fine. This is not a bug just a mistake on my part.

            Comment

            Working...