sensu-check-helpers 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7fdd666cee1d1f4ff38de338cb52177c56ce4e96
4
- data.tar.gz: 660fd08ec57bfb4f3091c02982a13b559138be3a
3
+ metadata.gz: 06bd3f4e004fd2e3b95b0eec8ed2cf447fc633ad
4
+ data.tar.gz: b3e1a3b51a43964df08c1002cf97e4d59c2302f6
5
5
  SHA512:
6
- metadata.gz: 7867b5d023580d8b66f53d109efc3700a83a19c9d3c5cbeef8c81ed5694ffa4d44edf987e7d469e79656cc0d1cb88a61fc16a889681e63cec9d595e97f0e5ae6
7
- data.tar.gz: f1e883fa9bc642ad2747dc2ffd3b985f4f3fcaf1fb7f99e850338fadf934a44e0e924c27cc8d9d4280a589da8116b82084c387cf60ec955640e040c412f616d1
6
+ metadata.gz: c092c2467b6b164c30648f48891eb8ea939a6ae36f6c4aa7a08c2a33f4b8e84627c242b1bd6b938859bdd96230d62859c56d16c2a923c63e029a60978c6ae2bd
7
+ data.tar.gz: 192fdf943dce23e7ec824bfc8fb2d7e584d6378660295fb17eac40f28b08a51b50350af2fdf9c20c1977d3b560014e82f1d682ef4a8f0268423727c249dfa96f
@@ -12,19 +12,19 @@ module SensuCheckHelpers
12
12
 
13
13
  def send_ok(alert_name, alert_message)
14
14
  handlers = config[:handlers].split(',').map(&:strip)
15
- check_result = { :name => alert_name, :status => OK, :output => "OK: #{alert_message}", :handlers => handlers }
15
+ check_result = { name: alert_name, status: OK, output: "OK: #{alert_message}", handlers: handlers }
16
16
  sensu_client_socket check_result.to_json
17
17
  end
18
18
 
19
19
  def send_warning(alert_name, alert_message)
20
20
  handlers = config[:handlers].split(',').map(&:strip)
21
- check_result = { :name => alert_name, :status => WARNING, :output => "WARNING: #{alert_message}", :handlers => handlers }
21
+ check_result = { name: alert_name, status: WARNING, output: "WARNING: #{alert_message}", handlers: handlers }
22
22
  sensu_client_socket check_result.to_json
23
23
  end
24
24
 
25
25
  def send_critical(alert_name, alert_message)
26
26
  handlers = config[:handlers].split(',').map(&:strip)
27
- check_result = { :name => alert_name, :status => CRITICAL, :output => "CRITICAL: #{alert_message}", :handlers => handlers }
27
+ check_result = { name: alert_name, status: CRITICAL, output: "CRITICAL: #{alert_message}", handlers: handlers }
28
28
  sensu_client_socket check_result.to_json
29
29
  end
30
30
 
@@ -3,7 +3,7 @@ module SensuCheckHelpers
3
3
  module Request
4
4
 
5
5
  def http_request(url, bypass_ssl: false)
6
- response = bypass_ssl ? open(url, { :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE }) : open(url)
6
+ response = bypass_ssl ? open(url, { ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE }) : open(url)
7
7
  JSON.parse response.read
8
8
  end
9
9
 
@@ -7,11 +7,11 @@ module SensuCheckHelpers
7
7
  end
8
8
 
9
9
  def as_seconds(duration)
10
- ChronicDuration.parse(duration.to_s, :keep_zero => true)
10
+ ChronicDuration.parse(duration.to_s, keep_zero: true)
11
11
  end
12
12
 
13
13
  def pretty_time(duration)
14
- ChronicDuration.output(duration, :format => :long)
14
+ ChronicDuration.output(duration, format: :long)
15
15
  end
16
16
 
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module SensuCheckHelpers
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-check-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Snape