From: James T. <ja...@nt...> - 2007-03-06 20:48:10
|
Florian Gleixner wrote: > Good morning, > > so, is it running now? > > Flo > > James Tran wrote: > >> Florian Gleixner wrote: >> >>> O.K. let's try: >>> >>> - do you have perfparsed running? >>> - you can check the error log. In your config it is set to >>> "perfparse.log". Use a absolute path if you cannot find that file. >>> - Is /usr/local/nagios/var/service-perfdata.dat a pipe? If it is a file, >>> it will not work. move the file away. As far as i remember perfparsed >>> recreates the pipe at startup. >>> >>> Here's my config of a testing system: >>> >>> Nagios command: >>> >>> command_line >>> /usr/local/nagios/bin/perfparse_nagios_pipe_command.pl >>> /usr/local/nagios/va >>> r/serviceperf.log "$TIMET$" "$HOSTNAME$" "$SERVICEDESC$" >>> "$SERVICEOUTPUT$" "$SERVICESTATE$" "$SERVI >>> CEPERFDATA$" >>> } >>> >>> perfparse.cfg: >>> >>> Service_Log = "|/usr/local/nagios/var/serviceperf.log" >>> Service_Log_Position_Mark_Path = "no" >>> Error_Log = "/usr/local/nagios/var/perfparse.log" >>> Error_Log_Rotate = "Yes" >>> Drop_File = "/tmp/perfparse.drop" >>> Drop_File_Rotate = "Yes" >>> >>> Lock_File = "/var/lock/perfparse.lock" >>> >>> Nagios_Lock = "/usr/local/nagios/var/nagios.lock" >>> >>> >>> Show_Status_Bar = "no" >>> >>> Do_Report = "no" >>> >>> >>> Default_user_permissions_Policy = "rw" >>> Default_user_permissions_Host_groups = "rw" >>> >>> >>> Output_Log_File = "yes" >>> Output_Log_Filename = >>> "/usr/local/nagios/var/perfparse_output_log" >>> Output_Log_Rotate = "yes" >>> >>> No_Raw_Data = "no" >>> No_Bin_Data = "no" >>> >>> DB_User = "nagiostat" >>> DB_Name = "nagiostat" >>> DB_Pass = "nagiostat" >>> DB_Host = "127.0.0.1" >>> >>> >>> This is my perfparsed startfile: >>> >>> #! /bin/sh >>> # >>> ### BEGIN INIT INFO >>> # Provides: perfparsed >>> # Required-Start: $local_fs $remote_fs $syslog >>> # Required-Stop: >>> # Default-Start: 2 3 5 >>> # Default-Stop: >>> # Description: Start the perfparse daemon. >>> ### END INIT INFO >>> >>> >>> PPPIPE=/usr/local/nagios/var/serviceperf.log >>> >>> case "$1" in >>> start) >>> if [ -f $PPPIPE ] ; then >>> echo "creating pipe" >>> mv $PPPIPE ${PPPIPE}.old >>> mkfifo $PPPIPE >>> chown nagios2:nagios2 $PPPIPE >>> APPLY_OLD_DATA=1 >>> fi >>> echo "Starting perfparsed" >>> /usr/local/nagios/bin/perfparsed -d >>> if [ "$APPLY_OLD_DATA" ] ; then >>> echo "applying old data" >>> cat ${PPPIPE}.old >> $PPPIPE >>> fi >>> ;; >>> stop) >>> killproc perfparsed >>> ;; >>> *) >>> echo "Usage: $0 {start|stop}" >>> exit 1 >>> esac >>> >>> Flo >>> >>> James Tran wrote: >>> >>> >>>> See i don't get how to check it then if i'm trying to do it the piped >>>> way. The install guide doesn't tell me anyway to check it except by >>>> running ./perfparse-log2mysql -r >>>> I want to be able to get this thing to work with oreon and well i think >>>> if i can get it to work ANY WAY i'll be fine. >>>> >>>> Here's what i've done for the configs >>>> I have no idea how to check it besides going to the >>>> /cgi-bin/nagios/perfparse.cgi and checking it but according the the cgi >>>> it still isn't working >>>> If you could give me some idea of how i can troubleshoot errors with >>>> this i'd be grateful. or highlight some trouble areas. This is me trying >>>> to set it up in pipe mode so if u can kinda guide me into pipe mode >>>> config that'd be great. >>>> >>>> >>>> >>>> *nagios.cfg:* >>>> >>>> host_perfdata_file=/usr/local/nagios/var/host-perfdata.dat >>>> service_perfdata_file=/usr/local/nagios/var/service-perfdata.dat >>>> service_perfdata_command=process-service-perfdata >>>> host_perfdata_command=process-host-perfdata >>>> host_perfdata_file_template=$TIMET$ $HOSTNAME$ $HOSTCHECKCOMMAND$ >>>> $HOSTOUTPUT$ $ >>>> HOSTSTATE$ $HOSTPERFDATA$ >>>> service_perfdata_file_template=$TIMET$ $HOSTNAME$ $SERVICEDESC$ >>>> $SERVICEOUTPUT$ >>>> $SERVICESTATE$ $SERVICEPERFDATA$ >>>> host_perfdata_file_processing_interval=10 >>>> service_perfdata_file_processing_interval=10 >>>> #host_perfdata_file_processing_command=process-host-perfdata >>>> #service_perfdata_file_processing_command=process-service-perfdata >>>> >>>> *misccommand.cfg* >>>> >>>> define command{ >>>> command_name process-service-perfdata >>>> command_line $USER2$/bin/perfparse_nagios_pipe_command.pl >>>> /usr/local/nagio >>>> s/var/rw/service-perfdata.dat "$TIMET$" "$HOSTNAME$" >>>> "$HOSTCHECKCOMMAND$" "$HOST >>>> OUTPUT$" "$HOSTSTATE$" "$HOSTPERFDATA$" >>>> } >>>> define command{ >>>> command_name process-host-perfdata >>>> command_line $USER2$/bin/perfparse_nagios_pipe_command.pl >>>> /usr/local/nagio >>>> s/var/rw/host-perfdata.dat "$TIMET$" "$HOSTNAME$" "$SERVICEDESC$" >>>> "$SERVICEOUTPU >>>> T$" "$SERVICESTATE$" "$PERFDATA$" >>>> >>>> *perfparse.cfg* >>>> Server_Port = 1976 >>>> Service_Log = >>>> "|/usr/local/nagios/var/service-perfdata.dat" >>>> Service_Log_Position_Mark_Path = "-" >>>> Error_Log = "perfparse.log" >>>> Error_Log_Rotate = "Yes" >>>> Error_Log_Keep_N_Days = "7" >>>> Drop_File = "/usr/local/nagios/var/perfparse.drop" >>>> Drop_File_Rotate = "Yes" >>>> Drop_File_Keep_N_Days = "7" >>>> Lock_File = "/var/lock/perfparse.lock" >>>> Show_Status_Bar = "Yes" >>>> Do_Report = "Yes" >>>> Default_user_permissions_Policy = "rw" >>>> Default_user_permissions_Host_groups = "rw" >>>> Default_user_permissions_Summary = "rw" >>>> Output_Log_File = "no" >>>> Output_Log_Filename = >>>> "/usr/local/nagios/var/perfparse_output_log" >>>> Output_Log_Rotate = "yes" >>>> Output_Log_Keep_N_Days = "7" >>>> Use_Storage_Socket_Output = "no" >>>> Storage_Socket_Output_Host_Name = "localhost" >>>> Storage_Socket_Output_Port = "1974" >>>> Server_Port = "1976" >>>> Use_Storage_Mysql = "yes" >>>> No_Raw_Data = "no" >>>> No_Bin_Data = "no" >>>> DB_User = "xxx" >>>> DB_Name = "xxx" >>>> DB_Pass = "xxx" >>>> DB_Host = "localhost" >>>> Dummy_Hostname = "dummy" >>>> Storage_Modules_Load = "mysql" >>>> >>>> >>>> >>>> >>>> >> Ok >> >> I reset everything according to your specs >> >> i noticed a couple of funny things. >> The log file doesn't come out at perfparse.log >> it comes out as perfparse.log.20070305.log >> and perfparse.drop >> come out as perfparse.drop.20070305.log >> >> 2007/03/05 08:08:23 [perfparsed.c:176 13199 ] Perfparsed successfully >> daemonized (pid=13199) >> 2007/03/05 08:08:23 [ storage.c:95 13199 ] storage_mysql module >> successfully loaded >> 2007/03/05 08:08:24 [ storage.c:264 13202 ] Perfparsed : periodic >> cleanup >> 2007/03/05 08:08:24 [clean_tools.c:101 13202 ] Could not open >> directory '/tmp/perfparse.drop' >> >> dunno if that's effecting anything but i also get the following errors >> in the log file: >> >> >> I removed the service-perfdata.dat file and let it create a new pipe there >> perfparsed is running* >> *shell>:/usr/local/nagios/etc# ps -e|grep perfparsed >> 13199 ? 00:00:00 perfparsed* >> >> misccommands.cfg has the following >> >> *define command{ >> command_name process-service-perfdata >> command_line >> /usr/local/nagios/bin/perfparse_nagios_pipe_command.pl / >> usr/local/nagios/var/service-perfdata.dat "$TIMET$" "$HOSTNAME$" >> "$HOSTCHECKCOMM >> AND$" "$HOSTOUTPUT$" "$HOSTSTATE$" "$PERFDATA$*" >> >> * >> *nagios.cfg has the following* >> >> process_performance_data=1 >> host_perfdata_command=process-host-perfdata >> service_perfdata_command=process-service-perfdata >> >> *perfparse.cfg has the following:* >> >> Server_Port = 1976 >> Service_Log = "|/usr/local/nagios/var/service-perfdata.dat" >> Service_Log_Position_Mark_Path = "no" >> Error_Log = "/usr/local/nagios/var/perfparse.log" >> Error_Log_Rotate = "Yes" >> Error_Log_Keep_N_Days = "7" >> Drop_File = "/tmp/perfparse.drop" >> Drop_File_Rotate = "Yes" >> Drop_File_Keep_N_Days = "7" >> Lock_File = "/var/lock/perfparse.lock" >> Show_Status_Bar = "no" >> Do_Report = "no" >> Default_user_permissions_Policy = "rw" >> Default_user_permissions_Host_groups = "rw" >> Default_user_permissions_Summary = "rw" >> Output_Log_File = "yes" >> Output_Log_Filename = >> "/usr/local/nagios/var/perfparse_output_log" >> Output_Log_Rotate = "yes" >> Output_Log_Keep_N_Days = "7" >> Use_Storage_Socket_Output = "no" >> Storage_Socket_Output_Host_Name = "localhost" >> Storage_Socket_Output_Port = "1974" >> Server_Port = "1976" >> Use_Storage_Mysql = "yes" >> No_Raw_Data = "no" >> No_Bin_Data = "no" >> DB_User = "xxx" >> DB_Name = "xxx" >> DB_Pass = "xxx" >> DB_Host = "localhost" >> Dummy_Hostname = "dummy" >> Storage_Modules_Load = "mysql"* >> * >> By the way i appreciate you helping out with this i'm sure you're pretty >> busy and all. >> >> >> Ok so obviously i can't get the piped way working. So... what i did is i just reconfigured EVERYTHING so i could do it with the default method or parsing the log file. So i recompiled nagios --with-file-perfdata then remade perfparse with the same data again tossed in the default .cfg files from nagios and perfparse so what i did this time instead is... set the performancedata to 1 on nagios.cfg added the following lines: xpdfile_host_perfdata_file=/usr/local/nagios/var/hostperf.log xpdfile_host_perfdata_template=$TIMET$\t$HOSTNAME$\t$OUTPUT$\t$PERFDATA$ xpdfile_service_perfdata_file=/usr/local/nagios/var/serviceperf.log xpdfile_service_perfdata_template=$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$OUTPUT$\t$SERVICESTATE$\t$PERFDATA$ change perfparse.cfg to have the following settings: # Server managment (perfparsed only) : # ==================================== Server_Port = 1976 # Parser managment : # ================== # Performance Data Log Files ("-" for stdin) : Service_Log = "/usr/local/nagios/var/service-perfdata.out" Service_Log_Position_Mark_Path = "/usr/local/nagios/var/rw" # Error handling : Error_Log = "perfparse.log" Error_Log_Rotate = "Yes" Error_Log_Keep_N_Days = "7" Drop_File = "/tmp/perfparse.drop" Drop_File_Rotate = "Yes" Drop_File_Keep_N_Days = "7" and the rest is the same as before. i looked at the service-perfdata.out to make sure nagios was logging perf data and it is. no i goto ../bin/perfparse-log2mysql -r and i get: +-----------------------------+ +-----------------------------+ | Generic statistics | | Nb Log Lines : 1 | | Nb lines parsed : 0 | | Nb lines dropped : 0 | | Start date : 2007-03-06 | | Elapsed time : 00:00:00 | | Start time : 04:42:43 | | Rate : (line/sec) 0.00 | +-----------------------------+ +-----------------------------+ +-----------------------------+ +-----------------------------+ | MySQL storage statistics | | | | New Hosts : 0 | | Metric/line : 0.00 | | New Metrics : 0 | | Metrics Recorded : 0 | | New Services : 0 | | Summary Rec Added : 0 | | New Summary Group : 0 | | SQL Queries : 19 | +-----------------------------+ +-----------------------------+ Just like before. I checked the logs and nothing. Tho when i had the Mark_Path set to "-" it was complaining it wanted a write directory which i gave it and that error went away. I mean i am doing it in the first method correct aren't i? cause i thought i was doing it correct in pipe method and that didn't work. Anything obvious with like sql versions i should be aware of? I'm using mysql 5.5.032-7 Thanks Much, James |