Nagiosgraph..error

Im trying to set-up nagiosgraph, i think i installed everything the right way
I installed RRDtool with yum, and i see its having trouble with RRD so maybe i did something wrong there

[root@nagios nagiosgraph]# ./insert.pl
Can’t locate loadable object for module RRDs in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./insert.pl line 9
Compilation failed in require at ./insert.pl line 9.
BEGIN failed–compilation aborted at ./insert.pl line 9.

thats the message i get when i try to do ./insert.pl

also when i check to see if any data is being written to perfdata.log (i created this file i couldnt find it)
no data is being written there

tail -f /var/opt/nagios/perfdata.log

nagiosgraph.conf

Debug levels

0 = None

1 = Critical

2 = Error

3 = Warn

4 = Info

5 = Debug

debug = 5

Location of debug log file

logfile = /var/opt/nagiosgraph/nagiosgraph.log

Directory to store rrd database files

rrddir = /var/opt/nagiosgraph/rrd

File containing regular expressions to identify service and perf data

mapfile = /opt/nagiosgraph/map

Color scheme for graphs. Choose a number between 1 and 8.

colorscheme = 1

Heartbeat. In seconds, twice the size of servicecheck intervals

heartbeat = 600

Location of performance data log file. Comment out it not used.

perflog = /var/opt/nagios/perfdata.log

Stylesheet - added to head of show.cgi. Comment out if not used

stylesheet = /nagios/stylesheets/nagiosgraph.css

RRAs resolution (optional, don’t touch if you don’t know what you are doing)

#resolution = 17280 17520 32850 1095

Organization of rrd files

_ = single character separator for all files in same dir

subdir = files in subdirectory structure with “___” separator

dbseparator = subdir

Plot form (LINE1…LINE3, AREA, TICK)

plotas = LINE2

Graphs to show in every page (day, week, month, quarter, year)

time = day week month year

you need to have the “RRDp.pm” library installed somewhere; and this somwhere must be specified by the line “use lib qw” at the begining of insert.pl

ah thanks :smiley:

./insert.pl works now !

Ok i got the site to show the data, but i notice that the data stop enrolling.

So im seeing a page with graphs but the data is from before 12:00 pm (its now 14:03)

Cant seem to find why it stopped :S

i noticed that insert.pl isnt making the rrd files…but i gives no error when i do ./insert.pl

Format in perfdata.log
[SERVICEPERFDATA] 1221063937 blaak-ts02 Terminal Services 0.133 0.176 termservice: Started

but when i use ./insert.pl

Nagiosgraph.log
Wed Sep 10 15:23:47 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input hostname:
Wed Sep 10 15:23:47 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input perfdata:
Wed Sep 10 15:23:47 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input servicedescr:
Wed Sep 10 15:23:47 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input output:
Wed Sep 10 15:23:47 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ warn - perfdata not recognized
Wed Sep 10 15:23:47 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ debug - nagiosgraph exited

So anyone has an idea what im doing wrong ?

Yep:
the line “warn - perfdata not recognized” means that the data sent to nagiosgraph (through insert.pl) is not recognized by the parser - ie: the “map” file

BUT, the thing is, from these lines:
Wed Sep 10 15:23:47 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input hostname:
Wed Sep 10 15:23:47 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input perfdata:
Wed Sep 10 15:23:47 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input servicedescr:
Wed Sep 10 15:23:47 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input output:

we can see that nothing is sent to nagiosgraph.

To compare, here is an extract of my logfile:
Wed Sep 10 16:11:23 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ debug - nagiosgraph spawned
Wed Sep 10 16:11:23 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ debug - processing perfdata: 1221055881||webmail.9services.com||Webmail||WebInject OK - All tests passed successfully in 0.412 seconds||time=0.412;;;0
Wed Sep 10 16:11:23 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input lastcheck:1221055881

Wed Sep 10 16:11:23 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input hostname:webmail.9services.com
Wed Sep 10 16:11:23 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input perfdata:time=0.412;;;0
Wed Sep 10 16:11:23 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input servicedescr:Webmail
Wed Sep 10 16:11:23 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - Input output:WebInject OK - All tests passed successfully in 0.412 seconds
Wed Sep 10 16:11:23 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ debug - Checking /nagios_dsi_sup/nagiosgraph/rrd/webmail.9services.com/Webmail___WebInject.rrd
Wed Sep 10 16:11:23 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - RRDs::update /nagios_dsi_sup/nagiosgraph/rrd/webmail.9services.com/Webmail___WebInject.rrd 1221055881:0.412
Wed Sep 10 16:11:23 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ debug - nagiosgraph exited

You should check your “process-service-perfdata” command definition
Here is mine:
define command{
command_name process-service-perfdata
command_line /appli/nagios/nagiosgraph/insert.pl “$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$”
}

Hope this helps

Yes, thank you that did the job.

But the fun thing is…now it doenst run automatticlly anymore -_-

Yeah…fun times

Any idea what im doing wrong ?

When my command line is wrong it gives me an error because it tries to run it but it cant

But when my command line is correct it doesnt update my rrd files :?

well… this should never happen :slight_smile:

what does it say in the nagiosgraph.log ?
and is your map file updated and correct ?

Nagiosgraph.log just stays the same.
RRD files arent updated

Nagios just doenst run the script.

But like i said, when my command line isnt correct it seems that it does try to run it because i can see this error:
[09-10-2008 09:38:15] Warning: Attempting to execute the command “/usr/local/nagios/etc/nagiosgraph/insert.pl $LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$” resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists…

But when i correct the command line to:
define command{
command_name process-service-perfdata
command_line /usr/local/nagios/etc/nagiosgraph/insert.pl
}

it seems like it just doenst run at all…

When i manually try to run insert.pl it updates everything

Nagiosgraph folder
[root@nagios nagiosgraph]# ls -l
total 19496
-rwxrwxr-x 1 nagios nagcmd 6560 Sep 9 11:45 insert.pl
-rw-r–r-- 1 root root 7082 Sep 9 09:25 map
-rw-r–r-- 1 root root 1445 Sep 9 12:35 nagiosgraph.conf
-rwxrwxr-x 1 nagios nagcmd 19869458 Sep 12 08:25 nagiosgraph.log
drwxr-xr-x 36 root root 4096 Sep 11 14:20 rrd
-rwxr-xr-x 1 root root 16393 Sep 9 09:26 show.cgi

Maybe something wrong with my right or something ?

Ok; the good thing is that you have identified your error :slight_smile: you’ll just have to solve it now …

From what I can see, this is likely to be a rights error: your nagiosgraph dir is quite a mess concerning the rights :slight_smile:
I think you should change the owner of the files to nagios (chown -R nagios:nagcmd *).
and if it’s still not working, I had to give all the rights on all the files in this dir for nagiosgraph to work (chmod -R 777 *) … yes, I know it’s definitely not the best way, but at least, it’s working :slight_smile:

Hope this solves this problem…

That did the trick :slight_smile:

Thanks allot for your help