Skip to content

Commit cddf5bb

Browse files
committed
improving error message in check-stale-results when api config is not present
Signed-off-by: Ben Abrams <[email protected]>
1 parent 0bf8ab2 commit cddf5bb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
66

77
## [Unreleased]
88

9+
### Changed
10+
- check-stale-results.rb: improve error message when there is no api key in sensu settings (@majormoses)
11+
12+
## [3.0.0] - 2018-05-17
913
### Breaking Change
1014
- bumped dependency of `sensu-plugin` to 2.x you can read about it [here](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v200---2017-03-29)
1115

bin/check-stale-results.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ def get_uri(path)
6969

7070
def api_request(method, path)
7171
unless settings.key?('api')
72-
raise 'api.json settings not found.'
72+
raise <<EOF
73+
sensu does not have an api config stanza set, please configure it in
74+
either /etc/sensu/config.json or in any config that is loaded by sensu
75+
such as /etc/sensu/conf.d/api.json
76+
EOF
7377
end
7478
uri = get_uri(path)
7579
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|

0 commit comments

Comments
 (0)