monitoring-plugins/monitoring-plugins — pull request #1257 by gcoxmoz (2014-05-17 05:21:34+00:00)
Title: Fixing check_tcp to return desired exit code

https://github.com/monitoring-plugins/monitoring-plugins/issues/1062
A simple little patch to return an accurate statement ("Connection refused") along with the desired return code when asked to do so.

The global exit code is being passed around as a functional return code, and so the state of the actual connection function is being lost/interpolated badly upstream.