No description
Find a file
2022-10-13 14:16:41 +02:00
.build.yml Add build manifest 2022-10-13 14:16:41 +02:00
.gitignore Add gitignore 2022-10-09 19:52:32 +02:00
config.go Support ntfy tags 2022-10-12 17:04:44 +02:00
functions.go Support ntfy tags 2022-10-12 17:04:44 +02:00
go.mod Upgrade dependencies 2022-10-13 01:15:04 +02:00
go.sum Upgrade dependencies 2022-10-13 01:15:04 +02:00
LICENSE Initial commit 2022-10-09 14:19:48 +02:00
main.go Add package comment 2022-10-13 13:14:56 +02:00
README.md Add readme 2022-10-13 13:41:35 +02:00

ntfy-alertmanager

A bridge between ntfy and Alertmanager.

Configuration

You can specify the configuration file location with the --config flag. By default the configuration file will be read from /etc/ntfy-alertmanager/config. The format of this file is scfg.

ntfy-alertmanager has support for setting ntfy priority and tags. Define a decreasing order of labels in the config file and map those labels to tags or priority.

  • For priority the first found value will be chosen.
  • Tags are added together.

Example:

# http listen address
http-address 127.0.0.1:8080
# Log level (either debug, info, warning, error)
log-level info
# Optionally protect with HTTP basic authentication
user webhookUser
password webhookPass

labels {
    order "severity,instance"

    severity "critical" {
        priority 5
        tags "rotating_light"
    }

    severity "info" {
        priority 1
    }

    instance "example.com" {
        tags "computer,example"
    }
}

ntfy {
    # URL of the ntfy topic - required
    topic https://ntfy.sh/alertmanager-alerts
    # ntfy access control (https://ntfy.sh/docs/config/#access-control)
    user user
    password pass
}

Alertmanager config

receivers:
    - name: "ntfy"
      webhook_configs:
          - url: "http://127.0.0.1:8080"
            http_config:
                basic_auth:
                    username: "webhookUser"
                    password: "webhookPass"

Contributing

Report bugs on the issue tracker.