Loading...
 
Example for configing and installing with Method 4

Example for configuration with a pipe

Alex Peeters had kindly provided an example of installing PerfParse with Method 4. As follows.
January 2005.



# wget
ftp://sunfreeware.scarlet.be/pub/freeware/sparc/9/pkgconfig-0.15.0-sol9-sparc-local.gz
# gzip -d pkgconfig-0.15.0-sol9-sparc-local.gz
# pkgadd -d pkgconfig-0.15.0-sol9-sparc-local

# wget
ftp://sunfreeware.scarlet.be/pub/freeware/sparc/9/glib-2.2.3-sol9-sparc-local.gz
# gzip -d glib-2.2.3-sol9-sparc-local.gz
# pkgadd -d glib-2.2.3-sol9-sparc-local

# wget
http://belnet.dl.sourceforge.net/sourceforge/perfparse/perfparse-0.104.9.tar.gz
# /usr/local/bin/tar -xvzf perfparse-0.104.9.tar.gz
# cd perfparse-0.104.9

# vi ./configure.sh
# ./configure --prefix=/opt/nagios --with-imagedir=/opt/nagios/share/images/
--with-cgidir=/opt/nagios/sbin --with-http_image_path=/nagios/images
--with-db=mysql --with-mysql_config_dir=/usr/local/mysql/bin #
--disable-shared
# make
# chown -R nagios.nagios *
# make install-strip
# chown -R nagios.nagios /opt/nagios/*/*perf*

# /usr/local/mysql/bin/mysql -u root -p
# mysql> create database perfparse

# cat scripts/mysql_create.sql | /usr/local/mysql/bin/mysql -u root -p -D perfparse

# 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


# vi /opt/nagios/etc/resource.cfg
# Sets $USER2$ to be the path to perfparse
$USER2$=/opt/nagios


# vi /opt/nagios/etc/misccommands.cfg
comment out the following definitions for host and service performance data:

define command{
command_name process-host-perfdata
...
}

define command{
command_name process-service-perfdata
...
}


# vi /opt/nagios/etc/nagios_perfparse.cfg
replace
perfparse_nagios_command.pl
with
perfparse_nagios_pipe_command.pl

# cp /opt/nagios/etc/perfparse.cfg.example /opt/nagios/etc/perfparse.cfg

# vi /opt/nagios/etc/perfparse.cfg
Service_Log = "|/opt/nagios/var/perfdata-service.log"
Service_Log_Position_Mark_Path = "/opt/nagios/var"

replace
No_Raw_Data = "yes"
No_Bin_Data = "yes"
with
No_Raw_Data = "no"
No_Bin_Data = "no"

# Database Authentication
DB_User = "nagios"
DB_Name = "perfparse"
DB_Pass = "nagios"
DB_Host = "localhost"

# /opt/nagios/bin/perfparsed --show_config


To view the your PerfParse graphs, use the same url path as Nagios
(http://localhost/nagios/cgi-bin by default) and add /perfparse.cgi at the
end.

You can also add a PerfParse link to the Nagios side menu by inserting the
following lines of code in /opt/nagios/share/side.html:
# vi /opt/nagios/share/side.html
<tr>
<td width=13>
<img src="images/greendot.gif" width="13" height="14" name
="perfparse-dot">
</td>
<td nowrap>
<a href="/nagios/cgi-bin/perfparse.cgi?all_bin=1" target="main"
onMouseOver="switchdot('perfparse-dot',1)" onMouseOut="switchdot
('perfparse-dot',0)" class="NavBarItem">PerfData Graphs</a>
</td>
</tr>


Then create a Nagios command to run perfparse-log2mysql every time a log is
generated.

# vi perfparse_nagios_pipe_command.pl
add at the end...
system ('/opt/nagios/bin/perfparse-log2mysql --serviceperf-log
/opt/nagios/var/perfdata-service.log');

Permissions for "perfdata-service.log" need to be set as nagios daemon can
write to the FIFO.
# touch /opt/nagios/var/perfdata-service.log
# chown nagios.nagios /opt/nagios/var/perfdata-service.log
# chmod 660 perfdata-service.log

# touch /opt/nagios/var/perfdata_log.perfdata-service.log.mark
# chown nagios.nagios
/opt/nagios/var/perfdata_log.perfdata-service.log.mark
# chmod 660 perfdata_log.perfdata-service.log.mark

# vi /var/spool/cron/crontabs/root
# Purge PerfParse DB daily at 3 AM.
0 1 * * * /opt/nagios/bin/perfparse-db-purge

# ps -ef | grep cron
root <number> 1 0 Jan 26 ? 0:00 /usr/sbin/cron
# kill -HUP <number>


Performance Data Nagios:
http://nagios.sourceforge.net/docs/1_0/perfdata.html

Installation Guide PerfParse:
http://perfparse.sourceforge.net/docs.php

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# If you made it this far, mission accomplished!
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-- Alex


Contributors to this page: spotless01 .
Page last modified on Tuesday 22 of February, 2005 20:13:29 UTC by spotless01.

Shoutbox

redflo, 14:25 UTC, Sun 10 of Apr, 2005: No, lneuxyuhje, this shall write to a pipe not to a file and so ">" is o.k.
lneuxyuhje, 15:14 UTC, Thu 07 of Apr, 2005: is ">" meant to be ">>" in /usr/local/perfparse/bin/perfparse_nagios_pipe_command.pl ?
redflo, 08:35 UTC, Tue 05 of Apr, 2005: fhdplbvjipsld, it works now. Permissions were wrong.
fhdplbvjipsld, 14:42 UTC, Wed 30 of Mar, 2005: How to post to Forums->Help?
benclewett, 09:27 UTC, Thu 03 of Feb, 2005: Hi Jon! I hope you like our wiki site.