Skip to content

Commit

Permalink
add new notification providers
Browse files Browse the repository at this point in the history
  • Loading branch information
dalwar23 committed Apr 25, 2024
1 parent 6d9c910 commit 78b16ed
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ pip install -e .
### Notification

- Supported notification providers (tested)
- [x] Discord
- [x] Email(SMTP)
- [x] Opsgenie
- [x] PagerDuty
- [x] Rocket.Chat
- [x] Slack
- [x] Teams
Expand Down
36 changes: 31 additions & 5 deletions examples/notification.config.example.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
---
notifications:
- dicord:
name: "Discord Notification"
type: "discord"
is_default: false
apply_existing: false
discordWebhookUrl: "url"
discordUsername: "discorduser"
discordPrefixMessage: "hello"
- opsgenie:
name: "Opsgenie Nofification"
type: "Opsgenie"
type: "Opsgenie" # Capitalized
is_default: false
apply_existing: false
opsgeniePriority: 1
opsgeniePriority: 1 # 1-5
opsgenieRegion: "eu" # us(default)/eu
opsgenieApiKey: "something"
- pagerduty:
name: "Pagerduty Notifications"
type: "PagerDuty"
is_default: false
apply_existing: false
pagerdutyIntegrationKey: "somekey"
pagerdutyPriority: "critical" # info, warning, error, critical
pagerdutyIntegrationUrl: "pagerduty url"
pagerdutyAutoResolve: "yes"
- rocketchat:
name: "RocketChat Notification"
type: "rocket.chat"
Expand All @@ -18,7 +35,7 @@ notifications:
rocketusername: "bot"
rocketchannel: "somechannel"
- slack:
name: "Uptime slack notification"
name: "Uptime Slack Notification"
type: "slack"
is_default: false
apply_existing: false
Expand All @@ -28,17 +45,26 @@ notifications:
slackchannel: "uptime"
slackchannelnotify: ""
- teams:
name: "Uptime teams notification"
name: "Uptime Teams Notification"
type: "teams"
is_default: false
apply_existing: false
webhookUrl: "https://teams.microsoft.com/somehting/"
- webhook:
name: "Uptime webhook notification"
name: "Uptime Webhook Notification"
type: "webhook"
is_default: false
apply_existing: false
webhookURL: "https://custom.webhookurl.homelab"
webhookAdditionalHeaders: ""
webhookCustomBody: "this is a webhook message"
webhookContentType: "application/json"
- email:
name: "Uptime Email Notification"
type: "smtp"
is_default: false
apply_existing: false
smtpFrom: "uptime@homelab.do"
smtpTo: "awesomedev@homelab.do"
smtpHost: "myawesome.smtpserver.do"
smtpPort: "485"
36 changes: 33 additions & 3 deletions src/kumaone/notification_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,53 @@
__email__ = "dalwar23@pm.me"

notification_providers = {
"discord": {
"discordWebhookUrl": "",
"discordUsername": "",
"discordPrefixMessage": "",
},
"opsgenie": {
"opsgeniePriority": "",
"opsgenieRegion": "",
"opsgenieApiKey": "",
"opsgeniePriority": "",
},
"pagerduty": {
"pagerdutyIntegrationKey": "",
"pagerdutyPriority": "",
"pagerdutyIntegrationUrl": "",
"pagerdutyAutoResolve": "",
},
"rocket.chat": {
"rocketwebhookURL": "",
"rocketchannel": "",
"rocketusername": "",
"rocketiconemo": "",
"rocketwebhookURL": "",
},
"slack": {
"slackwebhookURL": "",
"slackchannelnotify": "",
"slackchannel": "",
"slackusername": "",
"slackiconemo": "",
"slackwebhookURL": "",
},
"smtp": {
"smtpFrom": "",
"smtpTo": "",
"smtpHost": "",
"smtpPort": "",
"smtpSecure": "",
"smtpIgnoreTLSError": "",
"smtpDkimDomain": "",
"smtpDkimKeySelector": "",
"smtpDkimPrivateKey": "",
"smtpDkimHashAlgo": "",
"smtpDkimheaderFieldNames": "",
"smtpDkimskipFields": "",
"smtpUsername": "",
"smtpPassword": "",
"customSubject": "",
"smtpCC": "",
"smtpBCC": "",
},
"teams": {
"webhookUrl": "",
Expand Down

0 comments on commit 78b16ed

Please sign in to comment.