Commit Graph

123 Commits

Author SHA1 Message Date
ranbochen b4048f46bc fix wechat issue (#1293) 2018-03-20 12:21:19 +01:00
Simon Pasquier 8c9e0cf50c config: set global SMTP hello to "localhost" by default (#1290) 2018-03-16 14:45:17 +00:00
pasquier-s e67aa8edae Hide sensitive Wechat configuration + remove default fields (#1253)
* Hide sensitive Wechat configuration

* Don't send resolved alerts for Wechat by default
2018-03-02 09:49:41 +01:00
Simon Pasquier 955c92f1b6 Configure http client for Wechat 2018-02-13 14:52:53 +01:00
Simon Pasquier 8b93f1085d Add tests for HTTP client configuration 2018-02-13 14:30:59 +01:00
Frederic Branczyk d678022fea *: configure http client from config 2018-02-13 14:30:59 +01:00
songjiayang d07a072b08 Fix WeChat issue (#1229)
* fix wechat issue

* wechat issue code review
2018-02-11 20:09:47 +01:00
pasquier-s 76ee5388e7 Forbid 0 value for group_interval and repeat_interval (#1230)
Setting one of these parameters to a zero value doesn't make sense
semantically and can cause high CPU usage.
2018-02-09 10:53:46 +01:00
Mike Bryant 6615ed15d2 Add templating to PD-CEF fields; Add missing field (#1231)
* Allow templating of Component and Group in PagerDuty v2

Related to #1211

* Add missing PD-CEF field Component
2018-02-09 10:50:18 +01:00
Carlos Alexandro Becker c5ea346d06 allow global opsgenie api key (#1208)
* allow global opsgenie api key

* added missing files

* removed test
2018-01-29 16:05:17 +01:00
Evan Baker 6a3dfaff45 Add Slack additional "fields" to notifications (#1135)
* impl slack fields

* wrap title and value in tmplText
2017-12-15 12:18:05 +01:00
stuart nelson 7736ea0f61
Add footer field for slack messages (#1141) 2017-12-12 22:50:41 +01:00
berlinsaint 6bab629590 Add notify support for Chinese User wechat (#1059)
* WECHAT support by ybyang2/berlinsaint

* correct the whitespace

* add some TestFile and modify some naming errors by ybyang2/berlinsaint

* modify wechat retry test expect

* template error

* add newline
Signed-off-by: yb_home <berlinsaint@126.com>

* fmt some pr code

* use the @stuartnelson3 the test-ci-wechat bingdata.go

* notify go add wechat
2017-12-09 16:20:22 +01:00
xginn8 266baa089c Adding check for webhook's URL formatting (#1129)
* Adding check for webhook's URL formatting
Since alertmanager will fail silently when trying to send to a schemaless URL, provide a way to check that a URL is properly formatted in alertmanager

* updating error message as requested
2017-12-07 15:01:16 +01:00
Tom Fawcett fd0ace8d88 Support OpsGenie Priority field (#1094) 2017-11-12 12:01:19 -05:00
Jose Donizetti 7168749a9f Add test to missing pagerduty routing_key (#1097) 2017-11-12 11:38:01 -05:00
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
Julius Volz 9b72c10134 Minor code cleanups 2017-11-01 23:08:34 +01:00
Jose Donizetti ae73a3103a Add tests to notifiers config (#1050) 2017-10-23 10:55:34 +02:00
Jose Donizetti 4369eb3244 Improve config test coverage (#1046) 2017-10-19 21:00:35 +02:00
Pierre Awaragi f3cd3978db added email notification text content support (#934)
* added email notification text content support (configuration text)
added default email notification text content default value empty
converted email notification from html to multipart/alternatives with support to both html (first) and text (last)
ignore intellij IDE .idea working folder

* removed specific editor .gitignore entries

* renamed TEXT to Text as it's not an acronym
added TODO note to refactor multipart code to use standard go library

* refactored to use standard go mime/multipart library for text and html parts and bounderies

* use multipart createPart returned writer
added error handling while creating parts
removed unnecessary quotes from boundry string

* removed unnecessary comments
2017-09-07 17:24:19 +02:00
9to6 e1b2bfe497 When I notify alert to slack, I want to use this option. (#912)
* add link_names attribute to slack notifier

* changed type of slack option `link_names` to boolean
2017-07-25 09:21:33 +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
Siavash Safi d5f0d1773f Add entity_display_name for VictorOps, use better state_message (#769)
* Add entity_display_name for VictorOps, use better state_message

* Reuse existing long-form templates for state_message

* Rebuild binaries

* Limit state_message to 20K
2017-07-03 11:44:53 +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
Conor Broderick b7bea3df5c Renamed from and message options for VictorOps to monitoring_tool and state_message as per the VictorOps documentation (#667) 2017-03-24 14:06:39 +00: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
Fabian Reinartz b6851a5421 silences: fix concurrent cache writes (#561)
This fixes #559 by removing concurrent map writes to the matcher cache.
The cache was guarded by the Silence's main lock, which only used a
read-lock on queries.
The cache's get methods lazily loads data into the cache and thus
causing concurrent writes.

We just change the main lock to always write-lock, as we don't expect
high lock contention at this point and would have it in a dedicated
cache lock anyway.
2016-11-21 11:09:49 +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
Fabian Reinartz b822fe58b6 Merge branch 'slack_enhance' of https://github.com/dmclain/alertmanager into dmclain-slack_enhance 2016-08-09 14:46:39 +02:00
Fabian Reinartz f8de58b6b6 config: make Slack channel optional 2016-08-03 08:24:42 +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
Tristan Colgate de2252911e OpsGenie Notifier, fixes and additions:
- OpsGenie notifier confused the description and message fields
- Also added the notes field.
2016-07-12 16:20:23 +01:00
Diogo Monteiro fe12aaa6eb Updated webhook notifier config name in UnmarshalYAML. 2016-06-28 18:19:09 -04: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
Dave McLain c5d1c48610 Add support for overriding the icon_url slack parameter 2016-05-12 13:57:15 -05: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 5158926bc3 Re-do #163: smtp: STARTTLS before querying auth mechanisms
This was not ported over with the rewrite.
2016-04-01 16:50:12 +02:00
Seb Dijols 7d512eba56 Add support for Teams and Tags to OpsGenie notifier
Add Teams and Tags templated strings to OpsGenieConfig. Output must be comma-separated values.
2016-03-16 09:54:21 +00:00