Closed ykyuen closed 6 years ago
i have the following code snippet which i could get the triggers from zabbix
triggers, err := session.GetTriggers(zabbix.TriggerGetParams{ TriggerIDs: []string{ "14606", "14618", "14625", "14632", "14639", "14646", }, // GetParameters: zabbix.GetParameters{ // SortField: []string{ // "TriggerID", // }, // SortOrder: zabbix.SortOrderDescending, // }, })
it works fine and by default the returned triggers are sorted by TriggerID in asc order. I tried uncommenting the GetParameters block in order to change the sorting but then it will return no results.
TriggerID
GetParameters
What did i miss? Thanks =D
O, i figured it out~ it didn't work becoz i the sort field name is incorrect.
according to the zabbix api doc
Possible values are: triggerid, description, status, priority, lastchange and hostname.
=D
i have the following code snippet which i could get the triggers from zabbix
it works fine and by default the returned triggers are sorted by
TriggerID
in asc order. I tried uncommenting theGetParameters
block in order to change the sorting but then it will return no results.What did i miss? Thanks =D