State History Reports scheduled for email are empty

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
luczynj
Posts: 88
Joined: Wed Dec 03, 2014 6:47 pm

State History Reports scheduled for email are empty

Post by luczynj »

Hello all,

I'm running the latest Nagios XI 5.6.2 on our backup Nagios XI instance, and somewhere along our upgrade path, the State History reports are failing via scheduled reports by email. I receive the PDF, CSV, and JPG attachments, but when I open them the associated application (IE, Acrobat for .PDF, Excel for .CSV, etc) say the attachment is corrupt. However, when I open them with a text editor the files contain "Your session has timed out".

Any help would be appreciated.

Regards,
JL
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: State History Reports scheduled for email are empty

Post by benjaminsmith »

Hi JL,

You're likely maxing out the php defaults and as a result the server is not able to complete the report in time. We have a knowledge-base article on optimizing your php settings for larger Nagios XI systems.

Please follow the article below:

Nagios XI - Optimizing The PHP Settings File

Let me know if you are able to resolve issue or have any questions.

Thanks.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
luczynj
Posts: 88
Joined: Wed Dec 03, 2014 6:47 pm

Re: State History Reports scheduled for email are empty

Post by luczynj »

Hi Benjamin,

Thanks for your quick response. We've already tweaked the /etc/php.ini due to another issue we had experienced.

Here are the lines in /etc/php.ini that are mentioned in the PHP tuning document you posted.

Do you have any other suggestions?

; ADDED by ADMIN on 20180502- ref. case XXXXXX
max_input_vars = 5000

; CHANGED by ADMIN on 20180502 - ref. case XXXXXX
; memory_limit = 128M
memory_limit = 256M

; CHANGED by ADMIN on 20180502 - ref. case XXXXXX
; max_execution_time = 30
max_execution_time = 300

; CHANGED by ADMIN on 20180502 - ref. case XXXXXX
; max_input_time = 60
max_input_time = 180

; ADDED by ADMIN on 20180502 - ref. case XXXXXX
max_input_vars = 5000


[root@nagios-b httpd]# grep -i maximum *error*
[root@nagios-b httpd]# grep -i increase *error*
[root@nagios-b httpd]# grep -i max_input *error*
[root@nagios-b httpd]# grep -i fatal *error*
[root@nagios-b httpd]#
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: State History Reports scheduled for email are empty

Post by benjaminsmith »

Hello,

Alright, it looks like the php settings have already been optimized, so it's most likely another issue.

Is this only happening for the State History Report? What happens when you download the PDF from the reports page?

You may have corrupted database tables, so please run the repair script as root:

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
If the issue still persists, please PM your system profile.

To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and share in a private message or upload it to the post/ticket.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
luczynj
Posts: 88
Joined: Wed Dec 03, 2014 6:47 pm

Re: State History Reports scheduled for email are empty

Post by luczynj »

I’m sorry. I should have mentioned that the reports work fine from the reports page, just not when they’re scheduled and emailed. The reports attached in the emails have the timeout message.

I’ll PM the profile.zip to you soon.

Thank you,
JL
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: State History Reports scheduled for email are empty

Post by benjaminsmith »

Hi JL,

Please go to /usr/local/nagiosxi/html and edit the following lines in config.inc.php.
// force http/https
$cfg['use_https']=false; // determines whether cron jobs and other scripts will force the use of HTTPS instead of HTTP

// allow for different http port for subsystem calls
// changed from false to 8080 as per forum suggestion for empty PDF reports emailed
$cfg['port_number'] = 8080;
.. and change those values to:

Code: Select all

$cfg['use_https']=true;
$cfg['port_number'] = false; 
.. and then re-start Apache:

Code: Select all

service httpd restart
To test this, go to the My Scheduled Reports page and select Send Now, and let me know if it's working correctly.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
luczynj
Posts: 88
Joined: Wed Dec 03, 2014 6:47 pm

Re: State History Reports scheduled for email are empty

Post by luczynj »

Hello,

Thanks for that. It is still sending reports with "Your session has timed out." in them.

Regards,
JL
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: State History Reports scheduled for email are empty

Post by benjaminsmith »

Hi JL,

Looking over the logs, there seems to be an issue with either ssl or the domain/url, even though it does generate the report.
WARNING: cannot verify nagiosxi.intra.bt.com's certificate, issued by "/C=GB/ST=Tufnell Park/L=London/O=British Telecom/CN=localhost":
Self-signed certificate encountered.
WARNING: certificate common name "localhost" doesn't match requested host name "nagiosxi.intra.bt.com".
HTTP request sent, awaiting response... 200 OK
Length: 27 [text/html]
Saving to: "/usr/local/nagiosxi/tmp/scheduledreport-luczynj-efD5DUplUdmf-1558021682-StateHistory.pdf"
0K 100% 2.54M=0s
1. Please go to Admin > System Settings > Security, and verify that the Session Cooking Settings have not been changed. The default Session Timeout is 30 min. ( See attached Image) and Keep Alive should be enabled.

2. In Admin > System Settings > General Program Settings. Can you provide a screen shot of your settings? The report is using domain name (nagiosxi.intra.bt.com/nagiosxi ) and this is resolving to a different IP address than what is defined for the Nagios XI server.

3. Can you test the report using the CSV option instead of PDF. Are you getting the same error?

If your still having issues, please PM your /etc/hosts file. Thanks.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
luczynj
Posts: 88
Joined: Wed Dec 03, 2014 6:47 pm

Re: State History Reports scheduled for email are empty

Post by luczynj »

The keep alive is set. And the timeout is set to 240 minutes.

I did add the FQDN to the /etc/hosts file when I saw that HTTPD restart complained about not being able to resolve the domain name.

The report via email is always the same timeout message, regardless of the attachment type.

We do use a single DNS for both Nagios servers and switch it to the current production IP address as needed. This server (.55) is currently our stand-by server and the URL is pointing to the .9 instance of Nagios. Could that be the problem?

Here's the part of our /etc/hosts you may want:

[root@nagios-b ~]# more /etc/hosts
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#64.235.47.134 mirrorlist.centos.org
#66.135.62.201 fedoraproject.org
168.125.36.55 nagios-b.tufnell-park.concert.com nagios-b localhost
168.125.36.9 NAGIOS-P nagios-p nagiosp nagios-p.tufnell-park.concert.com
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: State History Reports scheduled for email are empty

Post by benjaminsmith »

Hi JL,

What were seeing in the logs is when Nagios XI is trying to generate the report it is contacting the wrong server using the FQDN (.9) and therefore it cannot generate the report.
--2019-05-15 16:41:57-- 'https://nagiosxi.intra.bt.com/nagiosxi/ ... 0fec2bfb38'
Resolving nagiosxi.intra.bt.com... 168.125.36.9
Can you comment out 168.125.36.9 NAGIOS-P nagios-p nagiosp nagios-p.tufnell-park.concert.com in the etc/host file.

Go to Admin > System Settings > General Program Settings, and provide a screen shot of your Program URL and External URL settings?

Please test and again and provide a fresh system profile if you're still having trouble.

Thanks.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked