I haven't been able to test the Event Log History, since we don't use those in our environment. Also, the history.get endpoint doesn't return the ValueType like item.get does, so I left it as a string.
Usage:
sevenDaysAgo := time.Now().AddDate(0, 0, -7)
for _, i := range items {
histories, err := api.GetHistories(zabbix.HistoryGetParams{
ItemIDs: []string{strconv.Itoa(i.ItemID)},
TimeFrom: float64(sevenDaysAgo.Unix())})
if len(histories) == 0 {
fmt.Printf("%s - No history found\n", i.ItemName)
continue
}
// do stuff with histories
}
I haven't been able to test the Event Log History, since we don't use those in our environment. Also, the history.get endpoint doesn't return the ValueType like item.get does, so I left it as a string.
Usage: