bin/check-rspec.rb in sensu-plugins-rspec-1.0.0 vs bin/check-rspec.rb in sensu-plugins-rspec-1.1.0
- old
+ new
@@ -75,21 +75,26 @@
option :handler,
short: '-l HANDLER',
long: '--handler HANDLER',
default: 'default'
+ option :proxy_client,
+ description: 'Proxy client name for results',
+ long: '--proxy-client SOURCE',
+ required: false
+
def sensu_client_socket(msg)
u = UDPSocket.new
u.send(msg + "\n", 0, '127.0.0.1', 3030)
end
def send_ok(check_name, msg)
- d = { 'name' => check_name, 'status' => 0, 'output' => "OK: #{msg}", 'handler' => config[:handler] }
+ d = { 'name' => check_name, 'status' => 0, 'output' => "OK: #{msg}", 'handler' => config[:handler], 'source' => config[:proxy_client] }
sensu_client_socket d.to_json
end
def send_warning(check_name, msg)
- d = { 'name' => check_name, 'status' => 1, 'output' => "WARNING: #{msg}", 'handler' => config[:handler] }
+ d = { 'name' => check_name, 'status' => 1, 'output' => "WARNING: #{msg}", 'handler' => config[:handler], 'source' => config[:proxy_client] }
sensu_client_socket d.to_json
end
def run
cd = "cd #{config[:tests_dir]};"