[ZBX-22016] host.get method returns no results for hosts with no interfaces when filtering by "hostid" Created: 2022 Dec 02  Updated: 2024 Apr 10  Resolved: 2022 Dec 21

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 6.2.5
Fix Version/s: 6.0.13rc1, 6.2.7rc1, 6.4.0beta5, 6.4 (plan)

Type: Problem report Priority: Major
Reporter: Martin Mørch Assignee: Ivo Kurzemnieks
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Rocky Linux release 8.7 (Green Obsidian)
zabbix-web.noarch 6.2.5-release1.el8
zabbix-web-deps.noarch 6.2.5-release1.el8
zabbix-web-mysql.noarch 6.2.5-release1.el8


Team: Team B
Sprint: Sprint 95 (Dec 2022)
Story Points: 0.125

 Description   

Steps to reproduce:

  1. Create host without interfaces and note down the host ID and host name
  2. Perform API request "host.get" with params "{"filter": {"hostid": "<HOST ID>"}}"
  3. No results are returned
  4. Perform API request "host.get" with params "{"filter": {"host": "<HOST NAME>"}}"
  5. Host results are returned correctly
  6. Create SNMP interface on host
  7. Perform API request "host.get" with params "{"filter": {"hostid": "<HOST ID>"}}"
  8. Host results are returned correctly

Result:
Using host.get to retrieve host information using filter "hostid", returns empty host results if the host has no interfaces configured.

Using filter "host", host results are correctly returned. Add any interface to host and use filter "hostid", host results are correctly returned.

Expected:
Using host.get with filter "hostid" should return results if the hostid exists, whether or not the host has interface configured.



 Comments   
Comment by Ivo Kurzemnieks [ 2022 Dec 06 ]

Fixed in development branch feature/ZBX-22016-6.0

Comment by Ivo Kurzemnieks [ 2022 Dec 16 ]

Fixed in:

Generated at Sun Aug 03 03:40:42 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.