Nagiosgraph installation

Hi, I want to use nagiosgraph and I have followed this guide to install it novell.com/coolsolutions/feature/19843.html I get to part 7 where it looks for the rrd file. Also the perfdata.log is missing. Can anyone help me out?

Thanks
Andy

Hi!

well, in my install, I just commented out the line defining perfdata.log, as it is useless (I don’t even know it should do :))
so just comment it and go on :wink:

How about part 7 where it looks for the rrd file? That is the main problem.

Well,

I’ve read part 7…and I don’t like this guide :slight_smile:

anyway, this guide assumes that you have some “check_load” services. (ie: some services that will output " OK - load average: 2.81, 2.76, 2.86").
=> do you have a few of these in your nagios conf ?

Also, the best way I found to make sure that nagios is sending data to nagiosgraph is to set the “debug” option in “nagiosgraph.conf” to 5
=> each time a data is sent to nagiosgrah, nagiosgraph will log something (preferably almost unreadable) in nagiosgraph.log
So make sure the log file is increasing (be CAREFULL though: it can increase very rapidly, depending on how many services you have). If nagiosgraph.log remains empty, it means that there is an error in the steps before 7 :slight_smile:

btw: "How about part 7 where it looks for the rrd file? That is the main problem. " => the rrd file is the product of the data parsed by nagiosgraph. It is created whenever a data is sent to nagiosgraph and is re-cognized by the map file (see section 9).

Hope this helps a little bit :slight_smile:

Thanks for that part, but I couldnt get it to work still. Is there another easier guide for this? I have very little linux knowlledge so I had to learn all of this when my manager asked me to do this project.

well… I’m sorry, but I can’t really help you further: the nagiosgraph install was not done by myself, so I didn’t have to go through all the steps you are in now…

I just know how to make it work on our servers :confused:

Just to know:
-has your nagiosgraph.log increased ? (after setting debug to “5”)
-if not => try running insert.pl in command line, without any arguments => has your nagiosgraph.log file changed ?
=> if no => what happened ? any errors written ? => try to correct that :slight_smile:
=> if yes => it means nagios is not sending perf data to nagiosgraph as expected. Check that:

-process_perf_data is set to 1 for the services you want to graph
-process_performance_data is set to 1 in nagios.cfg
-service_perfdata_command is set to something (and un-commented); “process-service-perfdata” by default
-“process-service-perfdata” has a definition that launches insert.pl.

These are the basics checks you can do.
Once the nagiosgraph.log file is being incremented, you’ll be able to go to section 8 or 9 of your guide :slight_smile:

Hello,

I have been trying to make this work but some reason it does not work. I followed all the steps in andyng followed with having mind from loose recommendation.

Now I can see the icon on service but when i click on that icon it complains like this.

The requested URL /nagios/cgi-bin/url was not found on this server.

I tried to look /cgi-bin under nagios i could not locate. tips on workaround on this would be great help

My files structure are like this:
Nagios is installed as /usr/local/nagios
insert.pl, map, nagiosgraph.conf, show.cgi are in /usr/local/nagios
and nagiosgraph directory is under /usr/local/nagios
and inside /usr/local/nagios/nagiosgraph
nagiosgraph.log
rrd directory

file structure are adjusted in relevant files.

MAdal

Well, I’d say this problem comes from the definitions in your extinfo files. Could you post them ?

Also, have your tried to access directly this url:
your_server/nagiosgraph/show.cgi ?

that should work.
If not, check the contents of the show.cgi file (there may be some changes to do).
check also your apache configuration (point 6 of the guide).

don’t hesitate to post some parts of your config files

btw:
your /cgi-bin is a link to the nagios-inst-dir/sbin directory (this is done via the apache conf)

loose,

I re-check the steps you mentioned. no I get the same error with directly opening show.cgi.
here is my cgi.conf file part :
se strict;
use RRDs;
use CGI qw/:standard/;
use Fcntl ‘:flock’;
use File::Find;

Configuration

my $configfile = ‘/usr/local/etc/nagios/nagiosgraph.conf’;

Main program - change nothing below

and /etc/http/conf.d/nagiosgraph.conf
criptAlias /nagiosgraph/ /usr/local/nagios/nagiosgraph/

<Directory “/usr/local/nagios/nagiosgraph”>

SSLRequireSSL

Options None
AllowOverride None
Order allow,deny
Allow from all

Order deny,allow

Deny from all

Allow from 127.0.0.1

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

I must be missing very minor thing somewhere

PS: which section I should look into http.conf file for cig-bin stuff ?

And my serviceextenion info looks like this

define serviceextinfo{
host_name localhost
service_description Current Load
notes_url /usr/local/nagios/nagiosgraph/show.cgi?host=$HOSTNAME$&service=$ SERVICEDESC$&db=load,avg1min,avg5min,avg15min&geom=500x100&rrdopts=%2Dl%200%20%2Du %
2010%20%2Dt%20CPU%2DLoad
}

I still get the same thing : The requested URL /nagios/cgi-bin/url was not found on this server.

