Page 2 of 5

Re: Issues/questions with version 2R1.0

Posted: Tue Mar 10, 2015 9:09 am
by lmiltchev
I don't think this is going to be easy to implement, but go ahead - post this feature request, provide us with a link to it, and let us know if it is safe to lock this topic.

Re: Issues/questions with version 2R1.0

Posted: Tue Mar 10, 2015 10:19 am
by snapon_admin
Here's the link: http://tracker.nagios.com/view.php?id=691

Hopefully it is possible. It's not something that's overly critical for us, but it would be handy. As for closing the thread I still haven't heard anything on the PDF issue. It looks like the fonts were installed, but we still can't get PDFs to generate properly.

Re: Issues/questions with version 2R1.0

Posted: Tue Mar 10, 2015 1:28 pm
by jomann
Has the error changed? If so, can you please tail your apache error_log and run the pdf generation and then copy/paste what the error is from both the screen and the apache error_log?

Are you connecting to the NNA server via SSL? Can the NNA server contact itself via 127.0.0.1/localhost using SSL to generate the reports?

Re: Issues/questions with version 2R1.0

Posted: Tue Mar 10, 2015 2:15 pm
by snapon_admin
Nope. Error is still the same.

Code: Select all

[root@lisl-ngna-01-pv nagiosna]# tail -f /var/log/httpd/error_log
Loading headers and footers (5/6)                                           
Printing pages (6/6)
Done                                                                      
Loading pages (1/6)
Warning: SSL error ignored                                        
Counting pages (2/6)                                               
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)
Done                                                                      
Loading pages (1/6)
Warning: SSL error ignored                                        
Counting pages (2/6)                                               
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)
Done                                                   
dissallowd characters.jpg
Yes, server is connected via SSL, not sure what you mean by "Can the NNA server contact itself via 127.0.0.1/localhost using SSL to generate the reports?"

Re: Issues/questions with version 2R1.0

Posted: Tue Mar 10, 2015 2:58 pm
by jomann
I was about to post something else (read below) but I don't think that's the case. What is the name of the report that you are trying to turn into a PDF? Is it a standard Top Talkers report or a custom one? The "Disallowed Key Characters" may be an error from Codeigniter trying to read the URL.

Original thought:
If you're logged into the NNA server, can it connect to itself via localhost - such as a url like https://localhost/nagiosna/index.php/reports/ ......
The reason that matters is because when the PDF is generated it runs wkhtmltopdf and sends in the URL it's supposed to create the pdf based on. We normally send a http://localhost/nagiosna/index.php/xxxxxx URL in to wkhtmltopdf so it's possible that it is not making it to the page it's trying to get to. The error it is receiving may be an SSL error.

Re: Issues/questions with version 2R1.0

Posted: Tue Mar 10, 2015 3:06 pm
by snapon_admin
That report was the standard Top 5 Talkers By Source IP (Last 24 Hours) report that's built in already, but we get this error with anything that has the PDF button. Reports, queries, all of that.

Re: Issues/questions with version 2R1.0

Posted: Tue Mar 10, 2015 3:31 pm
by jomann
I'm curious if passing a URL locally to the server without the HTTPS would cause it to change the URL at all. If it does, that could be why the error is showing. This particular error is apparently form codeigniter inputs.

Re: Issues/questions with version 2R1.0

Posted: Tue Mar 10, 2015 3:36 pm
by snapon_admin
Do you need to see the URL for the PDF? Right now we have SSL forced, so all the URLs are HTTPS. Due to security concerns from our security team that is how we need to keep the setup.

Re: Issues/questions with version 2R1.0

Posted: Tue Mar 10, 2015 3:54 pm
by jomann
We should be able to test this by running the following (substitute your nagiosadmin api key for <apikey>) in the command line:

Code: Select all

/usr/local/bin/wkhtmltopdf --no-outline -O "Portrait" --footer-spacing 3 --margin-bottom 14mm --footer-font-size 9 --footer-left "Network Analyzer Report" --footer-right "Page [page] of [toPage]" "http://127.0.0.1/nagiosna/index.php/sources/reports/1?download=1&token=<apikey>&q[rid]=1&q[sid]=2" "/tmp/page.pdf"
This should generate the /tmp/page.pdf file that we create when you click the generate file button. Also, the source that it runs on is the "reports/x" part above. You can fill in x with whatever source ID you want. You can get the source ID from the URL when you click into a source in NNA. It will be the number at the end of the URL.

As a side note, if it does not give any helpful information that is different than you're already getting when generating that report, I'd like you to try doing a wget to the URL specified in the above command line and copy/paste the contents of the file it returns to see if that may give us any useful information.

Re: Issues/questions with version 2R1.0

Posted: Tue Mar 10, 2015 4:01 pm
by snapon_admin
None of it's helpful information for me, lol. See if you can make heads or tails of it:

Code: Select all

[root@lisl-ngna-01-pv nagiosna]# /usr/local/bin/wkhtmltopdf --no-outline -O "Portrait" --footer-spacing 3 --margin-bottom 14mm --footer-font-size 9 --footer-left "Network Analyzer Report" --footer-right "Page [page] of [toPage]" "http://127.0.0.1/nagiosna/index.php/sources/reports/55?download=1&token=c35dfd74f0b152179aaf212a018642fc1c3f58a3&q[rid]=1&q[sid]=2" "/tmp/page.pdf"       
Loading pages (1/6)
Warning: SSL error ignored                                        
Counting pages (2/6)                                               
Resolving links (4/6)                                                       
Loading headers and footers (5/6)                                           
Printing pages (6/6)
Done                                                                      
[root@lisl-ngna-01-pv nagiosna]# cd /tmp
[root@lisl-ngna-01-pv tmp]# wget http://127.0.0.1/nagiosna/index.php/sources/reports/55?download=1&token=&q[rid]=1&q[sid]=2
[1] 63420
[2] 63421
[3] 63422
[2]-  Done                    token=
[3]+  Done                    q[rid]=1
[root@lisl-ngna-01-pv tmp]# --2015-03-10 16:00:29--  http://127.0.0.1/nagiosna/index.php/sources/reports/55?download=1
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://127.0.0.1/nagiosna/index.php/sources/reports/55?download=1 [following]
--2015-03-10 16:00:29--  https://127.0.0.1/nagiosna/index.php/sources/reports/55?download=1
Connecting to 127.0.0.1:443... connected.
ERROR: cannot verify 127.0.0.1’s certificate, issued by â€/C=US/O=GeoTrust, Inc./CN=GeoTrust SSL CA”:
  Unable to locally verify the issuer’s authority.
    ERROR: certificate common name â€*.snapon.com” doesn't match requested host name â€127.0.0.1”.
To connect to 127.0.0.1 insecurely, use ‘--no-check-certificate’.
^C
[1]+  Exit 5                  wget http://127.0.0.1/nagiosna/index.php/sources/reports/55?download=1