[ZBX-16398] dservice.get - incorrect filtering by dcheckids Created: 2019 Jul 22  Updated: 2024 Apr 10  Resolved: 2019 Sep 05

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A)
Affects Version/s: 4.0.10
Fix Version/s: 4.0.13rc1, 4.2.7rc1, 4.4.0alpha3, 4.4 (plan)

Type: Problem report Priority: Minor
Reporter: Valdis Murzins Assignee: Vasily Goncharenko (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team D
Team: Team D
Sprint: Sprint 55 (Aug 2019), Sprint 54 (Jul 2019)
Story Points: 0.125

 Description   

When performing dservice.get and filtering services by dcheckids, this API will return all services, that were discovered by drules that have selected dchecks.

Steps to reproduce:

  1. Create Discovery rule with two Checks.
  2. Discover a host with two services (both services are based on different checks)
  3. Now perform an API request like this:
    {
       "jsonrpc": "2.0",
        "method": "dservice.get",
        "params": {
    		"dcheckids": [1234]
        },
        "auth": "{{auth}}",
        "id": 1
    }

Result: It will return both services, including the one, that was discovered based on other discovery check.
Expected: Only service, based on requested dcheck should be returned.



 Comments   
Comment by richlv [ 2019 Jul 23 ]

Does quoting dcheckid help?

Comment by Valdis Murzins [ 2019 Jul 25 ]

Hi richlv,

There is an error in logic, how API filters out such services. So quoting will not change the output.
Note: This error is not impacting fronted, as this filter is not used there.

Comment by richlv [ 2019 Jul 25 ]

Got it, thank you for the clarification.

Comment by Vasily Goncharenko (Inactive) [ 2019 Aug 08 ]

Fixed in development branch feature/ZBX-16398-4.0

Comment by Vasily Goncharenko (Inactive) [ 2019 Aug 29 ]

Fixed in:

  • 4.0.13rc1 7158ee5aead
  • 4.2.7rc1 2bb4667180d
  • 4.4.0alpha3 (master) ea991f8fdaf
Generated at Sat Apr 20 06:11:36 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.