Align time series data if possible

This commit is contained in:
Alexander Zobnin
2021-05-31 17:42:24 +03:00
parent 4f7699442e
commit 7d5b7cad3e
8 changed files with 99 additions and 109 deletions

View File

@@ -243,7 +243,7 @@ func filterGroupsByQuery(items []Group, filter string) ([]Group, error) {
func (ds *Zabbix) GetAllItems(ctx context.Context, hostids []string, appids []string, itemtype string) ([]*Item, error) {
params := ZabbixAPIParams{
"output": []string{"itemid", "name", "key_", "value_type", "hostid", "status", "state"},
"output": []string{"itemid", "name", "key_", "value_type", "hostid", "status", "state", "units", "valuemapid", "delay"},
"sortfield": "name",
"webitems": true,
"filter": map[string]interface{}{},

View File

@@ -40,14 +40,17 @@ func (r *ZabbixAPIRequest) String() string {
type Items []Item
type Item struct {
ID string `json:"itemid,omitempty"`
Key string `json:"key_,omitempty"`
Name string `json:"name,omitempty"`
ValueType int `json:"value_type,omitempty,string"`
HostID string `json:"hostid,omitempty"`
Hosts []ItemHost `json:"hosts,omitempty"`
Status string `json:"status,omitempty"`
State string `json:"state,omitempty"`
ID string `json:"itemid,omitempty"`
Key string `json:"key_,omitempty"`
Name string `json:"name,omitempty"`
ValueType int `json:"value_type,omitempty,string"`
HostID string `json:"hostid,omitempty"`
Hosts []ItemHost `json:"hosts,omitempty"`
Status string `json:"status,omitempty"`
State string `json:"state,omitempty"`
Delay string `json:"delay,omitempty"`
Units string `json:"units,omitempty"`
ValueMapID string `json:"valuemapid,omitempty"`
}
type ItemHost struct {