Nagios Core 4.0.5: Internal Server Error after upgrade

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
DanielV_
Posts: 3
Joined: Tue Apr 15, 2014 2:19 am
Location: Netherlands

Nagios Core 4.0.5: Internal Server Error after upgrade

Post by DanielV_ »

Hello,

I hope someone can help me with my problem. I have Nagios running since version 3 and currently i'm running version 4.0.3. In the past all the upgrades went fine, using the upgrade method that is described in the nagios documentation.

Last month I tried to upgrade to version 4.0.4.. I have downloaded the .tar en extracted it, configured it with the commandgroup nagcmd, and installed it. Installation went fine and nagios was running smoothly, but whenever I tried to use the links/commands on the right side of the screen (For example: Reschedule check command) Nagios gives an Internal Server Error. So I tried to fix this issue, but I couldn't resolve it. I also did some research on the internet, but all of the given solutions are not working, so I reverted the installation back to version 4.0.3. (from a snapshot in VMware).

This week I tried to upgrade version 4.0.3. to version 4.0.5., but I'm having the same problem again. Can someone please help me with this problem?

When I try to reach https://nagios.domain.com/nagios/cgi-bin/cmd.cgi the page is displayed correctly. So it seems the permissions are correct.

Installed on system:
LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.2 (Final)
Release: 6.2
Codename: Final
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Core 4.0.5: Internal Server Error after upgrade

Post by tmcdonald »

Can you post the last 20 or so lines from your Apache error logs after you try to view the page?

Also, what Apache and PHP versions are you running?
Former Nagios employee
DanielV_
Posts: 3
Joined: Tue Apr 15, 2014 2:19 am
Location: Netherlands

Re: Nagios Core 4.0.5: Internal Server Error after upgrade

Post by DanielV_ »

Yes of course,

I'm getting a premature end of script headers error in the Apache logs:

Code: Select all

httpd_error_log:
[Mon Apr 14 12:48:12 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_wsgi/3.2 Python/2.6.6 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Tue Apr 15 16:15:08 2014] [error] [client 192.168.80.1] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /usr/local/nagios/share/index.php on line 53
[Tue Apr 15 16:15:08 2014] [error] [client 192.168.80.1] PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /usr/local/nagios/share/main.php on line 123, referer: http://192.168.80.129/nagios/
[Tue Apr 15 16:22:46 2014] [error] [client 192.168.80.1] Tue Apr 15 16:22:46 2014 showgraph.cgi critical Cannot write to '/var/log/nagiosgraph-cgi.log', using STDERR instead, referer: http://192.168.80.129/nagios/cgi-bin/status.cgi?host=ASA-Avaya&servicestatustypes=4&hoststatustypes=15&serviceprops=0&hostprops=0
[Tue Apr 15 16:22:49 2014] [error] [client 192.168.80.1] Premature end of script headers: cmd.cgi, referer: http://192.168.80.129/nagios/cgi-bin/cmd.cgi?cmd_typ=7&host=ASA-Avaya&service=ASA&force_check
[Tue Apr 15 16:22:53 2014] [error] [client 192.168.80.1] Tue Apr 15 16:22:53 2014 showgraph.cgi critical Cannot write to '/var/log/nagiosgraph-cgi.log', using STDERR instead, referer: http://192.168.80.129/nagios/cgi-bin/status.cgi?host=all&type=detail&servicestatustypes=4&hoststatustypes=3&serviceprops=42
[Tue Apr 15 16:22:53 2014] [error] [client 192.168.80.1] Tue Apr 15 16:22:53 2014 showgraph.cgi critical Cannot write to '/var/log/nagiosgraph-cgi.log', using STDERR instead, referer: http://192.168.80.129/nagios/cgi-bin/status.cgi?host=all&type=detail&servicestatustypes=4&hoststatustypes=3&serviceprops=42
[Tue Apr 15 16:22:55 2014] [error] [client 192.168.80.1] Premature end of script headers: cmd.cgi, referer: http://192.168.80.129/nagios/cgi-bin/cmd.cgi?cmd_typ=7&host=ASA-Avaya&service=ASA&force_check
[Tue Apr 15 16:23:01 2014] [error] [client 192.168.80.1] Premature end of script headers: cmd.cgi, referer: http://192.168.80.129/nagios/cgi-bin/cmd.cgi?cmd_typ=7&host=Linux_Views&service=Load&force_check
I'm using Apache/2.2.15 and PHP 5.3.3 (cli).

I think it's very strange this happens after the upgrade. All of the previous upgrade went all well.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core 4.0.5: Internal Server Error after upgrade

Post by lmiltchev »

Can you run the following commands and show us the output?

Code: Select all

ls -la /var/log/nagiosgraph-cgi.log
sestatus
Be sure to check out our Knowledgebase for helpful articles and solutions!
DanielV_
Posts: 3
Joined: Tue Apr 15, 2014 2:19 am
Location: Netherlands

Re: Nagios Core 4.0.5: Internal Server Error after upgrade

Post by DanielV_ »

SELinux is disabled. And it seems that the permissions are on root for nagiosgraph-cgi.log.

Code: Select all

[root@SRVNAGIOS01 nagios-4.0.5]# ls -la /var/log/nagiosgraph-cgi.log
-rwxr-xr-x 1 root root 0 Mar 17 13:21 /var/log/nagiosgraph-cgi.log
[root@SRVNAGIOS01 nagios-4.0.5]# sestatus
SELinux status:                 disabled
The old working installation of Nagios (4.0.3.) also has the same permission on this:

Code: Select all

[root@SRVNAGIOS01 ~]# ls -la /var/log/nagiosgraph-cgi.log
-rwxr-xr-x 1 root root 0 Mar 17 13:21 /var/log/nagiosgraph-cgi.log
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core 4.0.5: Internal Server Error after upgrade

Post by lmiltchev »

This doesn't seem to be a nagios issue, but nagiosgraph issue...

Have you tried changing the permissions of the log file to nagios:nagios?

Code: Select all

chown nagios:nagios /var/log/nagiosgraph-cgi.log
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked