Webui not displaying properly

Have installed Nagios3.2 on a Ubuntu8.04 server following the install guide at ubuntugeek.com/nagios-networ … buntu.html. All went well and seemed to install painlessly.
When I carry out a preflight check using /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg I get no errors?


The login works and the home page displays and documentation. Any other option selected from the left hand side bar brings up an apache error page, Internal Server Error.

[attachment=0]nagios error page.jpg[/attachment]

There must be a permissions fault or apache2 miss config somewheres but for the life of me I cant find it.

Very puzzling, I have obviously missed something somewhere? Can any one suggest what? Any help much appreciated.

I’d have a look at the Error Log of your Apache and try to find, if there’s something mentioned.

There doesnt seem to be any errors in the apache error log relating to Nagios, but I have looked in the suexec.log and there are references there, sample below:

[2009-11-08 06:32:13]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: php5.fcgi
[2009-11-08 06:35:01]: uid: (1002/postrangers) gid: (1002/1002) cmd: php5.fcgi
[2009-11-08 08:53:10]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: tac.cgi
[2009-11-08 08:53:10]: command not in docroot (/usr/local/nagios/sbin/tac.cgi)
[2009-11-08 09:01:51]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: tac.cgi
[2009-11-08 09:01:51]: command not in docroot (/usr/local/nagios/sbin/tac.cgi)
[2009-11-08 09:01:53]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: statusmap.cgi
[2009-11-08 09:01:53]: command not in docroot (/usr/local/nagios/sbin/statusmap.cgi)
[2009-11-08 09:01:54]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi
[2009-11-08 09:01:54]: command not in docroot (/usr/local/nagios/sbin/status.cgi)
[2009-11-08 09:01:54]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi
[2009-11-08 09:01:54]: command not in docroot (/usr/local/nagios/sbin/status.cgi)
[2009-11-08 09:01:55]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi
[2009-11-08 09:01:55]: command not in docroot (/usr/local/nagios/sbin/status.cgi)
[2009-11-08 09:01:55]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi
[2009-11-08 09:01:55]: command not in docroot (/usr/local/nagios/sbin/status.cgi)
[2009-11-08 09:01:56]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi
[2009-11-08 09:01:56]: command not in docroot (/usr/local/nagios/sbin/status.cgi)
[2009-11-08 09:01:56]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi
[2009-11-08 09:01:56]: command not in docroot (/usr/local/nagios/sbin/status.cgi)
[2009-11-08 09:01:57]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi
[2009-11-08 09:01:57]: command not in docroot (/usr/local/nagios/sbin/status.cgi)
[2009-11-08 09:01:57]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi
[2009-11-08 09:01:57]: command not in docroot (/usr/local/nagios/sbin/status.cgi)
[2009-11-08 09:01:58]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi
[2009-11-08 09:01:58]: command not in docroot (/usr/local/nagios/sbin/status.cgi)
[2009-11-08 09:01:58]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi
[2009-11-08 09:01:58]: command not in docroot (/usr/local/nagios/sbin/status.cgi)
[2009-11-08 09:01:59]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: outages.cgi
[2009-11-08 09:01:59]: command not in docroot (/usr/local/nagios/sbin/outages.cgi)
[2009-11-08 09:02:00]: uid: (1001/berilacsshack) gid: (1001/1001) cmd: status.cgi

does that mean anything to any one? The cgi’s for nagios are in /usr/local/nagios/sbin

check the configure output, are you missing the GD libraries?

GD libraries are installed as far as I can tell.
Configuration tab just displays the same error as I posted earlier.
nagios user and group are there as is the nagioscmd.
There must be a webserver issue, although, why would it post the home page and documentation if there was?

i dont’ mean the configuration tab of the nagios interface.

I meant what is the output of the ./configure command when you install nagios?

Oops sorry luca, I misread what you meant.

Here is the last section of the results of ./config, there was nothing outstanding that I could see.


