Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions rocketpool-cli/service/config/settings-alerting.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ var alertingParametersNativeMode map[string]interface{} = map[string]interface{}
"nativeModeHost": nil,
"nativeModePort": nil,
"discordWebhookURL": nil,
"pushoverToken": nil,
"pushoverUserKey": nil,
"alertEnabled_FeeRecipientChanged": nil,
"alertEnabled_MinipoolBondReduced": nil,
"alertEnabled_MinipoolBalanceDistributed": nil,
Expand All @@ -27,6 +29,8 @@ var alertingParametersDockerMode map[string]interface{} = map[string]interface{}
"openPort": nil,
"containerTag": nil,
"discordWebhookURL": nil,
"pushoverToken": nil,
"pushoverUserKey": nil,
"alertEnabled_ClientSyncStatusBeacon": nil,
"alertEnabled_UpcomingSyncCommittee": nil,
"alertEnabled_ActiveSyncCommittee": nil,
Expand Down
29 changes: 29 additions & 0 deletions shared/services/config/alertmanager-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ type AlertmanagerConfig struct {
// The Discord webhook URL for alert notifications
DiscordWebhookURL config.Parameter `yaml:"discordWebhookURL,omitempty"`

// The Pushover Token for alert notifications
PushoverToken config.Parameter `yaml:"pushoverToken,omitempty"`
// The Pushover User Key for alert notifications
PushoverUserKey config.Parameter `yaml:"pushoverUserKey,omitempty"`

// Alerts configured in prometheus rule configuration file:
AlertEnabled_ClientSyncStatusBeacon config.Parameter `yaml:"alertEnabled_ClientSyncStatusBeacon,omitempty"`
AlertEnabled_ClientSyncStatusExecution config.Parameter `yaml:"alertEnabled_ClientSyncStatusBeacon,omitempty"`
Expand Down Expand Up @@ -159,6 +164,28 @@ func NewAlertmanagerConfig(cfg *RocketPoolConfig) *AlertmanagerConfig {
OverwriteOnUpgrade: false,
},

PushoverToken: config.Parameter{
ID: "pushoverToken",
Name: "Alertmanager Pushover Token",
Description: "Pushover notifications are sent via the Pushover API. See docs for detailed technical explanation or a tl;dr on how to configure at https://pushover.net/api",
Type: config.ParameterType_String,
Default: map[config.Network]interface{}{config.Network_All: ""},
AffectsContainers: []config.ContainerID{config.ContainerID_Alertmanager},
CanBeBlank: true,
OverwriteOnUpgrade: false,
},

PushoverUserKey: config.Parameter{
ID: "pushoverUserKey",
Name: "Alertmanager Pushover User Key",
Description: "Pushover notifications are sent via the Pushover API. See docs for detailed technical explanation or a tl;dr on how to configure at https://pushover.net/api",
Type: config.ParameterType_String,
Default: map[config.Network]interface{}{config.Network_All: ""},
AffectsContainers: []config.ContainerID{config.ContainerID_Alertmanager},
CanBeBlank: true,
OverwriteOnUpgrade: false,
},

AlertEnabled_ClientSyncStatusBeacon: createParameterForAlertEnablement(
"ClientSyncStatusBeacon",
"beacon client is not synced"),
Expand Down Expand Up @@ -251,6 +278,8 @@ func (cfg *AlertmanagerConfig) GetParameters() []*config.Parameter {
&cfg.NativeModeHost,
&cfg.NativeModePort,
&cfg.DiscordWebhookURL,
&cfg.PushoverToken,
&cfg.PushoverUserKey,
&cfg.ContainerTag,
&cfg.AlertEnabled_ClientSyncStatusBeacon,
&cfg.AlertEnabled_ClientSyncStatusExecution,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,25 @@ receivers:
discord_configs:
- webhook_url: "{{ .DiscordWebhookURL.Value }}"
{{- end }}


{{- if .PushoverToken.Value and .PushoverUserKey.Value }}
pushover_configs:
- token: "{{ .PushoverToken.Value }}"
user_key: "{{ .PushoverUserKey.Value }}"
{{- end }}

- name: "node_operator_no_resolved"
{{- if .DiscordWebhookURL.Value }}
discord_configs:
- webhook_url: "{{ .DiscordWebhookURL.Value }}"
send_resolved: false
{{- end }}

{{- if .PushoverToken.Value .PushoverUserKey.Value }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it intentional to repeat this code here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea was to mimic the same block as with discord, but I see that I copied pasted and forgot to add send_resolved: false. Now fixed, thanks for catching it.

pushover_configs:
- token: "{{ .PushoverToken.Value }}"
user_key: "{{ .PushoverUserKey.Value }}"
{{- end }}

inhibit_rules:
# Inhibit rules mute a new alert (target) that matches an existing alert (source).
Expand Down