Hi,

Interesting point.  I'm not sure why the metric check generates an exit status of 2 when the following is used
if overview['message_stats']['publish']
instead of
if overview['message_stats'].include?('publish') then
But it does.$ rvm use system
Now using system ruby. 
$ ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
$ ./plugins/rabbitmq/rabbitmq-overview-metrics.rb --user ***** --password ****** --port 15672; echo $?
dev-rabbitmq-1002.va.opower.it.rabbitmq.queue_totals.messages.count	0	1363966468
dev-rabbitmq-1002.va.opower.it.rabbitmq.queue_totals.messages.rate	0.0	1363966468
dev-rabbitmq-1002.va.opower.it.rabbitmq.queue_totals.messages_unacknowledged.count	0	1363966468
dev-rabbitmq-1002.va.opower.it.rabbitmq.queue_totals.messages_unacknowledged.rate	0.0	1363966468
dev-rabbitmq-1002.va.opower.it.rabbitmq.queue_totals.messages_ready.count	0	1363966468
dev-rabbitmq-1002.va.opower.it.rabbitmq.queue_totals.messages_ready.rate	0.0	1363966468
2
Since this is a minor change, can we proceed with this change and create a bug to investigate why this happening? 
Jessica 

________________________________
 From: nstielau <notifications@github.com>
To: sensu/sensu-community-plugins <sensu-community-plugins@noreply.github.com> 
Cc: Jessica Blackburn <jblackburn22@yahoo.com> 
Sent: Thursday, March 21, 2013 1:26 PM
Subject: Re: [sensu-community-plugins] Wrap data elements to prevent abnormal exit (#163)
 

In plugins/rabbitmq/rabbitmq-overview-metrics.rb:
> @@ -99,20 +99,22 @@ def run
>      output "#{config[:scheme]}.queue_totals.messages_ready.rate", overview['queue_totals']['messages_ready_details']['rate'], timestamp
>  
>      # overview['message_stats']['publish']
> -    if overview['message_stats']['publish'] then 
> +    if overview['message_stats'].include?('publish') then 
Weird.  So why does this code exit successfully with status 0?
[nick@here ~]$ ./test.rb; echo $?
not nil
0
[nick@here ~]$ cat test.rb 
#!/usr/bin/env ruby if nil puts 'nil'
else puts 'not nil'
end 
—
Reply to this email directly or view it on GitHub.