In the nagios log it does display this error:
[1257811200] CURRENT SERVICE STATE; …;HTTP;WARNING;HARD;4;HTTP WARNING: HTTP/1.1 403 Forbidden

From the rest of the enteries I guess nagios is working, but because of this webserver problem that is why nothing is being displayed in the gui.

Have also had a look at the checkresult:


wait. do you have that error on ANY nagios page or only on some of them?

What i was looking for is usually related only to some pages… :slight_smile:

The only pages that display properly are Home and Documentation, anything below current status displays that apache error page.
That has happened from the start when I have just left the sample configurations installed by the nagios install has been completed as they were. And when I have changed them to match my server set up. That is entering my IP address were 127.0.0.1 was and the name of sever to what it is. On either setting it wont display. those settings were altered to match in corresponding .cfg files but no good so I have set them back to the default as per install.
My nagios.cfg file is located in the /etc/apache2/conf.d folder as per installation, is that correct?

nagios.cfg in etc/apache2/conf.d??? where do the install docs say to put it there? :confused:
it should be in /usr/local/nagios/etc/objects

Oh bugger, my typing is awfull, sorry that should have been

My nagios.conf is in the /etc/apache2/conf.d folder as per the install. I take it it should be read from there? and not copied to sites/enabled or sites/available?

Sorry luca

weel, the nagios wepage is available, but there could be some problem in the cgi configuration part of the nagios.conf file…

How is the docroot defined in the nagios httpd conf file ?

Luca


There is the nagios.conf, there is nothing in my http.conf file

have a look at this thread on linuxquestions and see if any of those steps solves… linuxquestions.org/questions … ce-721463/

Thanks luca for your time and patience with this. I read that link, and yes it is the very same problem as described. The interesting bit was the permissions bit and the results from running the grep command;

grep authori cgi.cfg | grep -v ‘#’

authorized_for_system_information=nagiosadmin
authorized_for_configuration_information=nagiosadmini
authorized_for_system_commands=nagiosadmin
authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
authorized_for_all_service_commands=nagiosadmin
authorized_for_all_host_commands=nagiosadmin

That is exactly the results that come up when I run it. Um, is this possibly the reason for the errors? Do I need to alter those to point to nagios?

Also my default webserver doc root is not /var/www/ but /home would this make any difference? As the initial nagios home page displays I wouldnt have thought so.

It must be a permissions problem with the cgi’s. Have I got my nagios nagiosadmin and www-data users and groups set right I am wondering?

My users&groups are:

user nagios - 1004
group nagios - 1004 linked to groups www-data & nagios
group nagcmd - 1005

as it doesn’t work as intended i’m off to my usual last resource…

could you try installing as described in nagios.sourceforge.net/docs/3_0/ … edora.html

I just followed those instructions on my own system and it took me just something over 10 minutes (including solving a couple of dependencies)
Should you decide to do it, please first remove any modified config files, purge RPMs or whatever and see that yuou have no leftovers.

Thanks, Luca

thankyou luca, I will try that later.
Will apt-get remove --purge nagios3.2.0 do for removing the existing installation? Before I go and bugger up something else??

Got a 403 error on my 3 websites now so am having to look into this now DOH!

i think it’s “apt-get purge nagiosxxx” with nagiosxxx being the correct package name.

you’ll porbably have to check by hand to see if there’s some more files left over (those you hand edited could possibly remain behind)

Sorry about the delay, but just a quick update. Nagios is installed and working. Not sure what the problem was, but followed the ubuntu quide again and all is well. Only thing I can think of was I didnt carry out the steps were it mentioned ubuntu 6.06 and 7.10, might have skipped them thinking it wa sfor older versions.

Any way all is go only one error showing, many thanks luca for your support.

Just one quick question tho, how do you change the default settings for service checks if you have changed port numbers?

what service check? run the service check from command line with the --help option :slight_smile: