title: Can execute nagios ssh check manually but get 126/127 out of bounds error from nagios
body: <p>I have the following service defined in my host definition:</p>
  
  <pre><code>define service {
      use                  generic-service
      host_name            myhost.com
      service_description  swapcheck
      check_command        check_ssh_swap
  }
  </code></pre>
  
  <p>and the following in the commands.cfg:</p>
  
  <pre><code>define command {
      command_name check_ssh_swap
      command_line /home/nagios/bin/check_by_ssh -p port -H ip -C "/home/nagios/bin/check_swap -w 20% -c 5%"
  }
  </code></pre>
  
  <p>both cfg files are loaded into nagios on load. And nagios -v /etc/nagios/nagios.cfg does not give back any errors.</p>
  
  <p>When i try to execute the command </p>
  
  <pre><code>/home/nagios/bin/check_by_ssh -p port -H ip -C "/home/nagios/bin/check_swap -w 20% -c 5%"
  </code></pre>
  
  <p>with the nagios user directly, it works without problems, and I get my results back, but when nagios itself runs a scheduled check I always get</p>
  
  <pre><code>Return code of 126 for check of host 'host' was out of bounds
  </code></pre>
  
  <p>What am I missing here? Obviously all the paths, the keys, etc. are correct, otherwise I wouldnt be able to execute it manually without any problems.</p>