From: Yves <yme...@pe...> - 2005-01-14 14:49:00
|
> I did a diff between version 104.1 (the last working version on my > production environment) and 104.8, and found that in log_reader.c, > function log_reader you changed (104.8 first) > 502c501 > < while(0 < (r=3Dread(log_fd[i]->fd,tmp,10))) { > --- >> while(10 =3D=3D (r=3Dread(log_fd[i]->fd,tmp,10))) { > > tmp[r] =3D '\0'; > log_fd[i]->file_pos +=3Dr; > log_fd[i]->buffer =3D g_string_append(log_fd[i]->buffer,tmp); > if(strchr(tmp,'\n')) break; > if((LOG_FD_CLIENT_SOCKET !=3D log_fd[i]->type) && (r!=3D 10)) break; > } > if((r>0) && (r<10)) { > tmp[r] =3D '\0'; > log_fd[i]->file_pos +=3Dr; > log_fd[i]->buffer =3D g_string_append(log_fd[i]->buffer,tmp); > } > > As a result, the last part of the line gets added twice to the buffer, > and this results in invalid lines. That last 'if' block should not be > there, I think. I agree with you. Could you test without that 2nd "if" block ? If it works, consider this as the fix. I made that modif because of a bug with the perfparsed server. I will then release perfparse-0.104.8ym3 on my web site, but except Tim w= ho worked on that version, it's better to upgrade from 0.104.X to 0.104.9 than from 0.= 104.x to 0.104.8ym3 and then from 0.103.8ym3 to 0.104.9. > So it's not a problem of wrong input from Nagios. I thought so, but with nagios 2.0 in beta, you cannot be sure that it is = not a bug of Nagios. For example, with Nagios-2.0a1, sending a kill signal to reboot i= t would crash it. Thanks for the feedback and the tips. Yves --=20 - Homepage - http://ymettier.free.fr - http://www.logicacmg.com - - GPG key - http://ymettier.free.fr/gpg.txt - - Maitretarot - http://www.nongnu.org/maitretarot/ - - Perfparse - http://perfparse.sf.net/ - |