MAdal

Well, sorry, but I’m a bit unsure of what you copy/pasted above :confused:

Could re-post it with the right file names (I don’t know any cgi.conf file), because it seems a little bit strange, so, either:
-you’ve done everything well
-or you’ve done a bit of a mess :slight_smile:

anyway, the way I did is a bit different:
I used the same apache as my nagios install.
That means that I just added
ScriptAlias /nagiosgraph/ /usr/local/nagios/nagiosgraph/

<Directory “/usr/local/nagios/nagiosgraph”>

SSLRequireSSL

Options None
AllowOverride None
Order allow,deny
Allow from all

Order deny,allow

Deny from all

Allow from 127.0.0.1

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

to my httpd.conf file of my apache that is hosting my nagios web interface;
this way is a bit simpler (just 1 apache process for both nagios and nagiosgraph).

btw: in the same file I’m talking above, you can find the cgi-bin defined (in the ScriptAlias section).

Okay! sorry –

Nagios installed in /usr/local/nagios
For nagios graph : /usr/local/nagios/nagiosgraph
Inside nagios graph are following files:
insert.pl
map
nagiosgraph.conf
nagiosgraph.log
rrd – this is directory
show.cgi

In show.cgi file I change according to the file location, like this

Configuration

my $configfile = ‘/usr/local/nagios/nagiosgraph/nagiosgraph.conf’;

And insert.pl change with right file order:

Configuration

my $configfile = ‘/usr/local/nagios/nagiosgraph/nagiosgraph.conf’;

And nagiosgraph.conf made relevant changes as:

Location of debug log file

logfile = /usr/local/nagios/nagiosgraph/nagiosgraph.log

Directory to store rrd database files

rrddir = /usr/local/nagios/nagiosgraph/rrd

File containing regular expressions to identify service and perf data

mapfile = /usr/local/nagios/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/spool/nagios/perfdata.log

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

stylesheet = /nagios/stylesheets/nagiosgraph.css

And added file nagiosgraph.conf in /etc/http/conf.d/nagiosgraph.conf

In which the content as :

ScriptAlias /nagiosgraph/ /usr/local/nagios/nagiosgraph/

<Directory “/usr/local/nagios/nagiosgraph”>

SSLRequireSSL

Options None
AllowOverride None
Order allow,deny
Allow from all

Order deny,allow

Deny from all

Allow from 127.0.0.1

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

After all changes restarted httpd and nagios Hope this is much clear now. am i missing anything else ?

PS: I try to run insert.pl in commandline without any argument as you mentioned. I do not see nagiosgraph.log increasing at all and don

great :slight_smile:
it’s a bit clearer now ^^

Firstly, before running insert.pl in command line (without args), you should set “debug = 5” in your nagiosgraph.conf file
This way, it will log everything.
So now, the log file should be increasing (which is good!). Don’t forget to put “debug” to 2 afterwards, if you don’t want to end up with a enormous file :slight_smile:

As for the apache configuration, I don’t know if what you did should work or not, but here is what I did:
everything you have in your /etc/http/conf.d/nagiosgraph.conf is in my /etc/http/conf/httpd.conf (you just have to put it in the same ScriptAlias section as the cgi-bin def).
Then restart apache and pray; it might be worth a try
(to test it, just try to access your_address/nagiosgraph/show.cgi ; if it’s working, you’re on the right tracks…if not … i don’t know what to do :confused: except trying to find another guide)

note: later on, I might find some time to translate the guide I and my colleague wrote to install nagiosgraph…but right now, I’m too busy :frowning:

loose,

Thanks. I just copied whole my nagiosgraph.conf and added in /etc/http/conf/httpd.conf file in scriptAlias section. I also commented the existing one. Here is what i did in /etc/httpd/conf/httpd.conf

#ScriptAlias /cgi-bin/ “/var/www/cgi-bin/”

ScriptAlias /nagiosgraph/ /usr/local/nagios/nagiosgraph/

<Directory “/usr/local/nagios/nagiosgraph”>

SSLRequireSSL

Options None
AllowOverride None
Order allow,deny
Allow from all

Order deny,allow

Deny from all

Allow from 127.0.0.1

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user

#<Directory “/var/www/cgi-bin”>

AllowOverride None

Options None

Order allow,deny

Allow from all

#

When I re-started httpd service it complain warning like this :
it overlaps an earlier ScriptAlias.

Am i missing something or not following the steps properly. This must be something to do with cgi

PS: after adding debug level 5 it started writing in nagiosgraph.log file - but i changed to debug level 2.

M

Can you post your apache conf ? I tried here and there but still no luck !!

M

oups, my mistake …
I just have the line “ScriptAlias /nagiosgraph/ /usr/local/nagios/nagiosgraph/” in my apache conf file (not the rest: <Directory …), as the rest is useless:

ScriptAlias /cgi-bin/ “/appli/svptools/apache2-nagios/cgi-bin/”
#ScriptAlias /nagios/cgi-bin/ /appli/nagios/sbin/
ScriptAlias /nagios/cgi-bin/ /appli/nagios/nagios/sbin/
ScriptAlias /nagiosgraph/ /appli/nagios/nagiosgraph/

