diff --git a/main.go b/main.go index 7dd4efc..1bb1a40 100644 --- a/main.go +++ b/main.go @@ -216,6 +216,7 @@ func main() { begin := flag.Duration("b", time.Hour, "Begin time") // default BeginTime is 1h ago end := flag.Duration("e", 0, "End time") fuzzyMinutes := flag.Int("fuzziness", 5, "Number of minutes to offset VM restart time when searching for related Host failure event") + unreachableMinutes := flag.Int("unreachable", 20, "Number of minutes to search for host HA events either side of a VM failure") flag.Parse() // Print logs to file @@ -293,8 +294,8 @@ func main() { // make sure that this event is within 10 minutes either side of the corresponding host failed event if hostFound { - unreachableStartComparison := h.CreatedTime.In(location).Add(time.Duration(int64(time.Minute) * -10)) - unreachableEndComparison := h.CreatedTime.In(location).Add(time.Duration(int64(time.Minute) * 10)) + unreachableStartComparison := h.CreatedTime.In(location).Add(time.Duration(int64(time.Minute) * -1 * *unreachableMinutes)) + unreachableEndComparison := h.CreatedTime.In(location).Add(time.Duration(int64(time.Minute) * *unreachableMinutes)) if haFailedTime.Before(unreachableEndComparison) && haFailedTime.After(unreachableStartComparison) { haUnreachableEvents = append(haUnreachableEvents, h)