Importing modified configuration

For our first XML export/import, we won't do large-scale scripting. Instead, let's make a simple modification. In the saved zbx_export_templates.xml file, find the item block with the net.tcp.service[smtp] key. An item block starts with an <item> tag and ends with an </item> tag. Copy this item block and insert it below the existing block, and then change the item name to POP3 server status and the key to net.tcp.service[pop3].

Save this as a new file. Now, on to the actual import process—perform the following steps:

  1. Back in the frontend, in the Configuration | Templates section, click on Import in the upper right-hand corner. In this form, click on Choose file next to the Import file field and choose the saved file.
  2. Feel free to explore the Rules section, although the defaults will do for us. The only types of entities we're interested in are missing items, and the respective checkbox in the Create new column next to Items is already marked.
  3. Click on Import to proceed. This should complete successfully, so click on Details in the upper-left corner. While all other records will be about updating, there should be two entries about an item being created. These will be the only ones that make any changes, as all of the updates do nothing—the data in the XML file is the same as in the database. As we're adding this item for a template, it also gets added to all other hosts and templates that're linked against this one. In previous versions, we would get detailed information about this, but in Zabbix 4.0, we only get a confirmation that the import was successful:

Let's verify that this item was added with the key we used in the XML file. Navigate to Configuration | Hosts, make sure Linux servers is selected in the Group drop-down menu, and click on the Items link next to the Another host entry. Our new item should be visible in the item list, showing that it's been correctly added to the linked host. Remember that we only added it to the upstream template in our import process:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset