From fe4b453ca2e800693e2efe6eacd4485fa12f8b8d Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Mon, 11 Nov 2019 13:20:48 +0100 Subject: [PATCH] State: Read hard_state/last_hard_state only once --- configobject/objecttypes/host/hoststate/hoststate.go | 3 +-- configobject/objecttypes/service/servicestate/servicestate.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/configobject/objecttypes/host/hoststate/hoststate.go b/configobject/objecttypes/host/hoststate/hoststate.go index 60b0e563..4ef9e131 100644 --- a/configobject/objecttypes/host/hoststate/hoststate.go +++ b/configobject/objecttypes/host/hoststate/hoststate.go @@ -48,7 +48,6 @@ type HostState struct { EnvId string `json:"environment_id"` StateType float32 `json:"state_type"` SoftState float32 `json:"state"` - HardState float32 `json:"last_hard_state"` PreviousHardState float32 `json:"previous_hard_state"` Attempt float32 `json:"check_attempt"` Severity float32 `json:"severity"` @@ -95,7 +94,7 @@ func (h *HostState) UpdateValues() []interface{} { utils.EncodeChecksum(h.EnvId), utils.IcingaStateTypeToString(h.StateType), h.SoftState, - h.HardState, + h.LastHardState, h.PreviousHardState, h.Attempt, h.Severity, diff --git a/configobject/objecttypes/service/servicestate/servicestate.go b/configobject/objecttypes/service/servicestate/servicestate.go index 30fe7530..5f50a4db 100644 --- a/configobject/objecttypes/service/servicestate/servicestate.go +++ b/configobject/objecttypes/service/servicestate/servicestate.go @@ -48,7 +48,6 @@ type ServiceState struct { EnvId string `json:"environment_id"` StateType float32 `json:"state_type"` SoftState float32 `json:"state"` - HardState float32 `json:"last_hard_state"` PreviousHardState float32 `json:"previous_hard_state"` Attempt float32 `json:"check_attempt"` Severity float32 `json:"severity"` @@ -95,7 +94,7 @@ func (s *ServiceState) UpdateValues() []interface{} { utils.EncodeChecksum(s.EnvId), utils.IcingaStateTypeToString(s.StateType), s.SoftState, - s.HardState, + s.LastHardState, s.PreviousHardState, s.Attempt, s.Severity,