initial fix

This commit is contained in:
yesoreyeram
2025-01-03 09:18:37 +00:00
parent dbcc008489
commit 374c83d17d
5 changed files with 143 additions and 30 deletions

View File

@@ -494,13 +494,7 @@ func (ds *Zabbix) GetAllGroups(ctx context.Context) ([]Group, error) {
params := ZabbixAPIParams{
"output": []string{"name", "groupid"},
"sortfield": "name",
}
// 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
"with_hosts": true,
}
result, err := ds.Request(ctx, &ZabbixAPIRequest{Method: "hostgroup.get", Params: params})