From: Daniele C. <dan...@ti...> - 2005-03-17 10:05:55
|
>Ive tried that, however i get an error saying >> >> "/apps/nagios/var/perfdata-service.log exists and is not a pipe" >> >> It appears that perfparsed needs to be started prior to nagios in >> order to create the pipe, but if perfparsed is stopped nagios just >> starts overwriting the pipe with a standard file. >> >> Im assuming its best to hack up the nagios.sh starts script to make it >> start perfparsed before nagios? Another solution should be this posted in list by Tim: *******************begin cut and paste******************* You can update the perl script that nagios uses to write the data to the pipe (in your config this is /usr/local/nagios/bin/perfparse_nagios_command.pl), so that it will not write anything if the pipe does not exist. That way, you prohibit the script from creating it as a regular file if it doesn't exist yet. I believe this should do the trick. Tim. #! /usr/bin/perl -w use strict; my $file = shift @ARGV; exit(0) unless (-p $file); open FH, ">$file" or die "'$file' could not be opened for appending\n"; print FH join("\t", @ARGV); print FH "\n"; close FH; *******************end cut and paste******************* A note: use perfparse_nagios_pipe_command.pl instead of perfparse_nagios_command.pl in your perfparse_nagios_command.pl definition. Obviously modify perfparse_nagios_pipe_command.pl perl script ;) Daniele |