From: Michael G. <mic...@pa...> - 2005-03-16 22:31:07
|
Hello, I have complied nagios 1.2 with --with-default-perfdata --enable- embedded-perl --with-perlcache I then complied perfparse 0.105.6 I want nagios to feed perfparse via a PIPE since that seemed like the best option. In my nagios.cfg file I have the following: cfg_file=/home/mgale/downloads/network- monitor/netmonitorbase/etc/nagios_perfparse.cfg process_performance_data=1 host_perfdata_command=process-host-perfdata service_perfdata_command=process-service-perfdata In perfparse I have: Service_Log = "|/home/mgale/downloads/network- monitor/netmonitorbase/var/serviceperf.log" And I setup the DB area: DB_User = "perfpase_user" DB_Name = "perfpasedb" DB_Pass = "perfuser" DB_Host = "127.0.0.1" In my resource.cfg file I provided $USER2$ with the path if the perfparse install. I added this to my nagios_perfparse.cfg file: define command{ command_name process-service-perfdata command_line $USER2$/bin/perfparse_nagios_command.pl $USER2 $/var/serviceperf.log "$TIMET$" "$HOSTNAME$" "$SERVICEDESC$" "$OUTPUT$" "$SERVICESTATE$" "$PERFDATA$" } Now in my .../path/var directory where all the nagios logs and perfparse logs are setup there is a serviceperf.log what is incrementing with all the data: 1110996780 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING 1110996840 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING 1110996900 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING 1110996960 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING 1110997260 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING 1110997560 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING 1110997860 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING 1110998160 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING 1110998460 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING 1110998760 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING 1110999060 mgale-pc HTTP Server HTTP WARNING: HTTP/1.1 403 Forbidden WARNING But nothing is being added to the database ... and there are no reports. Now I have only started the Nagios process. I do not have to start any perfparse process because it is feed with a PIPE ? Have been going through the online documentation for a few hours trying to figure this out ... Thanks. Michael. |
From: Daniele C. <dan...@ti...> - 2005-03-17 09:12:42
|
> But nothing is being added to the database ... and there are no reports. > Now I have only started the Nagios process. I do not have to start any > perfparse process because it is feed with a PIPE ? > > Have been going through the online documentation for a few hours trying > to figure this out ... > you should start perfparsed daemon in order to process data written to the pipe and to store that into the DB bye Daniele |
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 |
From: Michael G. <mic...@pa...> - 2005-03-17 16:51:15
|
Hello, I believe I have my nagios working correctly with perfparse now ... no thanks to the documentation. I followed all the steps in the how to for using the PIPE method. Now the data would just fill up in the serviceperf.log and never get into the database. It turns out that you have to run the perfparsed binary to start / open the PIPE. Now this does not simple work by executing the binary .. you will need to pass it parameters for how the data should be stored. The log files should show "No module was loaded. Check the Storage_Module_Load config option" .. so I run the binary with: ./bin/perfparsed --storage_modules_load mysql & This started the perfparsed app and created the PIPE. Now data is being sent into the database ... so it seems to be working. Michael. On Wed, 2005-03-16 at 22:40 +0000, Ben O'Hara wrote: > On Wed, 16 Mar 2005 15:30:58 -0700, Michael Gale <mic...@pa...> wrote: > > Hello, > > > > I have complied nagios 1.2 with --with-default-perfdata --enable- > > embedded-perl --with-perlcache > > > > I then complied perfparse 0.105.6 > > > > I want nagios to feed perfparse via a PIPE since that seemed like the > > best option. > > > > Same here Micheal, following the docs for using a PIPE seems to > suggest you dont need to use cron, however, I found I had to call > ./bin/perparse.sh to call ./bin/perfparse-log2mysql.pl every 5 minutes > to update the DB. > > This didnt seem right to me, and caused Nagios to reschedule its > checks so services never got checked. > > Seems you need to run perfparsed to create a pipe and then start > nagios. Although Im not 100% sure as the documentation seems a bit > lacking :-( > > Anyone got full setup they could share with us? > > Cheers > > Ben |