[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 |
||
| Attachments: |
|
||||
| Issue Links: |
|
||||
| Description |
|
Steps to reproduce:
Result: "Import failed" error:
Expected: Import success. |
| Comments |
| Comment by Oleksii Zagorskyi [ 2021 Dec 06 ] |
|
Clarify please which exact file do you try to import? 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. 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. |
| 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. |