I am trying to retrieve all hosts that start with a certain sequence of characters via Zabbix API. Here's the relevant part of the code (python)
I'm following the template from the docs -> https://www.zabbix.com/documentation...rence/host/get Retrieving data by name
I am trying to use the '*' character to indicate that whatever comes after the first couple of characters can be anything. Sadly, this approach doesn't seem to work. I didn't find anything helpful in the docs regarding this issue, so I am coming here to ask if this is even possible?
Before someone suggests, yes this is the only way I want to do this, I don't want to sort by tags, templates, host groups etc..
My zabbix version is 6.0
Code:
r = requests.post(ZABBIX_API_URL,
json={
"jsonrpc": "2.0",
"method": "host.get",
"params": {
"filter": {
"host": [
"FOO-*"
]
}
},
"id": 2,
"auth": AUTHTOKEN
})
I'm following the template from the docs -> https://www.zabbix.com/documentation...rence/host/get Retrieving data by name
I am trying to use the '*' character to indicate that whatever comes after the first couple of characters can be anything. Sadly, this approach doesn't seem to work. I didn't find anything helpful in the docs regarding this issue, so I am coming here to ask if this is even possible?
Before someone suggests, yes this is the only way I want to do this, I don't want to sort by tags, templates, host groups etc..
My zabbix version is 6.0
Comment