Commit Graph

14 Commits

Author SHA1 Message Date
Bob Shannon 50e271678d Add support for adding alerts using amtool (#1461)
* Add support for adding alerts using amtool

Signed-off-by: Bob Shannon <bshannon@palantir.com>

* comment: Simplify return in addAlert

Signed-off-by: Bob Shannon <bshannon@palantir.com>
2018-07-16 16:29:04 +02:00
Kellen Fox b949f0dc19 Amtool: Implement filter by receiver fixes:#937 (#1402)
* Amtool: Implement filter by receiver

* Adds receiver flag to amtool alert query
* Adds receiver argument to alert http client
* Updates http client tests for added argument

Also works: scpecifying `receiver: "receiver-123"` in config file
automaticly filters all alerts shown

* Include receiver in amtool config docs

Now that I've implemented the receiver in amtool I should add the new
feature to the documentation.

*  #937 Add mention of supporting regex syntax to receiver flag
2018-06-07 09:21:12 +02:00
Simon Pasquier 0ebaeccd4b *: add missing license headers
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-05-14 17:37:13 +02:00
stuart nelson 942be9d993
cli alert query: Expose --active and --unprocessed (#1370)
* cli alert query: Expose --active and --unprocessed

Support the new filter options in the alerts api
endpoint introduced by https://github.com/prometheus/alertmanager/pull/1366

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>

* Update comment and client_test

Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-05-09 10:57:01 +02:00
stuart nelson 1c0c24b300
Update alerts argument order, rename expired to inhibited (#1360)
Signed-off-by: stuart nelson <stuartnelson3@gmail.com>
2018-05-04 10:43:38 +02:00
Simon Pasquier dc5fc02d22 [amtool] use kingpin.v2 (#1330)
* Use default values to store values from config
* fix typo and reserved keywork
* move to long help texts
* add one more unit test for resolver
* update comments

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2018-04-24 09:35:15 +02:00
stuart nelson e7bc6e2935
Move amtool to modular structure (#1321)
* Move amtool to modular structure

Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com>

* Move toplevel setup back into root.go

Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com>

* Remove confusing alert struct name overwriting

A local variable within the alert subcommand was
using the name of the struct within that file.

Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com>

* change local var name shadowing struct name

Signed-off-by: Stuart Nelson <stuartnelson3@gmail.com>
2018-04-13 13:34:16 +02:00
Simon Pasquier c92ed69ce8 Split cli package (#1314)
* cli: move commands to cli/cmd

* cli: use StatusAPI interface for config command

* cli: use SilenceAPI interface for silence commands

* cli: use AlertAPI for alert command

* cli: move back commands to cli package

And move API client code to its own package.

* cli: remove unused structs
2018-04-11 11:17:41 +02:00
Calle Pettersson 608848390f Switch amtool to kingpin (#976)
* Switch cmd/amtool to kingpin

* Touch-ups

* Implement long help

* Add missing short-form of --output

* Fix backwards compatibility for config file options

* Fix vendoring

* Review fixes

* Fix flag word order
2017-12-22 11:17:13 +01:00
Jose Donizetti 7151cd4bfc Clean code style - amtool errors (#1099) 2017-11-12 11:43:48 -05:00
Fabian Reinartz 8170206070 Fix alert status handling in UI 2017-05-08 12:56:03 +02:00
stuart nelson 6a909abf17 Add processing status field to alert 2017-04-27 14:18:52 +02:00
Kellen Fox b2c656a071 Add command wrapper to handle printing errors for any subcommands (#724)
Fixes #721

I was using the RunE method of cobra.Command which does things with an
error returned from a function. I doesn't seem possible to keep it from
printing usage every time, so I've make a wrapper to use the other
function.
2017-04-21 14:50:02 +02: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