State: Read hard_state/last_hard_state only once

This commit is contained in:
Noah Hilverling 2019-11-11 13:20:48 +01:00
parent 2b0088e132
commit fe4b453ca2
2 changed files with 2 additions and 4 deletions

View file

@ -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,

View file

@ -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,