Page 2 of 3

Re: PDF Reports failing to generate

Posted: Mon Jun 15, 2015 3:44 pm
by derekb
I've added the code as requested.

I hit F5 to refresh the page, and constantly ran the command you gave. That didn't work, so I clicked the PDF icon again to attempt to re-generate the report, while running the command every second via CLI.

Each time,
[root@nagios libexec]# sh /tmp/notifications_pdf.sh
sh: /tmp/notifications_pdf.sh: No such file or directory

Re: PDF Reports failing to generate

Posted: Mon Jun 15, 2015 3:55 pm
by ssax
Oh, I should mention that you need to do this on the notifications report page if you aren't.

What user/group are you running HTTPD as?

Code: Select all

grep 'User\|Group' /etc/httpd/conf/httpd.conf
Also, please attach your /usr/local/nagiosxi/html/reports/notifications.php file so that I can see the changes.

Re: PDF Reports failing to generate

Posted: Tue Jun 16, 2015 12:55 pm
by derekb
[root@nagios reports]# sh /tmp/notifications_pdf.sh
Loading pages (1/6)
Error: Failed loading page http://mydomain.com/nagiosxi//reports/n ... rds=100000 (sometimes it will work just to ignore this error with --load-error-handling ignore)
Exit with code 1 due to network error: TimeoutError

The one thing I notice is the URL...There are two // after nagiosxi. Not sure if that's the issue.

Re: PDF Reports failing to generate

Posted: Tue Jun 16, 2015 2:24 pm
by ssax
I saw the two forward slashes earlier and I tested it on mine with two of them and it didn't have an impact.

What is the output of this?

Code: Select all

grep 'User\|Group' /etc/httpd/conf/httpd.conf
I notice that it says "Error: Failed loading page http://mydomain.com/blah/blah/blah" and earlier in the thread you posted it was nagios.mydomain.com, is that a editing/posting error or is it really missing the nagios.?

Also, how long of a time period did you want from when you tried to generate it until when you ran the sh /tmp/notifications_pdf.sh command? You should do it right away so the ticket doesn't expire.

Re: PDF Reports failing to generate

Posted: Tue Jun 16, 2015 2:38 pm
by derekb
I edited it out for security. My domain is really nagios.whatever.com... The output I get does show my correct domain information. :)

After the report page show failed, the entry right away. I ran the .sh nonstop until it produced the output.

Code: Select all

-rw-r--r--. 1 root root 34417 Jun 10 14:30 httpd.conf

Re: PDF Reports failing to generate

Posted: Tue Jun 16, 2015 3:34 pm
by ssax
Wrong command, please post the output of this command:

Code: Select all

grep 'User\|Group' /etc/httpd/conf/httpd.conf

Re: PDF Reports failing to generate

Posted: Tue Jun 16, 2015 3:45 pm
by derekb

Code: Select all

[root@nagios ~]# grep 'User\|Group' /etc/httpd/conf/httpd.conf
# User/Group: The name (or #number) of the user/group to run httpd as.
#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
#  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
#  when the value of (unsigned)Group is above 60000;
#  don't use Group #-1 on these systems!
User apache
Group apache
# UserDir: The name of the directory that is appended onto a user's home
    # UserDir is disabled by default since it can confirm the presence
    UserDir disabled
    # directory, remove the "UserDir disabled" line above, and uncomment
    #UserDir public_html
# Control access to UserDir directories.  The following is an example
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{User-agent}i" agent
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio


Re: PDF Reports failing to generate

Posted: Tue Jun 16, 2015 3:57 pm
by tgriep
Can you run the following and post the output?

Code: Select all

wkhtmltopdf -V
which wkhtmltopdf

Re: PDF Reports failing to generate

Posted: Tue Jun 16, 2015 3:58 pm
by lmiltchev
Are you using/forcing SSL? If you are, change:

Code: Select all

Program URL: http://nagios.mydomain.com/nagiosxi/
External URL: http://nagios.mydomain.com/nagiosxi/
to this:

Code: Select all

Program URL: https://nagios.mydomain.com/nagiosxi/
External URL: https://nagios.mydomain.com/nagiosxi/

Re: PDF Reports failing to generate

Posted: Wed Jun 17, 2015 11:43 am
by derekb
tgriep wrote:Can you run the following and post the output?

Code: Select all

wkhtmltopdf -V
which wkhtmltopdf

Code: Select all

[root@nagios ~]# wkhtmltopdf -V
wkhtmltopdf 0.12.1-c22928d (with patched qt)
[root@nagios ~]# which wkhtmltopdf
/usr/bin/wkhtmltopdf
[root@nagios ~]#
lmiltchev wrote:Are you using/forcing SSL? If you are, change:

Code: Select all

Program URL: http://nagios.mydomain.com/nagiosxi/
External URL: http://nagios.mydomain.com/nagiosxi/
to this:

Code: Select all

Program URL: https://nagios.mydomain.com/nagiosxi/
External URL: https://nagios.mydomain.com/nagiosxi/
We're not enforcing SSL. I browse to my XI installation using regular http.