Closed FlorinAndrei closed 2 years ago
This issue has been mentioned on Sensu Community. There might be relevant details there:
https://discourse.sensu.io/t/http-check-cannot-handle-connection-refused/2743/4
For clarity... when you say "should produce the standard service failure message" Do you mean the full output should be:
Error executing http-check: error executing check: Get http://user.service.consul:81/metadata: dial tcp 10.2.95.221:81: connect: connection refused
It should not print out the usage blob.
Its output should conform to some standard format. I do not know what standard Sensu uses these days, but if you guys are still following the Nagios template, then it's this in terms of printed text and process exit code:
https://www.howtoforge.com/tutorial/write-a-custom-nagios-check-plugin/
Would be nice if that brief line of text could distinguish between connection refused and connection timed out.
It works fine if the port is up and running:
However, any error whatsoever (either timeout or connection refused) results in the Usage Help screen:
Instead, it should produce the standard service failure message.
This plugin is broken, it cannot be used as is.