mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Remove unused and redundant last_{hard/soft}_state
This commit is contained in:
parent
52c4defe6a
commit
b4aaa4ed3c
5 changed files with 8 additions and 29 deletions
|
|
@ -161,8 +161,8 @@ func userNotificationHistoryWorker(super *supervisor.Supervisor) {
|
|||
func stateHistoryWorker(super *supervisor.Supervisor) {
|
||||
statements := []string{
|
||||
`REPLACE INTO state_history (id, environment_id, endpoint_id, object_type, host_id, service_id, event_time, state_type,` +
|
||||
`soft_state, hard_state, previous_soft_state, previous_hard_state, attempt, last_soft_state, last_hard_state, output, long_output, max_check_attempts, check_source)` +
|
||||
`VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
||||
`soft_state, hard_state, previous_soft_state, previous_hard_state, attempt, output, long_output, max_check_attempts, check_source)` +
|
||||
`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 (?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
||||
|
|
@ -191,8 +191,6 @@ func stateHistoryWorker(super *supervisor.Supervisor) {
|
|||
values["previous_soft_state"],
|
||||
values["previous_hard_state"],
|
||||
values["attempt"],
|
||||
values["last_soft_state"],
|
||||
values["last_hard_state"],
|
||||
values["output"],
|
||||
values["long_output"],
|
||||
values["max_check_attempts"],
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ var (
|
|||
"check_source",
|
||||
"last_update",
|
||||
"last_state_change",
|
||||
"last_soft_state",
|
||||
"last_hard_state",
|
||||
"next_check",
|
||||
"next_update",
|
||||
}
|
||||
|
|
@ -48,6 +46,7 @@ type HostState struct {
|
|||
EnvId string `json:"environment_id"`
|
||||
StateType float32 `json:"state_type"`
|
||||
SoftState float32 `json:"state"`
|
||||
HardState float32 `json:"hard_state"`
|
||||
PreviousHardState float32 `json:"previous_hard_state"`
|
||||
Attempt float32 `json:"check_attempt"`
|
||||
Severity float32 `json:"severity"`
|
||||
|
|
@ -68,8 +67,6 @@ type HostState struct {
|
|||
CheckSource string `json:"check_source"`
|
||||
LastUpdate float32 `json:"last_update"`
|
||||
LastStateChange float32 `json:"last_state_change"`
|
||||
LastSoftState float32 `json:"last_soft_state"`
|
||||
LastHardState float32 `json:"last_hard_state"`
|
||||
NextCheck float32 `json:"next_check"`
|
||||
NextUpdate float32 `json:"next_update"`
|
||||
}
|
||||
|
|
@ -94,7 +91,7 @@ func (h *HostState) UpdateValues() []interface{} {
|
|||
utils.EncodeChecksum(h.EnvId),
|
||||
utils.IcingaStateTypeToString(h.StateType),
|
||||
h.SoftState,
|
||||
h.LastHardState,
|
||||
h.HardState,
|
||||
h.PreviousHardState,
|
||||
h.Attempt,
|
||||
h.Severity,
|
||||
|
|
@ -115,8 +112,6 @@ func (h *HostState) UpdateValues() []interface{} {
|
|||
h.CheckSource,
|
||||
h.LastUpdate,
|
||||
h.LastStateChange,
|
||||
h.LastSoftState,
|
||||
h.LastHardState,
|
||||
h.NextCheck,
|
||||
h.NextUpdate,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ var (
|
|||
"check_source",
|
||||
"last_update",
|
||||
"last_state_change",
|
||||
"last_soft_state",
|
||||
"last_hard_state",
|
||||
"next_check",
|
||||
"next_update",
|
||||
}
|
||||
|
|
@ -48,6 +46,7 @@ type ServiceState struct {
|
|||
EnvId string `json:"environment_id"`
|
||||
StateType float32 `json:"state_type"`
|
||||
SoftState float32 `json:"state"`
|
||||
HardState float32 `json:"hard_state"`
|
||||
PreviousHardState float32 `json:"previous_hard_state"`
|
||||
Attempt float32 `json:"check_attempt"`
|
||||
Severity float32 `json:"severity"`
|
||||
|
|
@ -68,8 +67,6 @@ type ServiceState struct {
|
|||
CheckSource string `json:"check_source"`
|
||||
LastUpdate float32 `json:"last_update"`
|
||||
LastStateChange float32 `json:"last_state_change"`
|
||||
LastSoftState float32 `json:"last_soft_state"`
|
||||
LastHardState float32 `json:"last_hard_state"`
|
||||
NextCheck float32 `json:"next_check"`
|
||||
NextUpdate float32 `json:"next_update"`
|
||||
}
|
||||
|
|
@ -94,7 +91,7 @@ func (s *ServiceState) UpdateValues() []interface{} {
|
|||
utils.EncodeChecksum(s.EnvId),
|
||||
utils.IcingaStateTypeToString(s.StateType),
|
||||
s.SoftState,
|
||||
s.LastHardState,
|
||||
s.HardState,
|
||||
s.PreviousHardState,
|
||||
s.Attempt,
|
||||
s.Severity,
|
||||
|
|
@ -115,8 +112,6 @@ func (s *ServiceState) UpdateValues() []interface{} {
|
|||
s.CheckSource,
|
||||
s.LastUpdate,
|
||||
s.LastStateChange,
|
||||
s.LastSoftState,
|
||||
s.LastHardState,
|
||||
s.NextCheck,
|
||||
s.NextUpdate,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -105,13 +105,12 @@ func syncStates(super *supervisor.Supervisor, objectType string) {
|
|||
mysqlObservers[objectType],
|
||||
`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 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
||||
`in_downtime, execution_time, latency, timeout, check_source, last_update, last_state_change, next_check, next_update) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`,
|
||||
id,
|
||||
super.EnvId,
|
||||
redisStateTypeToDBStateType(values["state_type"]),
|
||||
values["state"],
|
||||
values["last_hard_state"],
|
||||
values["hard_state"],
|
||||
values["previous_hard_state"],
|
||||
values["check_attempt"],
|
||||
redisIntToDBInt(values["severity"]),
|
||||
|
|
@ -132,8 +131,6 @@ func syncStates(super *supervisor.Supervisor, objectType string) {
|
|||
values["check_source"],
|
||||
values["last_update"],
|
||||
values["last_state_change"],
|
||||
values["last_soft_state"],
|
||||
values["last_hard_state"],
|
||||
values["next_check"],
|
||||
values["next_update"],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -142,8 +142,6 @@ CREATE TABLE host_state (
|
|||
|
||||
last_update bigint(20) unsigned NOT NULL,
|
||||
last_state_change bigint(20) unsigned NOT NULL,
|
||||
last_soft_state tinyint(1) unsigned NOT NULL,
|
||||
last_hard_state tinyint(1) unsigned NOT NULL,
|
||||
next_check bigint(20) unsigned NOT NULL,
|
||||
next_update bigint(20) unsigned NOT NULL,
|
||||
|
||||
|
|
@ -282,8 +280,6 @@ CREATE TABLE service_state (
|
|||
|
||||
last_update bigint(20) unsigned NOT NULL,
|
||||
last_state_change bigint(20) unsigned NOT NULL,
|
||||
last_soft_state tinyint(1) unsigned NOT NULL,
|
||||
last_hard_state tinyint(1) unsigned NOT NULL,
|
||||
next_check bigint(20) unsigned NOT NULL,
|
||||
next_update bigint(20) unsigned NOT NULL,
|
||||
|
||||
|
|
@ -838,8 +834,6 @@ CREATE TABLE state_history (
|
|||
previous_soft_state tinyint(1) unsigned NOT NULL,
|
||||
previous_hard_state tinyint(1) unsigned NOT NULL,
|
||||
attempt tinyint(1) unsigned NOT NULL,
|
||||
last_soft_state tinyint(1) unsigned NOT NULL,
|
||||
last_hard_state tinyint(1) unsigned NOT NULL,
|
||||
output text DEFAULT NULL,
|
||||
long_output text DEFAULT NULL,
|
||||
max_check_attempts int(10) unsigned NOT NULL,
|
||||
|
|
|
|||
Loading…
Reference in a new issue