Commit Graph

62 Commits

Author SHA1 Message Date
Jose Donizetti 76c15a0ef5 Fix config name inconsistency (#1087)
* Rename global config hipchat_url to hipchat_api_url

* Rename opsgenie config 'host' to 'url'
2017-11-11 15:01:21 +01:00
Steven Carvellas 5db8055bab Add support for PagerDuty API v2 (#1054) 2017-11-07 11:07:27 +01:00
Jose Donizetti 4369eb3244 Improve config test coverage (#1046) 2017-10-19 21:00:35 +02:00
ideaship a566036015 Support for custom SMTP hello string (#892)
* Support for custom SMTP hello string

Some MTAs insist that they be greeted with a fully qualified domain
name. The default provided by the net/smtp library, "HELLO localhost",
is not sufficient and will result in rejected messages.

This changeset adds a new configuration option that allows the
alertmanager to do its job in such an environment.

* Test SMTPHello parsing
2017-07-18 09:32:57 +02:00
Carlos Alexandro Becker ca8d73a59b Added possibility to have a global victorops api_key (#897)
* Added possibility to have a global victorops api_key

* adding tests for victorops default key
2017-07-12 09:25:47 +02:00
Conor Broderick b5ad65fa32 Omit empty config fields and show regex upon re-marshalling to elide secrets (#864)
* Omit empty config fields upon remarshalling to elide secrets

* added test checking for empty or null fields and blank regexps
2017-06-20 19:09:14 +02:00
Frederic Branczyk c4c0875ba3
fix config JSON marshaling 2017-06-08 13:37:57 +02:00
Conor Broderick 5a5acb2d1c Elide secrets in alertmanager config (#841) 2017-06-06 12:02:49 +01:00
Conor Broderick a77bfb44d6 Added unit test for continue in root route error (#768)
* Added unit test for continue in root route error

* replaced %v with %q
2017-05-09 10:11:40 +02:00
Kellen Fox 6aece86ac1 Fixes #746
Found that we are only defining MarshalJSON for the Regexp type for
references not for the direct object

Also took the time to simplify the json.Unmarshal usage in cli/config.go
2017-05-08 11:25:25 -07:00
conorbroderick dc782f2dd4 Throw error when continue in route root of Alertmanager config 2017-05-03 13:40:54 +01:00
Kellen Fox 3aab66ec3a Amtool implementation (#636)
* Implement alertmanager cli tool 'amtool'

The primary goal of an alertmanager tool is to provide a cli interface
for the prometheus alertmanager.

My vision for this tool has two parts:
  - Silence management (query, add, delete)

  - Alert management (query, maybe more in future?)

Resolves: #567
2017-04-20 11:04:17 +02:00
devnev f2ba86e9d2 Add proper JSON marshaling of config regexps. (#602) 2017-01-17 11:50:54 +01:00
Fabian Reinartz d7843ad6a6 Export parsed configuration as JSON and drop js-yaml dependency. (#563)
* Export parsed configuration as JSON in /api/v1/status.
* Avoid exporting the XXX fields.
* Drop js-yaml library and use already parsed configuration.
* Go fmt + go-bindata
2016-11-22 15:05:14 +01:00
sgissi 96a428a55e config/notify: Add SMTP Require TLS global option (#512) 2016-09-27 11:00:21 +02:00
Fabian Reinartz c01c1989a7 config: check overflow in global section 2016-09-05 11:30:07 +02:00
Djordje Atlialp 8e0f405e67 Add VictorOps Notifier
Add default VictorOpsAPIURL

Add VictorOps default config

Add VictorOpsConfig struct in notifiers

Add new template tags for victorops

Add notifications logic for victorops

Compiled template tags with make assets

Remove common labels from entity_id template

Set messageType default value to CRITICAL

Recovery messageType is not configurable anymore. Firing state only allows specific keys

Make assets

Using log.Debugf

EntityID should not be configureable

Remove entity_id from template

Use GroupKey(ctx) as entity_id

Improve debug logging

Fix type of entity_id
2016-07-27 00:49:05 +02:00
Matt Bostock a29860d80e Allow route receiver to be inherited
This is useful when you're using a label to determine the receiver but
want to override other options such as `group_by`. Currently you'd have
to duplicate the matchers for the receivers to be able to do this.

`checkReceiver()` now returns no error if a receiver is empty and we add
a check to ensure that the root route has a receiver defined. I've added
a test for this.

This brings the `receiver` option into line with the other options
(`group_by`, `group_wait`, etc) in the sense that routes can now inherit
the receiver from the parent node.

From https://prometheus.io/docs/alerting/configuration/:

> A route block defines a node in a routing tree and its children. Its
> optional configuration parameters are inherited from its parent node
> if not set.
2016-06-04 10:19:43 +01:00
Max Chadwick 4cb3874ab8 Move SMTP auth to the config file 2016-04-16 16:41:55 -04:00
Fabian Reinartz f33c1bedb4 Hide PushOver auth information 2016-04-12 10:14:22 +02:00
Michael Stapelberg 4c0aa00bcf Re-implement pushover notifications
This feature was dropped during the rewrite, but I use and like
Pushover.

fixes #107
2016-03-03 09:07:33 +01:00
Johannes 'fish' Ziemke e5925db736 Fix indent 2016-01-28 13:44:21 +01:00
Fabian Reinartz 11fa642998 Add routing validation
The root route in the configuration must not exclude any alerts,
i.e. not have any matchers.
All receivers referenced in the routing tree are validated to exist.
2016-01-27 14:27:19 +01:00
louis 23db37dc98 add hipchat room notifier 2016-01-05 20:52:08 +01:00
Fabian Reinartz 9b4479cb6b Move send_resolved parameter to notifier configuration 2015-12-17 13:43:56 +01:00
Fabian Reinartz 7581d974ff Hide secret configuration data 2015-12-03 12:46:28 +01:00
Fabian Reinartz 00b8a2ad03 Make resolve timeout configurable 2015-11-27 15:41:22 +01:00
Fabian Reinartz 9fbc76a52f Improve PagerDuty templating 2015-11-27 14:02:34 +01:00
Jimmi Dyson 3e7d614eb2 Add opsgenie notifier 2015-11-24 22:29:25 +00:00
beorn7 93ffa534a5 PR with changes after code review
Now to be reverse-reveiewed.
2015-11-23 18:24:57 +01:00
Fabian Reinartz 3386cea9df Anchor config regexes 2015-11-19 08:53:29 +01:00
Brian Brazil faa88831f4 First-pass at improving template system.
- Cut back to bare minimum to make the rest simpler
- Consistency in config naming
- Have one data strucutre that's the same for all templates
- Pass in common labels to templates
- Support templates almost everywhere
- Support multiple SMTP recipients
- Support non-ASCII SMTP headers
- Handle colour logic via templates
- Make $subjects have consistent output, go maps aren't sorted.
- Make tests pass when v6 is disabled
2015-11-18 14:59:05 +00:00
Fabian Reinartz d6611651c4 Fix unused import 2015-11-12 15:02:33 +01:00
Fabian Reinartz 3e685642c7 Fix golint issues in config/ 2015-11-12 12:57:20 +01:00
Fabian Reinartz dc656a44ea Adjust config fields to 'receiver' 2015-11-10 14:08:20 +01:00
Fabian Reinartz e4e594d826 Unify receiver naming 2015-11-10 13:47:04 +01:00
Fabian Reinartz 5ce39632f8 Fix go vet warnings 2015-11-05 10:25:25 +01:00
Fabian Reinartz cb0ecd9416 Alter config to have a root route 2015-10-19 16:52:54 +02:00
Fabian Reinartz ef0ee97781 Implement global routing options 2015-10-19 16:17:15 +02:00
Fabian Reinartz aead14a99f Implement initial PagerDuty notifications 2015-10-19 13:36:17 +02:00
Fabian Reinartz 6ff0cd94c5 Finalize PagerDuty config 2015-10-19 11:44:46 +02:00
Fabian Reinartz 0b818bac38 Implement global setting of notification parameters 2015-10-17 10:02:32 +02:00
Fabian Reinartz 7ef293d9bc Make loadable templates configurable 2015-10-09 11:06:04 +02:00
Fabian Reinartz d1379a3f71 Move repeat_interval and send_resolved to route configuration 2015-10-08 10:50:37 +02:00
Fabian Reinartz a540d672a3 Fix notificatio config fields 2015-09-29 20:45:23 +02:00
Fabian Reinartz 797bfa1468 Fix group and repeat interval differentiation 2015-09-26 18:03:54 +02:00
Fabian Reinartz ebb7740fb9 Move config into own package and refactor 2015-09-26 11:14:18 +02:00
Fabian Reinartz bbe679b432 initial alert routing tree 2015-07-01 17:56:53 +02:00
Fabian Reinartz 47967ba6e9 switch to common/model types 2015-06-30 08:43:38 +02:00
Fabian Reinartz 2e1a01b2fa switch to YAML config. 2015-06-29 18:53:47 +02:00