Not able to generate report using NAT IP

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
wiproltdwiv
Posts: 281
Joined: Sat Sep 08, 2012 12:52 am

Not able to generate report using NAT IP

Post by wiproltdwiv »

Hi,

We are not able to generate report using NAT IP or from remote location system, getting below error. pls suggest.


FPDF error: Not a PNG file: /tmp/availabilityLXTXk8.png

Code: Select all

[root@EMSNagios1 ~]# tail /var/log/httpd/error_log
[Wed Feb 06 16:18:07 2013] [error] [client 172.16.66.4] PHP Warning:  file_get_contents(http://172.29.70.37/nagiosxi/reports/availability.php?1360147687&mode=getchart&type=host&title=Host+Availability&data=55.779970013038,44.220029986962,0&legend=Up,Down,Unreachable&colors=%2356DA56,%23E9513D,%23CB2525&username=nagiosadmin&ticket=jso6hra6): failed to open stream: No route to host in /usr/local/nagiosxi/html/reports/availability.php on line 2394, referer: http://172.29.70.37/nagiosxi/reports/availability.php?&
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Not able to generate report using NAT IP

Post by lmiltchev »

We've confirmed this behavior, and added this to our TODO list. We will let you know as soon as this is fixed.

Meanwhile, you can try accessing it not by IP, but by hostname, and map the hostname to localhost in the /etc/hosts file.

Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Not able to generate report using NAT IP

Post by scottwilkerson »

Actually looking at this we believe it may be cause by allow_fopen_url being turned off in the php.ini. You can check the value by running in terminal:

Code: Select all

cat /etc/php.ini | grep allow_url_fopen
Can you confirm that 172.29.70.37 is the IP of your XI server?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
wiproltdwiv
Posts: 281
Joined: Sat Sep 08, 2012 12:52 am

Re: Not able to generate report using NAT IP

Post by wiproltdwiv »

[root@EMSNagios1 ~]# cat /etc/php.ini | grep allow_url_fopen
allow_url_fopen = On

[root@EMSNagios1 ~]# tail /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.29.70.37 EMSNagios1.co-opbank.co.in
10.128.17.12 EMSNagios1.co-opbank.co.in EMSNagios1


Our Nagios server physical ip is 10.128.17.12 and we access with, also we have mention http://172.29.70.37/nagiosxi/ this url in system setting so we can access nagios from remote location and it is NAT IP.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Not able to generate report using NAT IP

Post by abrist »

Have you tried adding localhost to the 2 addresses of the localhost in /etc/hosts?

Code: Select all

172.29.70.37    EMSNagios1.co-opbank.co.in localhost
10.128.17.12    EMSNagios1.co-opbank.co.in localhost     EMSNagios1
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
wiproltdwiv
Posts: 281
Joined: Sat Sep 08, 2012 12:52 am

Re: Not able to generate report using NAT IP

Post by wiproltdwiv »

yes we tried the same. but still we struck with same issue
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Not able to generate report using NAT IP

Post by scottwilkerson »

In my opinion, the /etc/hosts should contain just

Code: Select all

10.128.17.12    EMSNagios1.co-opbank.co.in localhost     EMSNagios1
Then if you access the page by name (EMSNagios1.co-opbank.co.in) and not IP address it will do the lookup based on that, which the XI server should see it as 10.128.17.12
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
wiproltdwiv
Posts: 281
Joined: Sat Sep 08, 2012 12:52 am

Re: Not able to generate report using NAT IP

Post by wiproltdwiv »

one more thing.. we cannot able to generate availability in pdf.. rest of the reports like state history, top alert producers we are getting pdf output
wiproltdwiv
Posts: 281
Joined: Sat Sep 08, 2012 12:52 am

Re: Not able to generate report using NAT IP

Post by wiproltdwiv »

pls find the below http/error-log

[Fri Apr 05 15:46:17 2013] [error] [client 172.16.66.22] PHP Warning: file_get_contents(http://172.29.70.37/nagiosxi/reports/av ... t=jso6hra6): failed to open stream: no suitable wrapper could be found in /usr/local/nagiosxi/html/reports/availability.php on line 2437, referer: http://172.29.70.37/nagiosxi/reports/availability.php
wiproltdwiv
Posts: 281
Joined: Sat Sep 08, 2012 12:52 am

Re: Not able to generate report using NAT IP

Post by wiproltdwiv »

below error log after openurl to on state

[Fri Apr 05 15:56:17 2013] [error] [client 172.16.66.22] PHP Warning: file_get_contents(http://172.29.70.37/nagiosxi/reports/av ... t=jso6hra6): failed to open stream: Connection timed out in /usr/local/nagiosxi/html/reports/availability.php on line 2437, referer: http://172.29.70.37/nagiosxi/reports/av ... ity.php?&=
Locked