diff --git a/README.md b/README.md index 08a26d7..2b27121 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/examples/notification.config.example.yaml b/examples/notification.config.example.yaml index 645e374..d6ffebf 100644 --- a/examples/notification.config.example.yaml +++ b/examples/notification.config.example.yaml @@ -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" @@ -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 @@ -28,13 +45,13 @@ 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 @@ -42,3 +59,12 @@ notifications: 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" diff --git a/src/kumaone/notification_settings.py b/src/kumaone/notification_settings.py index b2fa87a..6db2f7b 100644 --- a/src/kumaone/notification_settings.py +++ b/src/kumaone/notification_settings.py @@ -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": "",