Integrating PerfParse with Nagios 2.x on CentOS
From Nagios Wiki
[edit] Overview
This HOWTO will describe how to install PerfParse on CentOS (originally found on IT Duties).
[edit] Grabbing the file
1. Required Packages.
- mysql-dev
- zlib-dev
- freetype2-dev
- fontconfig-dev
- xlib-dev
- glib-dev
- gd-dev
yum -y install glib-devel zlib-devel mysql-devel fontconfig-devel python-xlib freetype-devel gd-devel gd gd-progs glib2-devel gcc gcc-c++ libjpeg-devel libpng-devel
2. Download and untar latest stable release of PerfParse http://sourceforge.net/project/showfiles.php?group_id=109355 (e.g.)
- cd /tmp
- wget http://superb-east.dl.sourceforge.net/sourceforge/perfparse/perfparse-0.106.1.tar.gz
- tar zxfv perfparse-0.106.1.tar.gz
3. cd in the perfParse Directory.
- cd perfparse-0.106.1
4. Now compile with the following flag:
./configure --prefix=/etc/nagios/perfparse --with-imagedir=/usr/share/nagios/images --with-cgidir=/usr/lib/nagios/cgi --with-http_image_path=/usr/share/nagios/images --with-glib12=/usr/lib/glib
- make & make install (if not work, then "yum install gcc gcc-c++")
- make install clean (optional)
6.Now lets start configuring PerfParse to work with nagios
cp /etc/nagios/perfparse/etc/perfparse.cfg-sample /etc/nagios/perfparse/etc/perfparse.cfg cp /etc/nagios/perfparse/bin/perfparse.sh-example /etc/nagios/perfparse/bin/perfparse.sh mysql_create.sql | mysql -u perfparse -p -D perfparse
7. Edit /etc/nagios.cfg and make it look like this:
process_performance_data=1 host_perfdata_command=process-host-perfdata service_perfdata_command=process-service-perfdata
8. Include PerfData into your resources:
echo "$USER2$=/etc/nagios/perfparse" >> /etc/nagios/Resource.cfg
9. Define the perfData command
echo "
define command{
command_name process-service-perfdata
command_line /etc/nagios/perfparse/bin/perfparse_nagios_pipe_command.pl /var/log/nagios/perfdata-service.log "$TIMET$" "$HOSTNAME$" "$SERVICEDESC$" "$SERVICEOUTPUT$" "$SERVICESTATE$" "$SERVICEPERFDATA$"
}
define command{
command_name process-host-perfdata
command_line /etc/nagios/perfparse/bin/perfparse_nagios_pipe_command.pl /var/log/nagios/perfdata-host.log "$TIMET$" "$HOSTNAME$" "$HOSTOUTPUT$" "$HOSTPERFDATA$"
}" >> /etc/nagios/Misccommands.cfg
10. Edit your perfParse.cfg to make it look like below.
Server_Port = "3306" Service_Log = " | /var/log/nagios/perfdata-service.log" Service_Log_Position_Mark_Path = "/var/log/nagios/" Error_Log = "/var/log/nagios/perfparse.log" Error_Log_Rotate = "Yes" Error_Log_Keep_N_Days = "7" Drop_File = "/var/log/nagios/perfparse.drop" Drop_File_Rotate = "Yes" Drop_File_Keep_N_Days = "7" Lock_File = "/var/lock/perfparse.lock" Show_Status_Bar = "Yes" 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 = "/var/log/nagios/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 = "3306" Use_Storage_Mysql = "Yes" No_Raw_Data = "No" No_Bin_Data = "No" DB_User = "perfparse" DB_Pass = "perfparse" DB_Name = "perfparse" DB_Host = "localhost" Dummy_Hostname = "dummy" Storage_Modules_Load = "mysql"
Misc notes:
perfparsed-storage.o(.text+0x7e3): In function `storage_periodic_cleanup': /tmp/perfparse-0.106.1/perfparse/storage.c:269: undefined reference to `g_path_get_basename'

