[ZBX-20315] Host does not exist error when trying to import 5.4.8 Linux SNMP template Created: 2021 Dec 04  Updated: 2021 Dec 07  Resolved: 2021 Dec 07

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: 5.4.8
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Markus Birth Assignee: Oleksii Zagorskyi
Resolution: Software failure Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Docker: zabbix/zabbix-server-pgsql:alpine-latest as of 2021-12-03
Docker: zabbix/zabbix-web-nginx-pgsql:alpine-latest as of 2021-12-03


Attachments: PNG File Screenshot 2021-12-06 at 12.28.00.png     File template_os_linux_snmp_snmp.yaml    
Issue Links:
Duplicate

 Description   

Steps to reproduce:

  1. Delete existing SNMP templates
  2. Download https://github.com/zabbix/zabbix/tree/5.4.8/templates/ as ZIP and unpack
  3. Import/Upgrade ICMP Ping (works fine)
  4. Import EtherLike-MIB SNMP (works fine)
  5. Import Generic SNMP (works fine)
  6. Import Interfaces SNMP (works fine)
  7. Import Linux SNMP

Result:

"Import failed" error:

  • Incorrect trigger expression. Host "Linux SNMP" does not exist or you have no access to this host.

Expected:

Import success.



 Comments   
Comment by Oleksii Zagorskyi [ 2021 Dec 06 ]

Clarify please which exact file do you try to import?
I've tried to delete "Linux SNMP" template on my 5.4 test installation, then imported template_os_linux_snmp_snmp.yaml (which included multiple templates) and the "Linux SNMP" returned back.

The "Linux SNMP" template does not hold items/triggers itself, it just contains 7 other module templates linked to it.

Comment by Markus Birth [ 2021 Dec 06 ]

That is exactly the file I've tried to import and yet it fails for me. Here's a screenshot of the error message and the templates I've got in my Zabbix 5.4.8:

 

I'll also attach the actual file I've downloaded from Git and tried to import:

template_os_linux_snmp_snmp.yaml

 

Comment by Oleksii Zagorskyi [ 2021 Dec 06 ]

Your yaml file is exactly as I have downloaded form git too.
Can you install a new 5.4 database, point frontend to it and retry your test? Just to make sure the issue is not related to your environment.

Just a guess - it's possible that UUID (4d3a7adbb6964bd08f2b9d28e0da6496) used in the imported template is already used in some other template(s) which causes such behavior.

Comment by Markus Birth [ 2021 Dec 06 ]

Doesn't seem to be a problem with the UUID (at least not with the hosts):

zabbix=# select uuid,name from hosts;
               uuid               |               name
----------------------------------+-----------------------------------
 3598da1effdf4ed48074608f1422e3fd | EtherLike-MIB SNMP
 4cb1aabe2b704b5c882963c2ef87d8f6 | Generic SNMP
 809cd59886464ff3ad0a66d16fb1f2d8 | Interfaces SNMP
                                  | DS415+
                                  | RPi4
                                  | RPi2
                                  | cam4 (Wohnzimmer 2)
 22ba4d214399462c945a4b1f922ef14c | ADSB Feeder
 f881e6526429422d9ee8fd982fabd189 | Granny FritzBox Startseite
 a945c91b1b74482d907485c6c2674729 | Template Brother Printers
 f825736c97704be7b7dc5a945e08278f | Synology DiskStation
 ccfd2ee2f32044d18568c96ad423df0f | Template Amazon Kindle Firmware
                                  | Granny FritzBox
                                  | Brother MFC-L2750DW
                                  | gotbirth RPi3
                                  | Kindle Voyage
                                  | cam5 (Flur)
 f8f7908280354f2abeed07dc788c3747 | Template OS Linux by Zabbix agent
                                  | cam3 (Außen)
 37e5eb5606bc4abba66c8b20381a1e8a | ICMP Ping
(20 rows)

 

I'll setup a fresh 5.4 DB and try with that.

Comment by Markus Birth [ 2021 Dec 06 ]

It seems to choke on https://github.com/zabbix/zabbix/blob/master/ui/include/classes/api/services/CTriggerGeneral.php#L1626-L1628 because there's no hostid defined for the to-be-imported template/host "Linux SNMP".

Array(
  [Linux SNMP] => Array(
    [hostid] => 
    [host] => Linux SNMP
    [status] => 
    [keys] => Array(
      [icmpping] => Array(
        [itemid] => 
        [key] => icmpping
        [value_type] => 
        [flags] => 
      )
      [icmppingloss] => Array(
        [itemid] => 
        [key] => icmppingloss
        [value_type] => 
        [flags] => 
      )
      [icmppingsec] => Array(
        [itemid] => 
        [key] => icmppingsec
        [value_type] => 
        [flags] => 
      )
      [system.name] => Array(
        [itemid] => 
        [key] => system.name
        [value_type] => 
        [flags] => 
      )
      [system.uptime[sysUpTime.0]] => Array(
        [itemid] => 
        [key] => system.uptime
        [sysUpTime.0][value_type] => 
        [flags] => 
      )
      [zabbix[host,snmp,available]] => Array(
        [itemid] => 
        [key] => zabbix
        [host,snmp,available][value_type] => 
        [flags] => 
      )
    )
  )
) 

But I still have to try with a fresh database...

Comment by Markus Birth [ 2021 Dec 07 ]

Okay, tried with a completely fresh Docker setup ... and it works for some reason.  I just don't understand why it doesn't work with my existing set of containers (which, IIRC, started as some 5.2 version) created by the same stack.yml.

Comment by Markus Birth [ 2021 Dec 07 ]

Okay, looks like it was some PostgreSQL hiccup. After doing ANALYZE and VACUUM, the template suddenly imported fine. Thanks for nudging me into the right direction.  

Generated at Tue May 06 07:37:33 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.