[Nagiosplug-devel] NRPE Unable to read output
    news gonzo news gonzo 
    news_gonzo at yahoo.fr
       
    Mon May 30 20:59:03 CEST 2005
    
    
  
Hello,
I m' trying to devellop Nagios plugin but when I want
to check it with NRPE i have the error NRPE : Unable
to read output
But this plugin works :
#!/bin/sh
if [ $1 -gt 2 ]
    then
    echo "CRITICAL - $1 "
    exit 2
elif [ $1 -gt 1 ]
    then
    echo "WARNING - $1 "
    exit 1
else
    echo "OK - $1 "
    exit 0
fi
And this one doesn't work:
#!/bin/sh
wval=""
cval=""
while [ $# -gt 0 ]
 do
case "$1" in
      -w)
      shift
      wval=$1
      ;;
      -c)
      shift
      cval=$1
      ;;
  esac
  shift
done
tmp=`top -n 1 | grep total | awk '{print $8}' | awk -F
. '{print $1}'`
value=$[100-$tmp]
if [ $value -ge $cval ]
    then
    echo "CRITICAL - $value"
    exit 2
elif [ $value -ge $wval ]
    then
    echo "WARNING - $value"
    exit 1
else
    echo "OK - $value"
    exit 0
fi
With a local execution i haven't any problem
Thx for your help :)
	
	
		
_____________________________________________________________________________ 
Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, photos et vidéos ! 
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com
    
    
More information about the Devel
mailing list