From: Thomas E. <tho...@sl...> - 2005-01-14 20:50:00
|
Thanks guys! While I was having my beauty sleep you solved the problem. I commented out the if block and it works fine. thanks again, Thomas Yves 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 > > |