mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Fix previous hard state
This commit is contained in:
parent
2181150007
commit
77e3333cd3
4 changed files with 4 additions and 4 deletions
|
|
@ -111,7 +111,7 @@ func stateHistoryWorker(super *supervisor.Supervisor) {
|
|||
statements := []string{
|
||||
`REPLACE INTO state_history (id, environment_id, endpoint_id, object_type, host_id, service_id, change_time, state_type,` +
|
||||
`soft_state, hard_state, previous_hard_state, attempt, last_soft_state, last_hard_state, output, long_output, max_check_attempts, check_source)` +
|
||||
`VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
||||
`VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
||||
`REPLACE INTO history (id, environment_id, endpoint_id, object_type, host_id, service_id, notification_history_id,` +
|
||||
`state_history_id, downtime_history_id, comment_history_id, flapping_history_id, event_type, event_time)` +
|
||||
`VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ type HostState struct {
|
|||
StateType float32 `json:"state_type"`
|
||||
SoftState float32 `json:"state"`
|
||||
HardState float32 `json:"NONE"` //TODO (NoH): I'm not sure where to get this from
|
||||
PreviousHardState uint8 `json:"previous_hard_state"`
|
||||
PreviousHardState float32 `json:"previous_hard_state"`
|
||||
Attempt float32 `json:"check_attempt"`
|
||||
Severity float32 `json:"severity"`
|
||||
Output string `json:"output"`
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ type ServiceState struct {
|
|||
StateType float32 `json:"state_type"`
|
||||
SoftState float32 `json:"state"`
|
||||
HardState float32 `json:"NONE"` //TODO (NoH): I'm not sure where to get this from
|
||||
PreviousHardState uint8 `json:"previous_hard_state"`
|
||||
PreviousHardState float32 `json:"previous_hard_state"`
|
||||
Attempt float32 `json:"check_attempt"`
|
||||
Severity float32 `json:"severity"`
|
||||
Output string `json:"output"`
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ func syncStates(super *supervisor.Supervisor, objectType string) {
|
|||
`REPLACE INTO `+objectType+`_state (`+objectType+`_id, environment_id, state_type, soft_state, hard_state, previous_hard_state, attempt, severity, output, long_output, performance_data,`+
|
||||
`check_commandline, is_problem, is_handled, is_reachable, is_flapping, is_acknowledged, acknowledgement_comment_id,`+
|
||||
`in_downtime, execution_time, latency, timeout, check_source, last_update, last_state_change, last_soft_state,`+
|
||||
`last_hard_state, next_check, next_update) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
||||
`last_hard_state, next_check, next_update) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
||||
id,
|
||||
super.EnvId,
|
||||
redisStateTypeToDBStateType(values["state_type"]),
|
||||
|
|
|
|||
Loading…
Reference in a new issue