how to turn off automatically delete file in temp folder

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

how to turn off automatically delete file in temp folder

Post by sacom01 »

hi,
i have two questions :
1. i found /usr/local/nagiosxi/tmp is a temp folder for Schedule Report.
Everytime send a report email, it will create a .pdf file inside /usr/local/nagiosxi/tmp folder, after send the email, files automatically will be deleted.
I want to ask : how can i turn off automatically delele file inside this folder and change it to manually delete. Where i can find this config? i want keep these file more than 1 day then manually remove.

2. when i schedule the performance graphs report, and see the Schedule report history, it usually have Error in Status column(sometime success), but mail success sent, pdf file open ok. Dont know why it happen.

thank you.
You do not have the required permissions to view the files attached to this post.
Last edited by sacom01 on Mon Jun 14, 2021 8:48 pm, edited 1 time in total.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: how to turn off automatically delete file on temp file

Post by benjaminsmith »

Hi @sacom01,

On the first question, I'm pretty sure that option is set in the code, but I'll follow up with the developer to see if there are any changes to the configuration files that would change that behavior.

On your second question, I believe it's taking longer to generate and send the report, and that's why the status is not being returned as expected but it's still sending the report successfully.

Have you optimized the PHP settings on this server yet. If not, please go ahead and increase the memory, input variable, and execution time as directed in the article below, and let me know if you notice an improvement. Thanks, Benjamin

Nagios XI - Optimizing The PHP Settings File
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!
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: how to turn off automatically delete file in temp folder

Post by sacom01 »

hi,
"Have you optimized the PHP settings on this server yet. If not, please go ahead and increase the memory, input variable, and execution time"
--> already increased like below but still facing error status when report schedule execute.

[root@dc-nagiosxi01 ~]# cat /etc/php.ini | grep max_input_vars
max_input_vars = 100000
[root@dc-nagiosxi01 ~]# cat /etc/php.ini | grep memory_limit
memory_limit = 10240M
[root@dc-nagiosxi01 ~]# cat /etc/php.ini | grep max_execution_time
max_execution_time = 1200


"On the first question, I'm pretty sure that option is set in the code, but I'll follow up with the developer to see if there are any changes to the configuration files that would change that behavior."
--> yes pls, we need file just for daily report asap.

If unable to do that, is there anyway for get all hosts report in ONE email only, and minimize file size (pdf file)?

Now we have about 60 hosts and we need receive Performance graphs report for daily, but now nagios only support send report on everyhost, and file size about upto 4MB per host. So that's why i need get temp file in /usr/local/nagiosxi/tmp for compress and send email using crontab.

Any suggest for us in this case?

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

Re: how to turn off automatically delete file in temp folder

Post by benjaminsmith »

Hi,

Regarding the status error, what version of Nagios XI are you currently using, and what operating system (vendor and version)? We're testing this right now and have not been able to replicate the error consistently.

Also, please post the output to the log below?

Code: Select all

cat /usr/local/nagiosxi/var/wkhtmltox.log
Regarding the other question, it's not currently possible to edit the reporting scripts since they are protected by source guardian. One option would be to stagger the schedule reports to minimize the performance impact. It's also possible to export the performance graph data itself using the REST API.

We are planning to re-work the report engine in the next major release (coming soon!) for more flexibility.
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!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: how to turn off automatically delete file in temp folder

Post by benjaminsmith »

Hi,

Can you post the output to the following log as well?

Code: Select all

/usr/local/nagiosxi/var/scheduledreporting.log
Thanks,
Benjamin
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!
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: how to turn off automatically delete file in temp folder

Post by sacom01 »

[root@dc-nagiosxi01 ~]# cat /usr/local/nagiosxi/var/wkhtmltox.log
/usr/bin/wkhtmltopdf --javascript-delay 1000 --no-stop-slow-scripts --lowquality --no-outline --footer-spacing 3 --margin-bottom 15mm --footer-font-size 9 --footer-right "Page [page] of [toPage]" --footer-left "2021-03-04 16:17:06" -O landscape 'http://localhost/nagiosxi/includes/comp ... r_compat=1' '/usr/local/nagiosxi/tmp/exportreport-hangltt-6040a59269dbc'
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
[root@dc-nagiosxi01 ~]#


Attach file is tail -500 rows of schedule report log.

"Regarding the other question, it's not currently possible to edit the reporting scripts since they are protected by source guardian. One option would be to stagger the schedule reports to minimize the performance impact. It's also possible to export the performance graph data itself using the REST API."
--> can you explain more? or any document?
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: how to turn off automatically delete file in temp folder

Post by benjaminsmith »

Hi,

Great, thank you. What version of Nagios XI are you using and the OS? We noticed that the wkhtmltox.log is not being updated (last entry was 2021-03-04 16:17:06 ), so let's check the permissions on that file.

Code: Select all

ls -l /usr/local/nagiosxi/var/wkhtmltox.log
They should be set as follows.

Code: Select all

chown nagios.nagios /usr/local/nagiosxi/var/wkhtmltox.log
chmod 666 /usr/local/nagiosxi/var/wkhtmltox.log
Also, please post the output to the following command to check the version of wkhtmltopdf on this server.

Code: Select all

/usr/bin/wkhtmltopdf -V
The API commands are fully documented in the interface at Help > API Docs (See API - Objects Reference). Also, can you PM a fresh 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
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!
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: how to turn off automatically delete file in temp folder

Post by sacom01 »

OS : redhat 7.
nagios xi : 5.8.1
[root@dc-nagiosxi01 ~]# /usr/bin/wkhtmltopdf -V
wkhtmltopdf 0.12.1.3 (with patched qt)

pls check you inbox. already pm the profile.
thanks
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: how to turn off automatically delete file in temp folder

Post by benjaminsmith »

Hi @sacom01,

Got the profile, thank you. I'm able to repeat the error consistently if I have the program URL set to the wrong address in the system settings. (Also, try using the IP address instead of the FQDN). Please go to Admin > System Config > System Settings, and make sure this is set correctly.
program-url.png
Also, open up the following file.

Code: Select all

 vi /usr/local/nagiosxi/html/config.inc.php
And change this line.

Code: Select all

// Force http/https
$cfg['use_https'] = false; // determines whether cron jobs and other scripts will force the use of HTTPS instead of HTTP
To this.

Code: Select all

// Force http/https
$cfg['use_https'] = true; // determines whether cron jobs and other scripts will force the use of HTTPS instead of HTTP
Then test once more. If it fails again, please run the following command from the CLI and post the output.

Code: Select all

 wget --no-check-certificate -O "/usr/local/nagiosxi/tmp/scheduledreport-nagiosadmin-WXdkhWaHFGKM-1623859806-Availability_Report.pdf" 'https://<IPADDRESS>/nagiosxi//reports/availability.php?reportperiod=last24hours&startdate=&enddate=&host=&service=&hostgroup=&servicegroup=&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&locale=&mode=pdf&token=eb19b3f1e96c883fdc501586084b9b9b11792f65'
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!