<p>Add support for showing name (DNS) resolution in the <code>check_ping</code> plugin output (STDOUT).</p>

<p>As written (alternate suggestions welcome), after being enabled with <code>-s</code> or <code>--show-resolution</code>, the output of a sample command (including the shorthand <code>-s</code> combined with the standard <code>-H</code>):</p>

<pre><code>check_ping -sH someHost -w 3000.0,80% -c 5000.0,100% -p 5
</code></pre>

<p>... will be presented as:</p>

<pre><code>PING OK - Packet loss = 0%, RTA = 0.63 ms - someHost.myDomain.com (10.1.2.3)
</code></pre>

<p>.. instead of the typical:</p>

<pre><code>PING OK - Packet loss = 0%, RTA = 0.63 ms
</code></pre>

<p>In my monitoring configurations, DNS names are used whenever possible - to ensure that any failures in DNS resolution (either of the DNS service as a whole, or just for a given entry) are also reflected in the status of a host check.  The reduces the cost of recurring maintenance, as the monitoring configurations don't also need to be updated every time there is something as simple as an IP change.  Having a local DNS cache on the server (e.g. <code>dnsmasq</code>) makes any added performance expense trivial.</p>

<p>The default <code>ping</code> output already includes the following as the first line (as of version <code>iputils-sss20071127</code>):</p>

<pre><code>PING someHost (10.1.2.3) 56(84) bytes of data.
</code></pre>

<p>This is potentially useful information, and this change simply makes the resolved hostname (potentially different than an input hostname) and resolved IP address available for display on the plugin output.</p>

<hr>

<h4>You can merge this Pull Request by running</h4>
<pre>  git pull https://github.com/ziesemer/monitoring-plugins master</pre>
<p>Or view, comment on, or merge it at:</p>
<p>  <a href='https://github.com/monitoring-plugins/monitoring-plugins/pull/1284'>https://github.com/monitoring-plugins/monitoring-plugins/pull/1284</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Update check_ping.c</li>
  <li>Update check_ping.c</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/monitoring-plugins/monitoring-plugins/pull/1284/files#diff-0">plugins/check_ping.c</a>
    (75)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/monitoring-plugins/monitoring-plugins/pull/1284.patch'>https://github.com/monitoring-plugins/monitoring-plugins/pull/1284.patch</a></li>
  <li><a href='https://github.com/monitoring-plugins/monitoring-plugins/pull/1284.diff'>https://github.com/monitoring-plugins/monitoring-plugins/pull/1284.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/1284">Reply to this email on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/5514713__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMjU0NjM0MCwiZGF0YSI6eyJpZCI6Mzg2MzU3NjB9fQ==--db30c32fbd88dee46a8c3987718a8e87b443dbbc.gif" width="1" /></p>