# # Additional to mod_cgid.c settings, mod_cgid has Scriptsock # for setting UNIX socket for communicating with cgid. # #Scriptsock logs/cgisock

“/appli/svptools/apache2-nagios/cgi-bin” should be changed to whatever your ScriptAliased

CGI directory exists, if you have that configured.

<Directory “/appli/svptools/apache2-nagios/cgi-bin”>
AllowOverride None
Options None
Order allow,deny
Allow from all

<Directory “/appli/nagios/nagios/sbin/”>
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /appli/nagios/apache2-nagios/.htpasswd
Require valid-user

Alias /nagios/ /appli/nagios/nagios/share/
<Directory “/appli/nagios/nagios/share”>
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /appli/nagios/apache2-nagios/.htpasswd
Require valid-user

hello loose.

I m progressing a bit. looks like now i am on track. but this is the error i get when i click on the graph icon.

“Nagiosgraph has detected an error in the configuration file: /usr/local/nagios/nagiosgraph/nagiosgraph.conf”

yes rrd directory is empty. is this something I need to generate ?

now also when I run the insert.pl in command line without argument it returns “config file not found”

M
Looks like /usr/local/nagios/nagiosgraph/rrd is empty!

the fact that your rrd directory is empty is “normal”: it will be written in when insert.pl will be launched with the right arguments (ie: arguments that will be used by the map file).

So, don’t worry right now about it :slight_smile:
Your priority is to get insert.pl working ^^ it shouldn’t output anything when you launch it in command line without any arguments (and as I said: the log file should be increased if you set debug to 5).

All in all, it seems you’ve got a problem with your config file (yeah, that was hard to guess :)). Check your paths and the contents of this config file (and the permissions on it).

Now i fixed insert.pl, yes when it run in command line it did not result any output. and setting debug level 5 , running insert.pl nagiosgraph.log file increased. restarted the httpd and nagios. but it still doesn

Great :slight_smile:

now that insert.pl is working, you’ll have to configure the file named “map”; that’s part 9 of the guide.
The guide seems quite good on the subject, so I think you’ll be able to go through with it.

But, I have to warn you about 2 things on the subject:

  1. you have to make sure that nagios is correctly sending the perf data to insert.pl; it is done via:
    define command{
    command_name process-service-perfdata
    command_line /appli/nagios/nagiosgraph/insert.pl “$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$”
    }

(that’s mine :))
So make sure the whole perf data chain is correctly set up.
=> the best way to ensure that is to let nagios run, and let the debug option set to 5. If you have at least a few tests done by nagios, the log file should be increasing (quite quickly, btw). If not, it means that nagios is NOT sending any info to insert.pl, so you’ll have to solve this problem first (if you can’t manage to do it, don’t hesitate to post some relevant parts of your config files). In short, make sure you have “process_performance_data=1” in your nagios.cfg, as well as “service_perfdata_command=process-service-perfdata”.
Make sure you have a process-service-perfdata command defined (as mine above). Also, check that you have the option “process_perf_data” set to 1 for every service you want graphed.

So, let’s assume nagios is sending the perf data to insert.pl, that means you have to configure the map file => the guide will help you.
BUT, the problem is that it is really hard to configure, in the sense that it is really really really easy to do some mistakes (as it uses regular expressions…). So, take your time, and check your nagiosgraph.log file often: it will tell you (in ways you won’t understand easily if the data received maps the map file or not).

Good luck :wink:

hello there,

been away - now back to business with nagios graph. this still has not work. I still have following issue. increasing debug level 5 and running insert.pl without any argument nagiosgraph.log writes some lines like this >
Thu Sep 11 09:11:21 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - No inputdata. Exiting.
Thu Sep 11 09:13:06 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ debug - nagiosgraph spawned
Thu Sep 11 09:13:06 2008 $RCSfile: insert.pl,v $ $Revision: 1.25 $ info - No inputdata. Exiting.

Then I changed back to level 2 and try in web browser it still says like Looks like
Nagiosgraph has detected an error in the configuration file: /usr/local/nagios/nagiosgraph/nagiosgraph.conf
Looks like /usr/local/nagios/nagiosgraph/rrd is empty! /usr/local/nagios/nagiosgraph/rrd is empty!

Here is my nagiosgraph.conf file looks like

Debug levels

0 = None

1 = Critical

2 = Error

3 = Warn

4 = Info

5 = Debug

debug = 2

Location of debug log file

#logfile = /var/log/nagiosgraph.log

logfile = /usr/local/nagios/nagiosgraph/nagiosgraph.log

Directory to store rrd database files

rrddir = /usr/local/nagios/nagiosgraph/rrd

File containing regular expressions to identify service and perf data

mapfile = /usr/local/nagios/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 = /usr/local/nagios/nagisgraph/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

Am i missing anything. I followed all the advise in this thread. I am going nowhere.

M