| Languages: |
English • Deutsch |
This page will outline how to install and configure NagiosGrapher.
|
What you need?
apt-get install autoconf rrdtool perl perl-base perl-modules libcalendar-simple-perl \
libgd-gd2-perl perlmagick librrds-perl liburi-perl
wget "http://LINK-URL" -O NagiosGrapher-x.x.x.tar.gz
Save the source code on your Nagios-Server in the /usr/local/src directory.
tar xzvf NagiosGrapher-x.x.x.tar.gz
cd NagiosGrapher-x.x.x
autoconf
./configure
# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking for gawk... no checking for mawk... mawk checking for perl... /usr/bin/perl checking distribution... found debian checking for layout... debian checking layout: directory prefix... set to '/usr/local/nagios' checking for init_scripts/nagios_grapher.debian... yes checking if user www-data exists... found checking if group www-data exists... found configure: creating ./config.status config.status: creating Makefile config.status: creating bin/collect2.pl config.status: creating bin/fifo_write.pl config.status: creating lib/NagiosGrapher.pm config.status: creating lib/NagiosGrapher/HTML.pm config.status: creating lib/NagiosGrapher/Hooks/Generic.pm config.status: creating lib/NagiosGrapher/Hooks/SrvExtWriteHostextInfo.pm config.status: creating sbin/graphs.cgi config.status: creating sbin/rrd2-graph.cgi config.status: creating sbin/rrd2-system.cgi config.status: creating nagios_grapher config.status: creating cfg/ngraph.ncfg config.status: creating cfg/logrotate/nagios_grapher
checking distribution... found debian checking for layout... debian checking layout: directory prefix... set to '/usr/local/nagios' checking for init_scripts/nagios_grapher.debian... yes
Do you have another distribution? you can take a look in the file config.layout in the source folder
If you don't find your distribution there or you have another nagios configuration, please edit the config.layout file.
and send the developers your layout
make testdeps
/usr/bin/perl ./tools/testdeps.pl Checking Data::Dumper ... found Checking File::Copy ... found Checking File::Basename ... found Checking Carp ... found Checking POSIX ... found Checking Time::HiRes ... found Checking Time::Local ... found Checking Storable ... found Checking GD ... found Checking Image::Magick ... found Checking RRDs ... found Checking CGI ... found Checking CGI::Carp ... found Checking IO::Handle ... found Checking URI::Escape ... found Checking Calendar::Simple ... found
make install
to upgrade an existing installation you need make update
interface file perffile_path /usr/local/nagios/var
cfg_dir=/usr/local/nagios/etc/serviceext process_performance_data=1 service_perfdata_file=/usr/local/nagios/var/service-perfdata service_perfdata_file_template=$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\t$TIMET$\n service_perfdata_file_mode=a service_perfdata_file_processing_interval=30 service_perfdata_file_processing_command=process-service-perfdata-file
define command{
command_name process-service-perfdata-file
command_line mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/service-perfdata.$TIMET$
}
This is an example:
cp ./ngraph.d/templates/standard/check_ping.ncfg_disabled ./ngraph.d/check_ping.ncfg
PING OK - Packet loss = 0%, RTA = 25.91 ms
#---
#NagiosGrapherTemplateforcheck_ping
#Author:MariusHein
#---
define ngraph{
service_name PING
graph_log_regex loss = (\d+)
graph_value Loss
graph_units %
graph_legend Loss
graph_legend_eol none
page 2 Loss
rrd_plottype LINE2
rrd_color ff0000
}
#PingDEFRTA
define ngraph{
service_name PING
graph_log_regex rta = (\d+[,\.]\d+)
graph_value RTA
graph_units ms
graph_legend RTA
page 1 RTA
rrd_plottype AREA
rrd_color 00a000
}
#PingVDEF,AverageRTA
define ngraph{
service_name PING
type VDEF
graph_value vdef_ping_average
graph_units
graph_legend RTA Average
graph_calc RTA,AVERAGE
graph_legend_eol LEFT
page 1 RTA
rrd_plottype LINE1
rrd_color 0000ff
hide no
}
/etc/init.d/nagiosgrapher stop /etc/init.d/nagiosgrapher start
/etc/init.d/nagios reload
The Grapher icon will not be displayed in the Nagios interface until a check for the service has been processed, FOLLOWED BY a reload of the Nagios process itself.
If you want to compare graphs of several services, Multigraphs are the way to go. Using the ping example above, we have the round-trip value (RTA) and packet-loss for each host we are pinging.
If you want to compare the RTA of several hosts. Here is a template from nmgraph.ncfg
define nmgraph{
host_name * Multigraphen
service_name All Ping RTA
# RegEX
hosts .*?
# RegEX
services PING
# This matches 'graph_value' from the ngraph definition
graph_values RTA
# line or stack or area
graph_type LINE1
# normal or reverse or leave blank
order reverse
colors ff8000, 00ff00, 0000ff,000000,ff0000
}