From: Yves M. <yme...@li...> - 2005-01-14 10:22:44
|
> To Yves: > If I understand correctly, at one point (strace line 13516) perfparse > WRITES to the pipe 'Command OK unknown. Type help ....'. > Of course it picks this back up at the input, and we're off for an > infinite loop where it keeps saying it doesn't understand what it has > written itself. Could it be that it loses track of where messages end > and a new message begins? Some little explanations... There are 2 bugs. - 1st bug is that you have message with a wrong syntax, and perfparse can= not parse them. No idea yet. - 2nd bug : such messages should go in the "drop file" (/tmp/perfparse.dr= op with a date in Tim's config). But they don't : they are recognized as commands for th= e server, but not a known command. (telnet on the 1976 port of your server, type 'help'= if you want to know more - perfparse definitely needs some better documentation :) I attach a patch that is supposed to redirect bad lines to /tmp/perfparse= .drop. With this, you will be able to see what the problem is with the lines, and see= if this is a nagios bug or a perfparse bug. Last thing : I develop with nagios-1.2 and with the pipe command. I canno= t test myself the new nagios-2.0 feature to write directly to a pipe. > nagios@plato:/EUnet/nagios/bin$ ./perfparsed --show_config > Drop_File =3D "/tmp/perfparse.drop" > Drop_File_Rotate =3D "Yes" > # Log source from nagios (or other tools) that perfparse will scan > Authorized values: a file name, '-' for stdin, '|' for a fifo and '>' > for a host:port socket > For sockets, a command 'history' will be sent before retreiving the dat= a If you redirect "./perfparsed --show_config" to a config file, notice tha= t you should add some '#' at the beginning of the previous lines. This is another bug = I just found and fixed for next release. No side effects as soon as you don't redirect= this to a file without adding the '#' chars :) > # Service_Log =3D "string" > Service_Log =3D "|/EUnet/nagios/var/perfparse.pipe" > --- strace ../bin/perfparsed --- > ... > select(5, [4], NULL, NULL, NULL) =3D 1 (in [4]) > rt_sigprocmask(SIG_BLOCK, [INT PIPE TERM], [], 8) =3D 0 > read(4, "and \'Comma", 10) =3D 10 > read(4, "nd\' unknow", 10) =3D 10 > read(4, "n.\nType \'h", 10) =3D 10 > write(4, "Command \'", 9) =3D 9 > write(4, "Command", 7) =3D 7 This should not appear again with the patch. > write(4, "\' unknown.\nType \'help\' for help."..., 33) =3D -1 EAGAIN > (Resource temporarily unavailable) perfparse tries to write to the pipe. With the patch, it should not happe= n any more. Well, now, perfparse should not work better, but the wrong lines go to th= e /tmp/perfparse.drop file. Please check it and say what's going wrong with= those lines. Also try to check (with the 'cat' command) what nagios writes to the pipe= ! 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/ - |