From: Eduardo M. <ema...@bs...> - 2005-02-18 17:21:25
|
I redid my install from scratch. Trying to follow the FAQ for Method 4: http://wiki.perfparse.org/tiki-index.php?page=BuildingMethod4Example I receive a command that mentions process-host-perfdata and process-service-perfdata already defined. I am installing Nagios 2.0b2 on RHAS3, using perfparse 0.105.5 I installed the following packages: MySQL-client-4.1.9-0.i386.rpm perl-CGI-2.81-89.10.i386.rpm MySQL-devel-4.1.9-0.i386.rpm perl-DBD-MySQL-2.9003-5.i386.rpm MySQL-server-4.1.9-0.i386.rpm perl-DBI-1.32-9.i386.rpm zlib-1.1.4-8.1 zlib-devel-1.1.4-8.1 libpng-1.2.2-25 libpng-devel-1.2.2-25 libjpeg-devel-6b-30 libjpeg-6b-30 libgd-devel-2.0.23-rhas3 libgd-2.0.23-rhas3 perfparse-0.105.5.tar.gz nagios-2.0b2.tar.gz nagios-plugins-1.4.tar.gz nrpe-2.0.tar.gz FOR NAGIOS: <SHELL>mkdir -p /opt/nagios/libexec <SHELL> mkdir -p /opt/nagios/bin <SHELL> mkdir -p /opt/nagios/etc <SHELL>./configure --prefix=/opt/nagios \ --with-template-objects \ --with-template-extinfo \ --with-init-dir=/etc/rc.d/init.d/ \ --with-default-status \ --with-default-comments \ --with-default-retention \ --with-default-downtime \ --with-default-perfdata \ --with-nagios-user=nagios \ --with-nagios-group=nagios \ --with-gd-inc=/opt/local/include \ --with-gd-lib=/opt/local/lib <SHELL>make all <SHELL>make fullinstall <SHELL>make install-config FOR NAGIOS PLUGINS: <SHELL>tar -zxvf nagios-plugins-1.4.tar.gz <SHELL>cd nagios-plugins-1.4 <SHELL>./configure --prefix=/opt/nagios --with-nagios-user=nagios --with-nagios-group=nagios <SHELL>make all <SHELL>make install FOR NRPE: <SHELL>tar -zxvf nrpe-2.0.tar.gz <SHELL>cd nrpe-2.0 <SHELL>./configure --prefix=/opt/nagios --with-nagios-user=nagios --with-nagios-group=nagios <SHELL>make all <SHELL>cp nrpe /opt/nagios/bin/ <SHELL>cp check_nrpe /opt/nagios/libexec/ <SHELL>touch /opt/nagios/etc/nrpe.cfg <SHELL>cat mynrpe.cfgsettings /opt/nagios/etc/nrpe.cfg <SHELL>echo "nrpe 5666/tcp #NRPE" >> /etc/services <SHELL>touch /etc/xinetd.d/nrpe <SHELL>cat mynrpesettings > /etc/xinetd.d/nrpe <SHELL>cd /opt/nagios/libexec <SHELL>service xinetd stop <SHELL>service xinetd start CHECKCONFIGURATION: ###############---------------############### define service{ name logmonitor_template ; service template active_checks_enabled 1 ; Active service checks are enabled passive_checks_enabled 1 ; Passive service checks are enabled/accepted parallelize_check 1 ; Active service checks should be parallelized obsess_over_service 1 ; We should obsess over this service (if necessary) check_freshness 0 ; Default is to NOT check service 'freshness' notifications_enabled 1 ; Service notifications are enabled event_handler_enabled 1 ; Service event handler is enabled flap_detection_enabled 1 ; Flap detection is enabled process_perf_data 1 ; Process performance data retain_status_information 1 ; Retain status information across program restarts retain_nonstatus_information 1 ; Retain non-status information register 0 ; ITS JUST A TEMPLATE! normal_check_interval 1 retry_check_interval 1 contact_groups me is_volatile 0 check_period 24x7 max_check_attempts 5 notification_interval 0 notification_period 24x7 notifications_enabled 1 notification_options u,c,r } ###################Local Machine Checks###################### define service{ use logmonitor_template hostgroup Testbox service_description / check_command check_nrpe!check_root } define service { use logmonitor_template hostgroup Testbox service_description /boot check_command check_nrpe!check_boot } define service { use logmonitor_template hostgroup Testbox service_description /home check_command check_nrpe!check_home } define service { use logmonitor_template hostgroup Testbox service_description /opt check_command check_nrpe!check_opt } define service { use logmonitor_template hostgroup Testbox service_description /space check_command check_nrpe!check_space } define service{ use logmonitor_template hostgroup Testbox service_description /usr check_command check_nrpe!check_usr } define service{ use logmonitor_template hostgroup Testbox service_description /var check_command check_nrpe!check_var } define service{ use logmonitor_template hostgroup Testbox service_description memory check_command check_nrpe!check_mem.pl } define service{ use logmonitor_template hostgroup Testbox service_description swap check_command check_nrpe!check_swap } define service{ use logmonitor_template hostgroup Testbox service_description total_procs check_command check_nrpe!check_total_procs } define service{ use logmonitor_template hostgroup Testbox service_description zombie_procs check_command check_nrpe!check_zombie_procs } define service{ use logmonitor_template hostgroup Testbox service_description load check_command check_nrpe!check_load } define service{ use logmonitor_template hostgroup Testbox service_description users check_command check_nrpe!check_users } #####################Remote Server Checks########################## define service{ use logmonitor_template hostgroup Testbox service_description SSH check_command check_ssh } define service{ use logmonitor_template host_name MY-test service_description ping check_command check_ping } ###############---------------############### FOR PERFPARSE: <SHELL>./configure --prefix=/opt/nagios --with-imagedir=/opt/nagios/share/images/ --with-cgidir=/opt/nagios/sbin --with-http_image_path=/nagios/images --with-glib2=/usr/lib/glib-2.0 make make install-strip CONFIGURATION: chown -R nagios.nagios /opt/nagios/*/*perf* mysqladmin -u root -p create perfparse Enter password: <SHELL>cat perfparse-0.105.5/scripts/mysql_create.sql | /usr/bin/mysql -u root -p -D perfparse <SHELL>#vi /opt/nagios/etc/nagios.cfg process_performance_data = 1 cfg_file=/opt/nagios/etc/nagios_perfparse.cfg host_perfdata_command=process-host-perfdata service_perfdata_command=process-service-perfdata <SHELL>#vi /opt/nagios/etc/resource.cfg $USER2$=/opt/nagios COMMENT OUT THE FOLLOWING: <SHELL>#vi /opt/nagios/etc/misccommands.cfg # 'process-host-perfdata' command definition #define command{ # command_name process-host-perfdata # command_line /usr/bin/printf "%b" "$LASTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$STATETYPE$\t$EXECUTIONTIME$\t$OUTPUT$\t$PERFDATA$" >> /opt/nagios/var/host-perfdata.out # } # # # 'process-service-perfdata' command definition #define command{ # command_name process-service-perfdata # command_line /usr/bin/printf "%b" "$LASTCHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$STATETYPE$\t$EXECUTIONTIME$\t$LATENCY$\t$OUTPUT$\t$PERFDATA$" >> #/opt/nagios/var/service-perfdata.out # } # <SHELL>#vi /opt/nagios/etc/nagios_perfparse.cfg define command{ command_name process-service-perfdata command_line /opt/nagios/bin/perfparse_nagios_pipe_command.pl /opt/nagios/var/perfdata-service.log "$TIMET$" "$HOSTNAME$" "$SERVICEDESC$" "$OUTPUT$" "$SERVICESTATE$" "$PERFDATA$" } define command{ command_name process-host-perfdata command_line /opt/nagios/bin/perfparse_nagios_pipe_command.pl /opt/nagios/var/var/perfdata-host.log "$TIMET$" "$HOSTNAME$" "$OUTPUT$" "$PERFDATA$" } <SHELL>cp /perfparse_nagios_pipe_command.pl /opt/nagios/bin/perfparse_nagios_pipe_command.pl <SHELL>#vi /opt/nagios/bin/perfparse_nagios_pipe_command.pl system ('/opt/nagios/bin/perfparse-log2mysql --serviceperf-log /opt/nagios/var/perfdata-service.log') <SHELL>#vi /opt/nagios/etc/perfparse.cfg ##################### Server_Port = 1976 Service_Log = "|/opt/nagios/var/perfdata-service.log" Service_Log_Position_Mark_Path = "/opt/nagios/var" Error_Log = "perfparse.log" Error_Log_Rotate = "Yes" Error_Log_Keep_N_Days = "7" Drop_File = "/opt/nagios/var" Drop_File_Rotate = "Yes" Drop_File_Keep_N_Days = "7" Daemonize = "yes" Daemon_Lock = "/opt/nagios/var/perfparsed.lock" 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 = "no" Output_Log_Filename = "/var/log/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" Storage_Modules_Dir = "/usr/local/lib" Storage_Modules_Load = "mysql" Use_Storage_Mysql = "yes" No_Raw_Data = "yes" No_Bin_Data = "yes" DB_User = "root" DB_Name = "perfparse" DB_Pass = "new-password" DB_Host = "localhost" Dummy_Hostname = "localhost" <SHELL>touch /opt/nagios/var/perfdata-service.log <SHELL>chown nagios.nagios /opt/nagios/var/perfdata-service.log <SHELL>chmod 660 /opt/nagios/var/perfdata-service.log <SHELL>touch /opt/nagios/var/perfdata_log.perfdata-service.log.mark <SHELL>chown nagios.nagios perfdata_log.perfdata-service.log.mark <SHELL>chmod 600 perfdata_log.perfdata-service.log.mark RUN PERFPARSE DAEMON: /opt/nagios/bin/perfparsed -d --storage_modules_dir /opt/nagios/lib --storage_modules_load mysql SHOW CONFIGURATION: <SHELL>#/opt/nagios/bin/perfparsed --show_config PROBLEM: Starting nagios gives - ERROR COMMAND ALREADY DEFINED [1108746174] Nagios 2.0b2 starting... (PID=31797) [1108746174] LOG VERSION: 2.0 [1108746174] Error: Command 'process-host-perfdata' has already been defined [1108746174] Error: Could not register command (config file '/opt/nagios/etc/nagios_perfparse.cfg', starting on line 19) [1108746174] Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=31797) <SHELL>/opt/nagios/bin/nagios -v /opt/nagios/etc/nagios.cfg Error: Command 'process-host-perfdata' has already been defined Error: Command 'process-service-perfdata' has already been defined Error: Could not register command (config file '/opt/nagios/etc/nagios_perfparse.cfg', starting on line 19) <SHELL>grep -R process-host-perfdata /opt/nagios/* /opt/nagios/etc/nagios_perfparse.cfg: command_name process-host-perfdata /opt/nagios/etc/misccommands.cfg:# 'process-host-perfdata' command definition /opt/nagios/etc/misccommands.cfg:# command_name process-host-perfdata /opt/nagios/etc/nagios.cfg:host_perfdata_command = process-host-perfdata I've double checked the files to see if the # signs were ok. I've looked just about everywhere for another command that specifies process-host-perfdata or process-service-data. What am I missing or did I do something wrong? <SHELL> less /opt/nagios/etc/perfparse.log.20050218.log 2005/02/18 07:36:58 [ storage.c:95 18449 ] storage_mysql module successfully loaded I am using this in a controlled test environment and would like to get it working for use in our real environment. Please please please help, -Eduardo <SHELL>/opt/nagios/bin/perfparsed --show_config > /var/tmp/perfparse.cfg Perfparsed [options] # File where Perfparse logs messages # Error_Log = "string" Error_Log = "perfparse.log" # Rotate Perfparse log files # Error_Log_Rotate = "Y/N" Error_Log_Rotate = "Yes" # Keep N days of error log. Compress recent logs and remove too old ones # Error_Log_Keep_N_Days = "value" Error_Log_Keep_N_Days = "7" # When perfparse cannot parse a line, it drops it to that file # Drop_File = "string" Drop_File = "/opt/nagios/var" # # Drop_File_Rotate = "Y/N" Drop_File_Rotate = "Yes" # Keep N days of drop file log. Compress recent logs and remove too old ones # Drop_File_Keep_N_Days = "value" Drop_File_Keep_N_Days = "7" # Port for perfparsed server # Put 0 or "" to disable the server # Server_Port = "value" Server_Port = "1976" # 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 # Service_Log = "string" Service_Log = "|/opt/nagios/var/perfdata-service.log" # Save the read position in the nagios log file ? If yes, perfparse will start from that position instead of from the beginning # Service_Log_Save_Position = "Y/N" Service_Log_Save_Position = "yes" # Path for files containing the read position for nagios log files # Service_Log_Position_Mark_Path = "string" Service_Log_Position_Mark_Path = "/opt/nagios/var" # Lock file for perfparsed # Daemon_Lock = "string" Daemon_Lock = "/opt/nagios/var/perfparsed.lock" # Run perfparsed as a daemon # Daemonize = "Y/N" Daemonize = "yes" # Perform some periodic cleanup every day # Periodic_Cleanup = "Y/N" Periodic_Cleanup = "yes" # Lock file for perfparsed periodic cleanup process # Periodic_Cleanup_Lock = "string" Periodic_Cleanup_Lock = "/opt/nagios/var/perfparsed_periodic_cleanup.lock" # Perform some periodic cleanup every day at HHMM # Periodic_Cleanup_Hour = "value" Periodic_Cleanup_Hour = "0230" # Dummy hostname if gethostname() does not work # Dummy_Hostname = "string" Dummy_Hostname = "localhost" # Don't store raw data # No_Raw_Data = "Y/N" No_Raw_Data = "yes" # Don't store bin data # No_Bin_Data = "Y/N" No_Bin_Data = "yes" # Path where storage modules are # Storage_Modules_Dir = "string" Storage_Modules_Dir = "/usr/local/lib" # Modules to load (Coma separated values) # Storage_Modules_Load = "string" Storage_Modules_Load = "mysql" # File to contain Storage Modules Status # Storage_Modules_Status_File = "string" Storage_Modules_Status_File = "/opt/nagios/var/storage_modules.status" # Storage Module : mysql # ============================== # Database user # DB_User = "string" DB_User = "root" # Database password # DB_Pass = "string" DB_Pass = "new-password" # Database name # DB_Name = "string" DB_Name = "perfparse" # Database hostname # DB_Host = "string" DB_Host = "localhost" |