[Nagiosplug-help] Trouble with Nagiosgraph

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Wed Oct 10 15:00:07 CEST 2007


Hello List Subscribers,

first I need to apologize for my stupid question regarding the
millisec conversion in the map pushes
of Nagiosgraph.
I must have been brain dead when I issued this one.

Nevertheless, I still can't get Nagiosgraph get working in
creating and updating RRD files.

I think to have read carefully the INSTALL file of the
Nagiosgraph package and accordingly
adapted my configuration with regard to perfdata.

So the relevant sections of my nagios.cfg look like this:

# grep ^[^#] /etc/nagios/nagios.cfg|sed -n 58,63p
process_performance_data=1
service_perfdata_file=/var/spool/nagios/perf/service-perfdata
service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||$S
ERVICEDESC$||$SERVICEPERFDATA$
service_perfdata_file_mode=w
service_perfdata_file_processing_interval=30
service_perfdata_file_processing_command=process-service-perfdata
-file


As service_perfdata_file I chose a FIFO,
which I think was a mistake, because the nagios scheduler seems
to be blocked on an open
of the FIFO, presumably until another nagios child was reading
from the FIFO which actually never happens.

# ls -l /var/spool/nagios/perf/service-perfdata
prw-rw---- 1 nagios nagios 0 Sep 28 15:12
/var/spool/nagios/perf/service-perfdata

# strace -p $(pgrep -P1 -x nagios)
Process 26629 attached - interrupt to quit
open("/var/spool/nagios/perf/service-perfdata",
O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666
^C
666 <unfinished ...>
Process 26629 detached

The processing command is defined like this

# process service perfdata for nagiosgraph
define command {
        command_name    process-service-perfdata-file
        command_line    /usr/bin/perl
/usr/lib/nagios/nagiosgraph/insert.pl
}

As I understood fom the INSTALL instruction,
when one is running an embedded Perl Nagios
it is advised to prepend the command line with an explicit
invocation of the Perl interpreter.

As for the configurable parts in the Nagiosgraph Perl scripts I
have

# grep my\ \$configfile /usr/lib/nagios/nagiosgraph/insert.pl 
my $configfile = '/etc/nagios/nagiosgraph.conf';


And for nagiosgraph.conf itself I've got


# grep ^[^#] /etc/nagios/nagiosgraph.conf 
debug = 3
logfile = /var/log/nagios/nagiosgraph.log
rrddir =  /var/spool/nagios/rrd
mapfile = /usr/lib/nagios/nagiosgraph/map
colorscheme = 1
heartbeat = 600
perflog = /var/spool/nagios/perf/service-perfdata
stylesheet = /usr/share/nagios/html/stylesheets/nagiosgraph.css
dbseparator = subdir 
plotas = LINE2


The referred to files all exist and are writeable or executable
by user nagios,
as applicable.

# ls -l /var/log/nagios/nagiosgraph.log
/var/spool/nagios/perf/service-perfdata
/usr/lib/nagios/nagiosgraph/map 
-rwxr-xr-x 2 root   root    7664 Oct  3 00:07
/usr/lib/nagios/nagiosgraph/map
-rw-rw-r-- 1 nagios nagios 16905 Oct  3 00:07
/var/log/nagios/nagiosgraph.log
prw-rw---- 1 nagios nagios     0 Sep 28 15:12
/var/spool/nagios/perf/service-perfdata
 
# ls -ld /var/spool/nagios/rrd
drwxrwxr-x 2 nagios nagios 1024 Oct  2 14:58
/var/spool/nagios/rrd
 
# perl -cw /usr/lib/nagios/nagiosgraph/map
/usr/lib/nagios/nagiosgraph/map syntax OK






More information about the Help mailing list