sensu-cli 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +9 -5
- data/lib/sensu-cli/api.rb +2 -2
- data/lib/sensu-cli/base.rb +2 -0
- data/lib/sensu-cli/path.rb +4 -3
- data/lib/sensu-cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzQyZTY3YzM1OTNlNzM3NzdmMWQ4MzcxN2E0MWQxOWQ1MjRhYzM1Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MzUyYzcwNjQ5MzA5MDE0ODIzYTFjZDdlODcxYTNkMDBlOTVhNDM3Ng==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzEzOTlhNjk3MjNlMmU1NjZkYTk2M2ZmZjg2OGNkOWQ5OTU1M2UxOTIwNDQy
|
10
|
+
MWM2NmY2MGNkZDgxNmNlN2ZmMTkyZjljNTFkN2NlNjcwZmI3MjVlNWVlODBh
|
11
|
+
YWVkOGMxNTI0N2JjYWU4OTdkMTg3Y2I4OGJmZjAyOGQzZWQ0MWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWRjNjMwNGM3NDZmNTZkYTUyMGJkMDZlYTBkYWVjZmY4MzQ5M2Q5YmViZmU1
|
14
|
+
YmY0NGUzOGQ1ZjNhOTZiM2I5ZGQ4NTFkOWY4YzhiNjZkYjlhMDYyMzc5MGQw
|
15
|
+
NzYxZTE0NGQzZDZhNWZhZGUwMzdhMzJkOGIwZDViNjJlZDgzMDQ=
|
data/README.md
CHANGED
@@ -30,12 +30,14 @@ Usage and Configuration
|
|
30
30
|
-----------------------
|
31
31
|
* gem install sensu-cli
|
32
32
|
|
33
|
-
* There is one settings file for host, port and
|
33
|
+
* There is one settings file for host, port, ssl, and HTTP timeout that lives in your user directory ~/.sensu/settings.rb. You can alternatively place this in /etc/sensu/sensu-cli/settings.rb.
|
34
34
|
|
35
35
|
````
|
36
36
|
host "127.0.0.1"
|
37
37
|
port "4567"
|
38
38
|
ssl false
|
39
|
+
read_timeout 20
|
40
|
+
open_timeout 20
|
39
41
|
````
|
40
42
|
This format was chosen so you can do some ENV magic via your profile and setting up an alias. For details see the [wiki](https://github.com/agent462/sensu-cli/wiki)
|
41
43
|
|
@@ -48,12 +50,14 @@ ssl false
|
|
48
50
|
user "some_user"
|
49
51
|
password "some_secret_password"
|
50
52
|
````
|
53
|
+
If `read_timeout` and `open_timeout` are not set, they default to 15 and
|
54
|
+
5 seconds respectively.
|
51
55
|
|
52
56
|
Expire Silenced Hosts/Checks
|
53
57
|
----------------------------
|
54
|
-
I added an expires option to `sensu-cli silence` to be used like `sensu-cli silence HOST -e 30` where `-e` denotes the number of minutes from now a host/checks silence should expire. This won't work by itself. We add a key to the silence stash with a time in the future. If you run [check-stashes](https://github.com/agent462/sensu-check-stashes) on your sensu-server it will check for expired stashes and delete them.
|
58
|
+
I added an expires option to `sensu-cli silence` to be used like `sensu-cli silence HOST -e 30` where `-e` denotes the number of minutes from now a host/checks silence should expire. This won't work by itself. We add a key to the silence stash with a time in the future. If you run [check-stashes](https://github.com/agent462/sensu-check-stashes) on your sensu-server it will check for expired stashes and delete them.
|
55
59
|
|
56
|
-
There is also a reason option `-r` available. Be nice and use it so your colleagues know what you're doing.
|
60
|
+
There is also a reason option `-r` available. Be nice and use it so your colleagues know what you're doing.
|
57
61
|
|
58
62
|
Examples
|
59
63
|
-----------
|
@@ -106,12 +110,12 @@ sensu-cli resolve NODE CHECK
|
|
106
110
|
Contributions
|
107
111
|
-------------
|
108
112
|
Please provide a pull request. I'm an ops guy, not a developer, so if you're submitting code cleanup, all I ask is that you explain the improvement so I can learn.
|
109
|
-
|
113
|
+
|
110
114
|
TODO
|
111
115
|
----
|
112
116
|
* cleanup the cli
|
113
117
|
* Once complete api support is implemented I'll add other features like filtering or issuing a event.
|
114
|
-
|
118
|
+
|
115
119
|
License and Author
|
116
120
|
==================
|
117
121
|
I'm releasing this under the MIT or Apache 2.0 license. You pick.
|
data/lib/sensu-cli/api.rb
CHANGED
@@ -7,8 +7,8 @@ module SensuCli
|
|
7
7
|
|
8
8
|
def request(opts)
|
9
9
|
http = Net::HTTP.new(opts[:host], opts[:port])
|
10
|
-
http.read_timeout =
|
11
|
-
http.open_timeout =
|
10
|
+
http.read_timeout = opts[:read_timeout]
|
11
|
+
http.open_timeout = opts[:open_timeout]
|
12
12
|
if opts[:ssl]
|
13
13
|
http.use_ssl = true
|
14
14
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
data/lib/sensu-cli/base.rb
CHANGED
data/lib/sensu-cli/path.rb
CHANGED
@@ -56,9 +56,10 @@ module SensuCli
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def silence(cli)
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
content = { :timestamp => Time.now.to_i }
|
60
|
+
content.merge!({ :owner => cli[:fields][:owner] }) if cli[:fields][:owner]
|
61
|
+
content.merge!({ :reason => cli[:fields][:reason] }) if cli[:fields][:reason]
|
62
|
+
payload = { :content => content }
|
62
63
|
payload.merge!({ :expire => cli[:fields][:expire].to_i }) if cli[:fields][:expire]
|
63
64
|
silence_path = 'silence'
|
64
65
|
silence_path << "/#{cli[:fields][:client]}" if cli[:fields][:client]
|
data/lib/sensu-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Brandau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|