From: Yves <yme...@pe...> - 2004-11-22 10:07:48
|
> Has anyone managed to use 'method 4' , i.e. make nagios write to a > pipe that is read by perfparsed? > > I managed to get it to work once, but then I killed perfparsed and > tried to restart it and it never comes up again. In the error log I > see this: > 2004/11/22 10:11:18 [log_reader.c:370 9800 ] Could not create fifo > '/usr/local/nagios/var/perfparse.pipe' > > The problem is that perfparse.pipe still exists from the previous run. > But you can't get rid of it, because nagios is constantly writing to > it. If you remove it, it instantly reappears as a regular file! Yes, of course. In a perfect world, nagios (the nagios command that outpu= ts to the pipe) should test if the file exists and if it is a pipe, or raise an error. In our world, what can we do ? > OK, I could shutdown nagios and restart perfparsed first and then > nagios again, but this is not really an acceptable solution. What version of nagios are you using ? Any version with some command that= printf >> perfparse.pipe ? Or nagios-2.0cvs with the new feature : output perfdata = to a pipe ? In the second case, this would be a bug in nagios and should be addressed= to nagios developers. In the first case... 1 update your command to get closer from the perfect world ? You can do i= t, but will others do it too ? 2 update perfparsed to take care of this ? But fixing somewhere a bug of = somewhere else is never a good solution. We get away from the perfect world. 3 ask the user to reboot nagios at the same time as perfparsed restarts ?= But is this a good solution ? I have an idea for (2) : when perfparsed starts and finds the existing fi= le perfparse.pipe, it can rename it and create the fifo. Then it's your work= to cat perfparse.pipe.old > perfparse.pipe. And it supposes that nagios closes t= he file and reopens it every time there is something to write. Otherwise, the only wa= y is to reboot nagios. Is this a correct workaround ? > My perfparse.cfg: > nagios@naxos:~/etc$ cat perfparse.cfg Please run perfparsed --show_config instead :) In next version, I will write at the beginning of the exemple config file= to run the binary with --show_config instead of showing the config file. However, thanks for sending the config file that usually helps us to find= good things :) 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/ - |