title: Nagios Output Formatting
body: <p>Short version: </p>
  
  <p>Is there a better way of writing the check below?</p>
  
  <pre><code>./check_snmp -H x.x.x.x -o oidstring -C public | awk '{print $4}' | sed 's/.$/.&amp;/' | sed -e 's/$/ KB/'
  </code></pre>
  
  <p>Long version:</p>
  
  <p>I have a Nagios service check that outputs a three digit number:</p>
  
  <pre><code>./check_snmp -H x.x.x.x -o oidstring -C public
  
  SNMP OK - 711 | iso.oidstring=711
  </code></pre>
  
  <p>This is what I have done to format it to my liking and to give an accurate value:</p>
  
  <pre><code>./check_snmp -H x.x.x.x -o oidstring -C public | awk '{print $4}' | sed 's/.$/.&amp;/' | sed -e 's/$/ KB/'
  
  71.1 KB
  </code></pre>
  
  <p>The output is perfect and I can run the command within the CentOS environment without issue, but when attempting to implement the check within Nagios, the service does not return and value and instead I get (No output on stdout). </p>
  
  <p>Strangely, I can even perform a service test check within Nagios successfully, but the page that displays the host and service values is the one that gives the (No output on stdout).</p>
  
  <p>I think Nagios doesn't like the way I'm attempting to format my output, at least on the web side of things. </p>
  
  <p>Is there a 'neater' way of writing the check above?</p>
  
  <p>Thanks in advance.</p>