bin/check-varnish-status.rb in sensu-plugins-varnish-1.1.0 vs bin/check-varnish-status.rb in sensu-plugins-varnish-1.1.1
- old
+ new
@@ -75,10 +75,10 @@
)
# Main Function
def run
# Keep a full reference for the varnish binary so sudo uses a full path
- varnishadm = `which varnishadm 2>/dev/null`.to_s
+ varnishadm = `which varnishadm 2>/dev/null`.chomp
unknown 'varnishadm is not installed!' unless varnishadm.include? 'varnish'
command = `sudo #{varnishadm} -T #{config[:host]}:#{config[:port]} -S #{config[:secret]} -t #{config[:timeout]} #{config[:command]}`
if config[:command] == 'status'
if command.include? 'state running'
ok 'Up & Running'