Merge pull request #111 from Icinga/bugfix/state-allow-last_update-to-be-null

State: Allow last_update to be null
This commit is contained in:
Alexander Aleksandrovič Klimov 2020-01-31 12:12:54 +01:00 committed by GitHub
commit 8cb3c72f74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 29 deletions

View file

@ -44,33 +44,33 @@ var (
)
type HostState struct {
HostId string `json:"id"`
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"`
Output string `json:"output"`
LongOutput string `json:"long_output"`
PerformanceData string `json:"performance_data"`
CheckCommandline string `json:"commandline"`
IsProblem bool `json:"is_problem"`
IsHandled bool `json:"is_handled"`
IsReachable bool `json:"is_reachable"`
IsFlapping bool `json:"is_flapping"`
IsAcknowledged bool `json:"is_acknowledged"`
AcknowledgementCommentId string `json:"acknowledgement_comment_id"`
InDowntime bool `json:"in_downtime"`
ExecutionTime float32 `json:"execution_time"`
Latency float32 `json:"latency"`
Timeout float32 `json:"check_timeout"`
CheckSource string `json:"check_source"`
LastUpdate float32 `json:"last_update"`
LastStateChange float32 `json:"last_state_change"`
NextCheck float32 `json:"next_check"`
NextUpdate float32 `json:"next_update"`
HostId string `json:"id"`
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"`
Output string `json:"output"`
LongOutput string `json:"long_output"`
PerformanceData string `json:"performance_data"`
CheckCommandline string `json:"commandline"`
IsProblem bool `json:"is_problem"`
IsHandled bool `json:"is_handled"`
IsReachable bool `json:"is_reachable"`
IsFlapping bool `json:"is_flapping"`
IsAcknowledged bool `json:"is_acknowledged"`
AcknowledgementCommentId string `json:"acknowledgement_comment_id"`
InDowntime bool `json:"in_downtime"`
ExecutionTime float32 `json:"execution_time"`
Latency float32 `json:"latency"`
Timeout float32 `json:"check_timeout"`
CheckSource string `json:"check_source"`
LastUpdate interface{} `json:"last_update"`
LastStateChange float32 `json:"last_state_change"`
NextCheck float32 `json:"next_check"`
NextUpdate float32 `json:"next_update"`
}
func NewHostState() connection.Row {

View file

@ -138,7 +138,7 @@ CREATE TABLE host_state (
timeout int(10) unsigned DEFAULT NULL,
check_source text DEFAULT NULL,
last_update bigint(20) unsigned NOT NULL,
last_update bigint(20) unsigned DEFAULT NULL,
last_state_change bigint(20) unsigned NOT NULL,
next_check bigint(20) unsigned NOT NULL,
next_update bigint(20) unsigned NOT NULL,
@ -274,7 +274,7 @@ CREATE TABLE service_state (
timeout int(10) unsigned DEFAULT NULL,
check_source text DEFAULT NULL,
last_update bigint(20) unsigned NOT NULL,
last_update bigint(20) unsigned DEFAULT NULL,
last_state_change bigint(20) unsigned NOT NULL,
next_check bigint(20) unsigned NOT NULL,
next_update bigint(20) unsigned NOT NULL,