title: Script returns null from Nagios but not when ran localy
body: <p>I wrote a simple nagios command to check the change of a value over 1 second</p>
  
  <pre><code>#!/bin/bash
  HOSTNAME=$1
  COMMUNITY=$2
  OID=$3
  WAITTIME=1
  echo "/usr/lib/nagios/plugins/check_snmp -H $HOSTNAME -C $COMMUNITY -o $OID" &gt; /tmp/csnmp_comand
  VAR1=`/usr/lib/nagios/plugins/check_snmp -H $HOSTNAME -C $COMMUNITY -o $OID|cut -d"=" -f2|sed 's/[a-Z]//'`
  /bin/sleep $WAITTIME
  VAR2=`/usr/lib/nagios/plugins/check_snmp -H $HOSTNAME -C $COMMUNITY -o $OID|cut -d"=" -f2|sed 's/[a-Z]//'`
  CHANGED=`/usr/bin/expr $VAR2 - $VAR1`
  BPS=`/usr/bin/expr $CHANGED / $WAITTIME`
  echo "OK $BPS|bps=$BPS" &gt; /tmp/check_snmptest
  echo "OK $BPS|bps=$BPS"
  exit 0
  </code></pre>
  
  <p>And I wrote a service calling this script</p>
  
  <pre><code>define command{
      command_name    snmp_cps
      command_line     /usr/lib/nagios/plugins/check_cps '$HOSTADDRESS$' '$_HOSTSNMPCOMMUNITY$' '$ARG1'
  }
  </code></pre>
  
  <p>When I call The script manually ( Even as the nagios user ) I get</p>
  
  <pre><code>OK 233|bps=233 
  </code></pre>
  
  <p>Or something like that, but when I schedule this command it returns null and sets it to critical</p>
  
  <p>Also My host.cfg is</p>
  
  <pre><code>define host{
      use     generic-host
      host_name   asa5505.customer.local
      alias       Options ASA 5505
      address     asa5505.customer.local
      _SNMPCOMMUNITY  SetSecurly
  }
  define service {
          use                             generic-service
          host_name                       asa5505.customer.local
          service_description             Outside Interface PBS
          check_command                   snmp_cps!1.3.6.1.2.1.2.2.1.10.16
  }
  </code></pre>
  
  <p>With a few changes ( hostname and snmpcommunity )</p>