Fix querying and authentication for Zabbix v7.0+ (#1931)
* Fix querying for Zabbix v7.2+ * Update check from 7.2 to 7.0 * Fix also select acknowledges key * Remove unsused methods * release commit 4.6.0 --------- Co-authored-by: yesoreyeram <153843+yesoreyeram@users.noreply.github.com>
This commit is contained in:
@@ -494,7 +494,13 @@ func (ds *Zabbix) GetAllGroups(ctx context.Context) ([]Group, error) {
|
||||
params := ZabbixAPIParams{
|
||||
"output": []string{"name", "groupid"},
|
||||
"sortfield": "name",
|
||||
"real_hosts": true,
|
||||
}
|
||||
|
||||
// Zabbix v7.0 and later removed `real_hosts` parameter and replaced it with `with_hosts`
|
||||
if ds.version < 70 {
|
||||
params["real_hosts"] = true
|
||||
} else {
|
||||
params["with_hosts"] = true
|
||||
}
|
||||
|
||||
result, err := ds.Request(ctx, &ZabbixAPIRequest{Method: "hostgroup.get", Params: params})
|
||||
|
||||
Reference in New Issue
Block a user