<p>This patch will add the IP and port, or socket name, to the error message and thus simplify the problem debugging: no need to check for this information in the Nagios configuration.<br>
This function is only used by 'check_tcp.c'.</p>
<p>Without the patch:</p>
<p>$ ./plugins/check_tcp -H 127.0.0.1 -p 21<br>
Connection refused<br>
$ ./plugins/check_tcp -H /var/spool/nagios/cmd/nagios.cmd<br>
Permission denied</p>
<p>With the patch:</p>
<p>$ ./plugins/check_tcp -H 127.0.0.1 -p 21<br>
connect to address 127.0.0.1 and port 21: Connection refused<br>
$ ./plugins/check_tcp -H /var/spool/nagios/cmd/nagios.cmd<br>
connect to socket /var/spool/nagios/cmd/nagios.cmd: Permission denied</p>
<p>See <a href="https://github.com/nagios-plugins/nagios-plugins/pull/37" class="issue-link" title="Let 'np_net_connect ()' be more verbose when a network error is detected">nagios-plugins/nagios-plugins#37</a></p>
<hr>
<h4>You can merge this Pull Request by running</h4>
<pre> git pull https://github.com/waja/monitoring-plugins np_net_connect_verbose</pre>
<p>Or view, comment on, or merge it at:</p>
<p> <a href='https://github.com/monitoring-plugins/monitoring-plugins/pull/1277'>https://github.com/monitoring-plugins/monitoring-plugins/pull/1277</a></p>
<h4>Commit Summary</h4>
<ul>
<li>This patch will add the IP and port, or socket name, to the error message and</li>
<li>netutils.c - A few more changes</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/monitoring-plugins/monitoring-plugins/pull/1277/files#diff-0">plugins/netutils.c</a>
(15)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/monitoring-plugins/monitoring-plugins/pull/1277.patch'>https://github.com/monitoring-plugins/monitoring-plugins/pull/1277.patch</a></li>
<li><a href='https://github.com/monitoring-plugins/monitoring-plugins/pull/1277.diff'>https://github.com/monitoring-plugins/monitoring-plugins/pull/1277.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br><a href="https://github.com/monitoring-plugins/monitoring-plugins/pull/1277">Reply to this email on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/5514713__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMjIwMTYwMCwiZGF0YSI6eyJpZCI6MzgxOTc4MTF9fQ==--50a5d08570c460c918f37961bd9fb8f2a2cb81d5.gif" width="1" /></p>