|
From: Tim W. <tim...@gm...> - 2005-01-14 11:30:30
|
Yves,
the only things showing up in the drop file are parts (the ends) of valid lines:
for example:
0000;
0.000000
0000;
.99) OK
0.021
500000;
OK
.99) OK
0) OK
0000;
r OK
000;
.00 OK
0;5683
2047
1
) OK
0;5683
4] OK
0;
8;0;7243
I did a cat < perfparse.pipe, but I don't see any lines that don't
follow the format.
Tim
On Fri, 14 Jan 2005 11:22:39 +0100 (CET), Yves Mettier
<yme...@li...> wrote:
> > 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 cannot parse them.
> No idea yet.
>
> - 2nd bug : such messages should go in the "drop file" (/tmp/perfparse.drop with a date
> in Tim's config). But they don't : they are recognized as commands for the 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 cannot test myself
> the new nagios-2.0 feature to write directly to a pipe.
>
>
> > nagios@plato:/EUnet/nagios/bin$ ./perfparsed --show_config
>
> > Drop_File = "/tmp/perfparse.drop"
> > Drop_File_Rotate = "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 data
>
> If you redirect "./perfparsed --show_config" to a config file, notice that 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 = "string"
> > Service_Log = "|/EUnet/nagios/var/perfparse.pipe"
>
> > --- strace ../bin/perfparsed ---
> > ...
> > select(5, [4], NULL, NULL, NULL) = 1 (in [4])
> > rt_sigprocmask(SIG_BLOCK, [INT PIPE TERM], [], 8) = 0
> > read(4, "and \'Comma", 10) = 10
> > read(4, "nd\' unknow", 10) = 10
> > read(4, "n.\nType \'h", 10) = 10
> > write(4, "Command \'", 9) = 9
> > write(4, "Command", 7) = 7
>
> This should not appear again with the patch.
>
> > write(4, "\' unknown.\nType \'help\' for help."..., 33) = -1 EAGAIN
> > (Resource temporarily unavailable)
>
> perfparse tries to write to the pipe. With the patch, it should not happen any more.
>
> Well, now, perfparse should not work better, but the wrong lines go to the
> /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
>
> --
> - 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/ -
>
>
|