Issue #6957 has been updated by R.I. Pienaar.

Project changed from MCollective to MCollective Plugins


----------------------------------------
Bug #6957: mc-nrpe does not range check return code
https://projects.puppetlabs.com/issues/6957

Author: Konrad Scherer
Status: Unreviewed
Priority: Low
Assignee: R.I. Pienaar
Category: 
Target version: 
Keywords: 
Branch: 
Affected mCollective version: 


The stats field in mc-nrpe has 4 fields, but if the return code is not in the 
range 0-3 then the call 'stats[exitcode] += 1' will fail. Here is a simple patch

<pre>
diff --git a/agent/nrpe/mc-nrpe b/agent/nrpe/mc-nrpe
index 627ee7c..2e7c29e 100755
--- a/agent/nrpe/mc-nrpe
+++ b/agent/nrpe/mc-nrpe
@@ -28,7 +28,9 @@ puts
 nrpe_results.each do |result|
     exitcode = result[:data][:exitcode].to_i
     statuscodes << exitcode
-    stats[exitcode] += 1
+    if exitcode >=0 and exitcode < 4
+      stats[exitcode] += 1
+    end
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to