Hi!
Odd issue with our Zabbix 6.0.18 environment:
All recently added hosts can't be found when searching by partial or full hostname in monitoring > hosts and using the name filter. Hosts which were configured before the upgrade to 6.0 (from 3.0 + mysql --> postgres migration) can still be found.
Enabling debug mode on the UI showed me the query, and I can recreate the problem when I search directly in the database:
Original query (from UI debug output):
zabbix=# SELECT h.hostid,h.name,h.status FROM hosts h WHERE h.flags IN (0,4) AND h.status IN (0,1) AND ((h.name_upper LIKE '%TEST0015%' ESCAPE '!')) ORDER BY h.name LIMIT 20001;
hostid | name | status
--------+------+--------
(0 rows)
Edited query, where I replaced 'h.name_upper' with `h.name` and included 'h.name_upper' in the SELECT statement to see it:
zabbix=# SELECT h.hostid,h.name,h.name_upper,h.status FROM hosts h WHERE h.flags IN (0,4) AND h.status IN (0,1) AND ((h.name LIKE '%TEST0015-AP%' ESCAPE '!')) ORDER BY h.name LIMIT 20001;
hostid | name | name_upper | status
--------+-----------------+------------+--------
118320 | TEST0015-AP0001 | | 0
118321 | TEST0015-AP0002 | | 0
118322 | TEST0015-AP0003 | | 0
118323 | TEST0015-AP0004 | | 0
118324 | TEST0015-AP0005 | | 0
119491 | TEST0015-AP0006 | | 0
119492 | TEST0015-AP0007 | | 0
118317 | TEST0015-AP0008 | | 0
118316 | TEST0015-AP0009 | | 0
118314 | TEST0015-AP0010 | | 0
119498 | TEST0015-AP0011 | | 0
119499 | TEST0015-AP0012 | | 0
119500 | TEST0015-AP0013 | | 0
119501 | TEST0015-AP0014 | | 0
119502 | TEST0015-AP0015 | | 0
119494 | TEST0015-AP0016 | | 0
119493 | TEST0015-AP0017 | | 0
119497 | TEST0015-AP0018 | | 0
119496 | TEST0015-AP0019 | | 0
119495 | TEST0015-AP0020 | | 0
(20 rows)
From the above I can see the reason why the UI is not returning anything is due to the fact that the field name_upper in the database is not being populated for newly added hosts.
I have looked at the change logs to see if this might have been resolved between 6.0.18 and 6.0.22, but I don't believe there is anything related.
Any idea anyone?
Thanks
Stefano
6.0.13 src says "DBpatch_6000008") ... Something with that triggers there? There should be 2 triggers for hosts table... for insert and for update
Comment