Ad Widget

Collapse

Get hosts without linked templates via API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • johndoe2374
    Member
    • Aug 2021
    • 80

    #1

    Get hosts without linked templates via API

    Hello everyone.

    I've just started to learn how to use Zabbix API (v. 5.4.3) and currently trying to get list of hosts which are not linked with any template.

    First of all I've tried to use "templateids" parameter being set to null:

    Code:
    {
    "jsonrpc": "2.0",
    "method": "host.get",
    "params": {
    "output": [
    "name",
    "templateids"
    ],
    "filter": {
    "templateids": null
    }
    },
    "auth": "mytoken",
    "id": 6
    }
    Result gives all the hosts, filtering doesn't affect them. I've also tried to use search with option "excludeSearch" and a wildcard for any symbol as a search option, but result is the same.

    So, I wonder if it's just me not understanding how to work with API correctly or it's not really possible to do using API and I'll have to dive into learning direct SQL queries in DB.
Working...