Documentation
¶
Index ¶
Constants ¶
const DefaultConfigPath = "/etc/icingadb/config.yml"
DefaultConfigPath specifies the default location of Icinga DB's config.yml for package installations.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Database database.Config `yaml:"database" envPrefix:"DATABASE_"`
Redis redis.Config `yaml:"redis" envPrefix:"REDIS_"`
Logging logging.Config `yaml:"logging" envPrefix:"LOGGING_"`
Retention RetentionConfig `yaml:"retention" envPrefix:"RETENTION_"`
Notifications source.Config `yaml:"notifications" envPrefix:"NOTIFICATIONS_"`
}
Config defines Icinga DB config.
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type Flags ¶
type Flags struct {
// Version decides whether to just print the version and exit.
Version bool `long:"version" description:"print version and exit"`
// Config is the path to the config file. If not provided, it defaults to DefaultConfigPath.
Config string `short:"c" long:"config" description:"path to config file (default: /etc/icingadb/config.yml)"`
// DatabaseAutoImport results in an initial schema check and update; mostly for containerized setups.
DatabaseAutoImport bool `long:"database-auto-import" description:"import database schema on startup if database is empty"`
// DatabaseSchemaDir is the root directory for schema files to be used when DatabaseAutoImport is requested.
//
// The directory structure must mimic the git repo's schema dir, containing ./mysql/schema.sql and ./pgsql/schema.sql.
DatabaseSchemaDir string `` /* 136-byte string literal not displayed */
}
Flags defines CLI flags.
Flags implements the github.com/icinga/icinga-go-library/config.Flags interface.
func (Flags) GetConfigPath ¶ added in v1.3.0
GetConfigPath retrieves the path to the configuration file. It returns the path specified via the command line, or DefaultConfigPath if none is provided.
GetConfigPath implements parts of the github.com/icinga/icinga-go-library/config.Flags interface.
func (Flags) IsExplicitConfigPath ¶ added in v1.3.0
IsExplicitConfigPath indicates whether the configuration file path was explicitly set.
IsExplicitConfigPath implements parts of the github.com/icinga/icinga-go-library/config.Flags interface.
type RetentionConfig ¶
type RetentionConfig struct {
HistoryDays uint16 `yaml:"history-days" env:"HISTORY_DAYS"`
SlaDays uint16 `yaml:"sla-days" env:"SLA_DAYS"`
Interval time.Duration `yaml:"interval" env:"INTERVAL" default:"1h"`
Count uint64 `yaml:"count" env:"COUNT" default:"5000"`
Options history.RetentionOptions `yaml:"options" env:"OPTIONS"`
}
RetentionConfig defines configuration for history retention.
func (*RetentionConfig) Validate ¶
func (r *RetentionConfig) Validate() error
Validate checks constraints in the supplied retention configuration and returns an error if they are violated.