PDA

View Full Version : service-perfdata avec un ?


cmoi
20th April 2007, 13:17
Bonjour,

J'ai bien mon "service-perfdata" qui se créé, sauf qu'il se créé avec un '?' a la fin :

$>:/usr/local/nagios/var# ls -l
total 4296
drwxrwxr-x 2 nagios nagios 4096 2007-04-18 23:59 archives
-rw-rw-r-- 1 nagios nagios 238 2007-04-20 08:44 comment.log
-rwxrwxr-x 1 nagios nagios 238 2007-04-04 17:08 comments.dat
-rwxrwxr-x 1 nagios nagios 239 2007-04-04 17:08 downtime.dat
-rwxrwxr-x 1 nagios nagios 239 2007-04-19 09:09 downtime.log
-rwxrwxr-x 1 nagios nagios 2918066 2007-04-19 16:22 host-perfdata.dat
-rw-r--r-- 1 nagios nagios 6 2007-04-20 09:11 nagios.lock
-rwxrwxr-x 1 nagios nagios 1385090 2007-04-20 12:13 nagios.log
-rwxrwxr-x 1 nagios nagios 10656 2007-04-20 12:09 objects.cache
-rwxrwxr-x 1 nagios nagios 25168 2007-04-20 09:11 retention.dat
drwxrwxr-x 2 nagios nagios 4096 2007-04-20 09:11 rw
-rw-r--r-- 1 nagios nagios 354 2007-04-20 12:13 service-perfdata?
-rw-r--r-- 1 root root 0 2007-04-20 09:01 service-perfdata.tmp
-rw-rw-r-- 1 nagios nagios 3135 2007-04-20 12:14 status.log
-rw------- 1 nagios nagios 2896 2007-04-20 12:09 status.sav
$>:/usr/local/nagios/var#

Voici mon process-service-perfdata :

# some parameters passed on command line
TIMET=$1
HOSTNAME=$2
SERVICEDESC=$3
OUTPUT=$4
SERVICESTATE=$5
PERFDATA=$6
PERFFILE="/usr/local/nagios/var/service-perfdata"

/usr/bin/printf "%b" "$TIMET\t$HOSTNAME\t$SERVICEDESC\t$OUTPUT\t$SERVICE STATE\t$PERFDATA\n" >> $PERFFILE

Je précise qu'il n'y a pas de \n a la fin du fichier.

Merci de votre aide.

cmoi
20th April 2007, 13:50
J'ai trouvé :

Il se trouve que mon fichier "process-service-perfdata" contenait des caractères invisibles (^M).

Je les ai trouvé en faisant un cat -e du fichier.
Un simple rm et re-création du fichier a résolu le problème.

manu77
20th April 2007, 13:57
non le \n est indispensable car il permet de faire un retour chariot apres chaque perfsdata.
il faut que tu verifie la commande qui fait utilise le plugin service-perfdata dans nagios.cfg au niveau de service process perfdata

au pire cree la commande suivante :

/usr/bin/printf "%b" "$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT $\t$SERVICESTATE$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata

puis place la dans nagios.cfg au niveau de service process perfdata
reload la conf cela devrait aller tout seul

julio
20th April 2007, 15:10
fait un dos2unix sur le fichier preocess-service-perfdata et ca devrait etre bon.