This commit is contained in:
10
main.go
10
main.go
@@ -292,15 +292,15 @@ func main() {
|
||||
|
||||
if hostFound {
|
||||
|
||||
// make sure that this event is within 15 minutes of the corresponding host failed event
|
||||
unreachableStartComparison := h.CreatedTime.In(location).Add(time.Duration(int64(time.Minute) * -15))
|
||||
unreachableEndComparison := h.CreatedTime.In(location).Add(time.Duration(int64(time.Minute) * 15))
|
||||
// make sure that this event is within 10 minutes of the corresponding host failed event
|
||||
unreachableStartComparison := h.CreatedTime.In(location).Add(time.Duration(int64(time.Minute) * -10))
|
||||
unreachableEndComparison := h.CreatedTime.In(location).Add(time.Duration(int64(time.Minute) * 10))
|
||||
|
||||
if haFailedTime.Before(unreachableEndComparison) && haFailedTime.After(unreachableStartComparison) {
|
||||
haUnreachableEvents = append(haUnreachableEvents, h)
|
||||
log.Printf("Host %s unreachable HA status event at %s : '%s'\n", h.Host.Name, h.CreatedTime.In(location).Format(time.ANSIC), h.FullFormattedMessage)
|
||||
log.Printf("Recording host %s unreachable HA status event at %s\n", h.Host.Name, h.CreatedTime.In(location).Format(time.ANSIC))
|
||||
} else {
|
||||
log.Printf("Host %s unreachable HA status event at %s was before %s or after %s\n", h.Host.Name, h.CreatedTime.In(location).Format(time.ANSIC),
|
||||
log.Printf("Host %s HA failure time at %s was before %s or after %s\n", h.Host.Name, haFailedTime.Format(time.ANSIC),
|
||||
unreachableStartComparison, unreachableEndComparison)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user