Rename notifications-source to notifications

Drop the "-source" suffix from the configuration option. Furhtermore,
with the latest IGL release 0.8.1[0], the "api-base-url" is renamed to
just "url".

[0]: https://github.com/Icinga/icinga-go-library/pull/168
This commit is contained in:
Alvar Penning 2025-11-14 17:27:23 +01:00
parent e8c0359c4e
commit 327862c4f2
No known key found for this signature in database
4 changed files with 17 additions and 17 deletions

View file

@ -171,14 +171,14 @@ func run() int {
{
var extraStages map[string]history.StageFunc
if cfg := cmd.Config.NotificationsSource; cfg.ApiBaseUrl != "" {
if cfg := cmd.Config.Notifications; cfg.Url != "" {
logger.Info("Starting Icinga Notifications source")
notificationsSource, err := notifications.NewNotificationsClient(
ctx,
db,
rc,
logs.GetChildLogger("notifications-source"),
logs.GetChildLogger("notifications"),
cfg)
if err != nil {
logger.Fatalw("Can't create Icinga Notifications client from config", zap.Error(err))

View file

@ -142,9 +142,9 @@ redis:
# Icinga DB can act as an event source for Icinga Notifications. If the following block is not empty, Icinga DB will
# submit events to the Icinga Notifications API.
#notifications-source:
#notifications:
# URL to the API root.
# api-base-url: http://localhost:5680
# url: http://localhost:5680
# Username to authenticate against the Icinga Notifications API.
# username: icingadb

View file

@ -174,7 +174,7 @@ ICINGADB_RETENTION_OPTIONS=comment:356
| count | **Optional.** Number of old historical data a single query can delete in a `"DELETE FROM ... LIMIT count"` manner. Defaults to `5000`. |
| options | **Optional.** Map of history category to number of days to retain its data. Available categories are `acknowledgement`, `comment`, `downtime`, `flapping`, `notification` and `state`. |
## Notifications Source Configuration
## Notifications Configuration
!!! warning
@ -185,14 +185,14 @@ ICINGADB_RETENTION_OPTIONS=comment:356
Icinga DB can act as an event source for [Icinga Notifications](https://icinga.com/docs/icinga-notifications/).
If configured, Icinga DB will submit events to the Icinga Notifications API.
For YAML configuration, the options are part of the `notifications-source` dictionary.
For environment variables, each option is prefixed with `ICINGADB_NOTIFICATIONS_SOURCE_`.
For YAML configuration, the options are part of the `notifications` dictionary.
For environment variables, each option is prefixed with `ICINGADB_NOTIFICATIONS_`.
| Option | Description |
|--------------|-----------------------------------------------------------------------------------|
| api-base-url | **Optional.** Icinga Notifications API base URL, such as `http://localhost:5680`. |
| username | **Optional.** Icinga Notifications API user for this source. |
| password | **Optional.** Icinga Notifications API user password. |
| Option | Description |
|----------|-----------------------------------------------------------------------------------|
| url | **Optional.** Icinga Notifications API base URL, such as `http://localhost:5680`. |
| username | **Optional.** Icinga Notifications API user for this source. |
| password | **Optional.** Icinga Notifications API user password. |
## Appendix

View file

@ -16,11 +16,11 @@ const DefaultConfigPath = "/etc/icingadb/config.yml"
// Config defines Icinga DB 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_"`
NotificationsSource source.Config `yaml:"notifications-source" envPrefix:"NOTIFICATIONS_SOURCE_"`
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_"`
}
func (c *Config) SetDefaults() {