Page 1 of 2

PDF Report error

Posted: Tue Sep 08, 2015 5:43 am
by gwijnant
Hi,

I just downloaded and installed Nagios XI to evaluate the monitoring software.
When trying to create a PDF report I get the following error in a pdf file:

Not Found
The requested URL /reports/availability.php was not found on this server.
Apache/2.2.15 (CentOS) Server at x.x.x.x Port 80

Can anyone give me atleas a clue on where to look?
I have searched this forum but nothing that can help me out (I dont think its a proxy issue).

Creating a report of CSV files works.

Best Regards,

Guy

Re: PDF Report error

Posted: Tue Sep 08, 2015 11:51 am
by tmcdonald
I assume you are running the latest version, but just to confirm can you please specify the XI version?

Also, do you see anything in /var/log/httpd/error_log when you try to run a PDF report?

Re: PDF Report error

Posted: Wed Sep 09, 2015 3:39 am
by gwijnant
Hi tmcdonald,

Here the requested info:

Version of nagios: Nagios XI 2014R2.7

The following appears in the error_log file:
[Wed Sep 09 10:37:07 2015] [error] [client 'server ip'] File does not exist: /var/www/html/reports

Best Regards,

Guy

Re: PDF Report error

Posted: Wed Sep 09, 2015 2:03 pm
by lmiltchev
Are you using/forcing SSL? Go to Admin->Manage System Config and post a screenshot of this page ("System Settings"). Also run:

Code: Select all

cat /etc/hosts
and show the output.

Re: PDF Report error

Posted: Fri Sep 11, 2015 4:01 am
by gwijnant
Hi,

Output of cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

In attachment you will find the screenshot

How can I check if I am using/forcing SSL? I have not changed any settings regarding this in my knowledge.

Re: PDF Report error

Posted: Fri Sep 11, 2015 12:15 pm
by lmiltchev
How can I check if I am using/forcing SSL? I have not changed any settings regarding this in my knowledge.
If you haven't change anything, you are not using SSL. Are you using an IP address or a FQDN in the "Program URL" field?

Example:

Code: Select all

http://192.168.0.5/nagiosxi/
vs

Code: Select all

http://myxiserver/nagiosxi/
You can try adding the hostname of your server to the "/etc/hosts" and see if this is going to fix your issue. See an example of how to do this here:

http://www.cyberciti.biz/faq/centos-hos ... mand-line/

Re: PDF Report error

Posted: Fri Sep 11, 2015 4:15 pm
by gwijnant
I am using an IP Address in the Program URL field.

I have also tried adding the hostname to the /etc/hosts file.

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
X.X.X.X cvlwrl
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

I restarted the network services after the change but still get the same error.

Re: PDF Report error

Posted: Mon Sep 14, 2015 10:31 am
by tmcdonald
Have you modified your Apache settings?

What does the following yield?

Code: Select all

grep -R "/var/www" /usr/local/nagiosxi/html
grep -R "/var/www" /etc/httpd/conf.d

Re: PDF Report error

Posted: Tue Sep 15, 2015 5:10 am
by gwijnant
I have not modified any Apache settings.

Requested output:
[root@cvlwrl ~]# grep -R "/var/www" /usr/local/nagiosxi/html
/usr/local/nagiosxi/html/config.inc.php: "dir" => "/var/www/html/nagiosql",
/usr/local/nagiosxi/html/includes/components/nagiosbpi/INSTALL: $file = '/var/www/http_public/nagiosbpi/api_tool.php';
[root@cvlwrl ~]# grep -R "/var/www" /etc/httpd/conf.d
/etc/httpd/conf.d/nagiosql.conf:Alias /nagiosql "/var/www/html/nagiosql"
/etc/httpd/conf.d/nagiosql.conf:<Directory "/var/www/html/nagiosql">
/etc/httpd/conf.d/ssl.conf.nagiosxibackup:#DocumentRoot "/var/www/html"
/etc/httpd/conf.d/ssl.conf.nagiosxibackup:<Directory "/var/www/cgi-bin">
/etc/httpd/conf.d/ssl.conf:#DocumentRoot "/var/www/html"
/etc/httpd/conf.d/ssl.conf:<Directory "/var/www/cgi-bin">
/etc/httpd/conf.d/mrtg.conf:Alias /mrtg /var/www/mrtg
[root@cvlwrl ~]#


Thanks!

Re: PDF Report error

Posted: Tue Sep 15, 2015 9:43 am
by tgriep
One of the things that could cause the PDF reports to fail is that the Program URL on the Admin > System Settings screen is not set like below.

Code: Select all

http://xxx.xxx.xxx.xxx/nagiosxi/
If the /nagiosxi/ is not on the end of the URL, the PDF reports will not work.
Make sure it is set like the example above.
Can you run the following in a shell on the Nagios system and post the output?

Code: Select all

ll /usr/local/nagiosxi/
ll /usr/local/nagiosxi/html/
ll /usr/local/nagiosxi/html/reports/