-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using check_interval
< 1s
crashes Icinga DB
#882
Labels
Milestone
Comments
Note that this is not limited to the |
Good catch. I have taken another look at the struct types and annotate some similar findings. diff --git a/pkg/icingadb/v1/checkable.go b/pkg/icingadb/v1/checkable.go
index 78d75f5..8d9680c 100644
--- a/pkg/icingadb/v1/checkable.go
+++ b/pkg/icingadb/v1/checkable.go
@@ -11,11 +11,11 @@ type Checkable struct {
NameCiMeta `json:",inline"`
ActionUrlId types.Binary `json:"action_url_id"`
ActiveChecksEnabled types.Bool `json:"active_checks_enabled"`
- CheckInterval float64 `json:"check_interval"`
+ CheckInterval float64 `json:"check_interval"` // mysql: int unsigned, pgsql: uint
CheckTimeperiodName string `json:"check_timeperiod_name"`
CheckTimeperiodId types.Binary `json:"check_timeperiod_id"`
- CheckRetryInterval float64 `json:"check_retry_interval"`
- CheckTimeout float64 `json:"check_timeout"`
+ CheckRetryInterval float64 `json:"check_retry_interval"` // mysql: int unsigned, pgsql: uint
+ CheckTimeout float64 `json:"check_timeout"` // mysql: int unsigned, pgsql: uint
CheckcommandName string `json:"checkcommand_name"`
CheckcommandId types.Binary `json:"checkcommand_id"`
CommandEndpointName string `json:"command_endpoint_name"`
diff --git a/pkg/icingadb/v1/command.go b/pkg/icingadb/v1/command.go
index 74ec555..575b0d9 100644
--- a/pkg/icingadb/v1/command.go
+++ b/pkg/icingadb/v1/command.go
@@ -12,7 +12,7 @@ type Command struct {
NameCiMeta `json:",inline"`
ZoneId types.Binary `json:"zone_id"`
Command string `json:"command"`
- Timeout uint32 `json:"timeout"`
+ Timeout uint32 `json:"timeout"` // mysql: int unsigned AND smallint unsigned, pgsql: uint AND smalluint -- differs in implementing structs below
}
type CommandArgument struct {
diff --git a/pkg/icingadb/v1/state.go b/pkg/icingadb/v1/state.go
index d2e48e8..ee895c8 100644
--- a/pkg/icingadb/v1/state.go
+++ b/pkg/icingadb/v1/state.go
@@ -14,7 +14,7 @@ type State struct {
CheckCommandline types.String `json:"check_commandline"`
CheckSource types.String `json:"check_source"`
SchedulingSource types.String `json:"scheduling_source"`
- ExecutionTime float64 `json:"execution_time"`
+ ExecutionTime float64 `json:"execution_time"` // mysql: int unsigned, pgsql: uint
HardState uint8 `json:"hard_state"`
InDowntime types.Bool `json:"in_downtime"`
IsAcknowledged icingadbTypes.AcknowledgementState `json:"is_acknowledged"`
@@ -24,7 +24,7 @@ type State struct {
IsReachable types.Bool `json:"is_reachable"`
LastStateChange types.UnixMilli `json:"last_state_change"`
LastUpdate types.UnixMilli `json:"last_update"`
- Latency float64 `json:"latency"`
+ Latency float64 `json:"latency"` // mysql: int unsigned, pgsql: uint
LongOutput types.String `json:"long_output"`
NextCheck types.UnixMilli `json:"next_check"`
NextUpdate types.UnixMilli `json:"next_update"`
@@ -36,5 +36,5 @@ type State struct {
Severity uint16 `json:"severity"`
SoftState uint8 `json:"soft_state"`
StateType icingadbTypes.StateType `json:"state_type"`
- CheckTimeout float64 `json:"check_timeout"`
+ CheckTimeout float64 `json:"check_timeout"` // mysql: int unsigned, pgsql: uint
} In addition, some |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
All timestamps
< 1s
used as check interval result in floating point numbers when converted to timestamp aka seconds. However, while such values can be encoded/decoded into the corresponding struct field without problems, it crashes when trying to insert0.001
ascheck_interval
value, which is of typebigint
. There was a similar issue in Icinga DB Web Icinga/icingadb-web#910, but apparently MySQL/MariaDB simply round these numbers down to0
, causing a division by zero error instead of rejecting them like PostgreSQL does. We observed this last time during a debugging session with @nilmerg a mysterious crash by such a check interval.The text was updated successfully, but these errors were encountered: