From: Tim W. <tim...@gm...> - 2005-01-14 14:54:26
|
Works! Tim. On Fri, 14 Jan 2005 15:48:54 +0100 (CET), Yves <yme...@pe...> wrote: > > 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=read(log_fd[i]->fd,tmp,10))) { > > --- > >> while(10 == (r=read(log_fd[i]->fd,tmp,10))) { > > > > tmp[r] = '\0'; > > log_fd[i]->file_pos +=r; > > log_fd[i]->buffer = g_string_append(log_fd[i]->buffer,tmp); > > if(strchr(tmp,'\n')) break; > > if((LOG_FD_CLIENT_SOCKET != log_fd[i]->type) && (r!= 10)) break; > > } > > if((r>0) && (r<10)) { > > tmp[r] = '\0'; > > log_fd[i]->file_pos +=r; > > log_fd[i]->buffer = 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 who 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 it would crash > it. > > Thanks for the feedback and the tips. > Yves > > -- > - 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/ - > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Perfparse-users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perfparse-users > |