[Nagiosplug-devel] Nagios don't execute correctly my plugin

news gonzo news gonzo news_gonzo at yahoo.fr
Mon May 30 05:34:40 CEST 2005


Hello,
I 'm trying to devellop a plugin which is execute
correctly in local but not with Nagios
For exemple in local exe:
debut fonction fin fonc tmp:100 value:0 crit:0 warn:0
CRITICAL - CPU usage 0

but in nagios :
debut fonction fin fonc tmp: value: crit:2 warn:0 OKOK
- CPU usage 

As you can it can't have correct value there is my
plugin :

. /usr/local/nagios/libexec/utils.sh
get_value(){
echo -n "debut fonction "
tmp=`/usr/bin/top -n 1 | /bin/grep total | /bin/awk
'{print $8}' | /bin/awk -F , '{print $1}'`
value=`expr 100 - $tmp`
echo -n "fin fonc "
}
wval=""
cval=""
while [ $# -gt 0 ]
  do
  case "$1" in
      -w)
      shift
      wval=$1
      ;;
      -c)
      shift
      cval=$1
      ;;
  esac
  shift
done
echo -n "tmp:$tmp value:$value crit:$cval warn:$wval "
if [ $value -ge $cval ]
    then
    echo "CRITICAL - CPU usage $value"
    exit 2
elif [ $value -ge $wval ]
    then
    echo "WARNING - CPU usage $value"
    exit 1
else
    echo "OK - CPU usage $value"
    exit 0
fi
echo "impossible"
exit 3

Can you help me please :)

thx for response


	

	
		
_____________________________________________________________________________ 
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